ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: shibata.hiroshi@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:72405] [Ruby trunk - Bug #11842] r53123 breaks some gems which use erb
Date: Sun, 20 Dec 2015 06:39:48 +0000	[thread overview]
Message-ID: <redmine.journal-55693.20151220063945.be415e0c6c39ceec@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-11842.20151219070325@ruby-lang.org

Issue #11842 has been updated by Hiroshi SHIBATA.


I found same case with rspec-rails in latest gems registered rubygems.org. It is widely used application development. I decided to revert r53123.

> Takashi Kokubun

We will try next release. Thank you for your investigation.

----------------------------------------
Bug #11842: r53123 breaks some gems which use erb
https://bugs.ruby-lang.org/issues/11842#change-55693

* Author: Kaneko Yuichiro
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.0dev (trunk 53153) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
r53123 breaks some gems which use erb.

Thor gem for example.
They set an instance variable `"@output_buffer"` to 4th argument (`eoutvar`) of `ERB.new` ([here](https://github.com/erikhuda/thor/blob/f0c2166534e122636f5ce04d61885736ef605617/lib/thor/actions/file_manipulation.rb#L116)).
And change this instance variable from outside erb ([here](https://github.com/erikhuda/thor/blob/f0c2166534e122636f5ce04d61885736ef605617/lib/thor/actions/file_manipulation.rb#L308)).

[Example code of erb](https://github.com/ruby/ruby/blob/ec7a964dca57821d2d7a36f168c2355a46a76ca2/lib/erb.rb#L751) shows this usage of `eoutvar`.
I think we should revert r53123 and add a test case for this usage.

```
Failures:

  1) Thor::Actions#template allows using block helpers in the template
     Failure/Error: concat(result.strip + " world!")

     NoMethodError:
       undefined method `strip' for ["Hello\n"]:Array
     # ./spec/fixtures/group.thor:58:in `world'
     # (erb):1:in `template'
     # ./lib/thor/actions/file_manipulation.rb:116:in `block in template'
     # ./lib/thor/actions/create_file.rb:53:in `render'
     # ./lib/thor/actions/create_file.rb:62:in `block (2 levels) in invoke!'
     # ./lib/thor/actions/create_file.rb:62:in `open'
     # ./lib/thor/actions/create_file.rb:62:in `block in invoke!'
     # ./lib/thor/actions/empty_directory.rb:116:in `invoke_with_conflict_check'
     # ./lib/thor/actions/create_file.rb:60:in `invoke!'
     # ./lib/thor/actions.rb:94:in `action'
     # ./lib/thor/actions/create_file.rb:25:in `create_file'
     # ./lib/thor/actions/file_manipulation.rb:115:in `template'
     # ./spec/actions/file_manipulation_spec.rb:11:in `block in action'
     # ./spec/helper.rb:55:in `capture'
     # ./spec/actions/file_manipulation_spec.rb:11:in `action'
     # ./spec/actions/file_manipulation_spec.rb:160:in `block (3 levels) in <top (required)>'
```



-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2015-12-20  6:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-11842.20151219070325@ruby-lang.org>
2015-12-19  7:03 ` [ruby-core:72374] [Ruby trunk - Bug #11842] [Open] r53123 breaks some gems which use erb spiketeika
2015-12-19  7:27 ` [ruby-core:72375] [Ruby trunk - Bug #11842] " takashikkbn
2015-12-19 12:09 ` [ruby-core:72377] " shibata.hiroshi
2015-12-19 12:26 ` [ruby-core:72378] " takashikkbn
2015-12-20  6:39 ` shibata.hiroshi [this message]
2015-12-20  7:18 ` [ruby-core:72406] " takashikkbn
2016-02-03 10:36 ` [ruby-core:73672] [Ruby trunk Bug#11842] " usa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-55693.20151220063945.be415e0c6c39ceec@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).