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/