r53123 breaks some gems which use erb
r53123 breaks some gems which use erb.
Example code of erb shows this usage of
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)>'
Updated by k0kubun (Takashi Kokubun) over 4 years ago
While this case is fixable by https://github.com/erikhuda/thor/pull/512, there may be some gems depending on the eoutvar's behavior.
If "Pass the name of the variable to be used inside a String" is specification, r53123 should be breaking change and I have no objection to revert the patch.
Updated by hsbt (Hiroshi SHIBATA) over 4 years ago
- Status changed from Open to Closed
Applied in changeset r53216.
- lib/erb.rb: revert r53123. It break compatibility like thor and rspec-rails. We should try with Ruby 2.4 or 3.0. [Bug #11842][ruby-core:72374]
- lib/rdoc/erb_partial.rb: ditto.
- template/verconf.h.tmpl: ditto.