path: root/ext/etc
diff options
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-22 13:28:25 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-22 13:28:25 +0000
commitcc777d09f44fa909a336ba14f3aa802ffe16e010 (patch)
treef360ca1bfed187f981397f6c7370360287606ffb /ext/etc
parent1727c8358498054428a376b52869983549f62399 (diff)
erb.rb: deprecate safe_level of
Also, as it's in the middle of the list of 4 arguments, 3rd and 4th arguments (trim_mode, eoutvar) are changed to keyword arguments. Old ways to specify arguments are deprecated and warned now. bin/erb: deprecate -S option. We'll remove all of deprecated ones at Ruby 2.7+. enc/make_encmake.rb: stopped using deprecated interface ext/etc/mkconstants.rb: ditto ext/socket/mkconstants.rb: ditto sample/ripper/ruby2html.rb: ditto spec/ruby/library/erb/defmethod/def_erb_method_spec.rb: ditto spec/ruby/library/erb/new_spec.rb: ditto test/erb/test_erb.rb: ditto test/erb/test_erb_command.rb: ditto tool/generic_erb.rb: ditto tool/ruby_vm/helpers/dumper.rb: ditto tool/transcode-tblgen.rb: ditto lib/rdoc/erbio.rb: ditto lib/rdoc/generator/darkfish.rb: ditto [Feature #14256] git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/etc')
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/etc/mkconstants.rb b/ext/etc/mkconstants.rb
index 18f34c9..69b472d 100644
--- a/ext/etc/mkconstants.rb
+++ b/ext/etc/mkconstants.rb
@@ -66,7 +66,15 @@ def each_name(pat)
end<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
+erb_new = lambda do |src, safe, trim|
+ if RUBY_VERSION >= '2.6'
+, trim_mode: trim)
+ else
+, safe, trim)
+ end
+<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
% each_const {|name, default_value|
#if !defined(<%=name%>)
# if defined(HAVE_CONST_<%=name.upcase%>)
@@ -80,7 +88,7 @@<<'EOS', nil, '%').def_method(Object, "gen_const_decls")
% }
EOS<<'EOS', nil, '%').def_method(Object, "gen_const_defs")<<'EOS', nil, '%').def_method(Object, "gen_const_defs")
% each_const {|name, default_value|
#if defined(<%=name%>)
% if comment = COMMENTS[name]
@@ -91,13 +99,13 @@<<'EOS', nil, '%').def_method(Object, "gen_const_defs")
% }
-header_result =<<'EOS', nil, '%').result(binding)
+header_result =<<'EOS', nil, '%').result(binding)
/* autogenerated file */
<%= gen_const_decls %>
-result =<<'EOS', nil, '%').result(binding)
+result =<<'EOS', nil, '%').result(binding)
/* autogenerated file */