зеркало из https://github.com/github/ruby.git
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0f4978d533
Коммит
0516a3378f
|
@ -1,3 +1,11 @@
|
|||
Sun Dec 20 15:36:46 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||
|
||||
* 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.
|
||||
|
||||
Sun Dec 20 11:43:31 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (parser_yylex): allow here documents in labeled
|
||||
|
|
10
lib/erb.rb
10
lib/erb.rb
|
@ -590,7 +590,7 @@ class ERB
|
|||
end
|
||||
|
||||
def add_insert_cmd(out, content)
|
||||
out.push("#{@insert_cmd}((#{content}))")
|
||||
out.push("#{@insert_cmd}((#{content}).to_s)")
|
||||
end
|
||||
|
||||
# Compiles an ERB template into Ruby code. Returns an array of the code
|
||||
|
@ -835,10 +835,10 @@ class ERB
|
|||
# requires the setup of an ERB _compiler_ object.
|
||||
#
|
||||
def set_eoutvar(compiler, eoutvar = '_erbout')
|
||||
compiler.put_cmd = "#{eoutvar}.push"
|
||||
compiler.insert_cmd = "#{eoutvar}.push"
|
||||
compiler.pre_cmd = ["#{eoutvar} = []"]
|
||||
compiler.post_cmd = ["#{eoutvar}.join.force_encoding(__ENCODING__)"]
|
||||
compiler.put_cmd = "#{eoutvar}.concat"
|
||||
compiler.insert_cmd = "#{eoutvar}.concat"
|
||||
compiler.pre_cmd = ["#{eoutvar} = ''"]
|
||||
compiler.post_cmd = ["#{eoutvar}.force_encoding(__ENCODING__)"]
|
||||
end
|
||||
|
||||
# Generate results and print them. (see ERB#result)
|
||||
|
|
|
@ -12,7 +12,7 @@ class RDoc::ERBPartial < ERB
|
|||
def set_eoutvar compiler, eoutvar = '_erbout'
|
||||
super
|
||||
|
||||
compiler.pre_cmd = ["#{eoutvar} ||= []"]
|
||||
compiler.pre_cmd = ["#{eoutvar} ||= ''"]
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
% R["exec_prefix"] = '"RUBY_EXEC_PREFIX"'
|
||||
% R["prefix"] = '"RUBY_EXEC_PREFIX"'
|
||||
% exec_prefix_pat = /\A"#{Regexp.quote(rbconfig::CONFIG['exec_prefix'])}(?=\/|\z)/
|
||||
% _erbout = [_erbout.join.gsub!(/^(#define\s+(\S+)\s+)(.*)/) {
|
||||
% _erbout.gsub!(/^(#define\s+(\S+)\s+)(.*)/) {
|
||||
% pre, name, repl = $1, $2, $3
|
||||
% pat = %["#{name}"]
|
||||
% c = C.merge(R.reject {|key, value| key == name or value.include?(pat)})
|
||||
|
@ -60,4 +60,4 @@
|
|||
% repl.gsub!(/^""(?!$)|(.)""$/, '\1')
|
||||
% repl.sub!(exec_prefix_pat, 'RUBY_EXEC_PREFIX"')
|
||||
% pre + repl
|
||||
% }]
|
||||
% }
|
||||
|
|
Загрузка…
Ссылка в новой задаче