diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-27 11:12:23 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-27 11:12:23 +0000 |
commit | 3406c5d61372e7b229cf2f925b89d5d9fd8728cd (patch) | |
tree | 23224a94bb0172874d15200a81416d1c2a206cf7 /tool/ruby_vm | |
parent | 86d9071e0b81de7032cd52de0ec5f2af14a804c9 (diff) | |
download | ruby-3406c5d61372e7b229cf2f925b89d5d9fd8728cd.tar.gz |
Refactor ERB version checking for keyword arguments
Improving code like r62590. See r62529 for details.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ruby_vm')
-rw-r--r-- | tool/ruby_vm/helpers/dumper.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tool/ruby_vm/helpers/dumper.rb b/tool/ruby_vm/helpers/dumper.rb index 8ac8b1c4ce..ccd5717cc8 100644 --- a/tool/ruby_vm/helpers/dumper.rb +++ b/tool/ruby_vm/helpers/dumper.rb @@ -32,8 +32,7 @@ class RubyVM::Dumper rescue Errno::ENOENT raise "don't know how to generate #{path}" else - match = ERB.version.match(/\Aerb\.rb \[(?<version>[^ ]+) /) - if match && match[:version] >= '2.2.0' # Ruby 2.6+ + if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+ erb = ERB.new(src, trim_mode: '%-') else erb = ERB.new(src, nil, '%-') |