summaryrefslogtreecommitdiff
path: root/ext/etc
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-27 11:12:23 (GMT)
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-27 11:12:23 (GMT)
commit3406c5d61372e7b229cf2f925b89d5d9fd8728cd (patch)
tree23224a94bb0172874d15200a81416d1c2a206cf7 /ext/etc
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 'ext/etc')
-rw-r--r--ext/etc/mkconstants.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/etc/mkconstants.rb b/ext/etc/mkconstants.rb
index 69b472d..a752d64 100644
--- a/ext/etc/mkconstants.rb
+++ b/ext/etc/mkconstants.rb
@@ -67,7 +67,7 @@ def each_name(pat)
end
erb_new = lambda do |src, safe, trim|
- if RUBY_VERSION >= '2.6'
+ if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
ERB.new(src, trim_mode: trim)
else
ERB.new(src, safe, trim)