summaryrefslogtreecommitdiff
path: root/enc
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-27 11:12:23 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-27 11:12:23 +0000
commit3406c5d61372e7b229cf2f925b89d5d9fd8728cd (patch)
tree23224a94bb0172874d15200a81416d1c2a206cf7 /enc
parent86d9071e0b81de7032cd52de0ec5f2af14a804c9 (diff)
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 'enc')
-rwxr-xr-xenc/make_encmake.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb
index dc4b5ef..bc0597e 100755
--- a/enc/make_encmake.rb
+++ b/enc/make_encmake.rb
@@ -121,7 +121,7 @@ ENCS, ENC_DEPS = target_encodings
ATRANS, TRANS = target_transcoders
if File.exist?(depend = File.join($srcdir, "depend"))
- if ERB.version[/\d+\.\d+/] >= '2.2'
+ if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
erb = ERB.new(File.read(depend), trim_mode: '%')
else
erb = ERB.new(File.read(depend), nil, '%')
@@ -139,7 +139,7 @@ open(ARGV[0], 'wb') {|f|
}
if MODULE_TYPE == :static
filename = "encinit.c.erb"
- if ERB.version[/\d+\.\d+/] >= '2.2'
+ if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
erb = ERB.new(File.read(File.join($srcdir, filename)), trim_mode: '%-')
else
erb = ERB.new(File.read(File.join($srcdir, filename)), nil, '%-')