提交 f8b7cd2d 编写于 作者: A Aman Gupta

Merge pull request #40 from github/ruby-2.1

Ruby 2.1
......@@ -299,7 +299,11 @@ def template(relative_source, relative_destination, template_options = {})
# Evaluate any assignments in a temporary, throwaway binding.
vars = template_options[:assigns] || {}
b = template_options[:binding] || binding
vars.each { |k,v| eval "#{k} = vars[:#{k}] || vars['#{k}']", b }
if b.respond_to?(:local_variable_set)
vars.each { |k,v| b.local_variable_set(k, v) }
else
vars.each { |k,v| eval "#{k} = vars[:#{k}] || vars['#{k}']", b }
end
# Render the source file with the temporary binding.
ERB.new(file.read, nil, '-').result(b)
......
......@@ -4,4 +4,4 @@ set -x
set -e
script/cibuild-on 1.9.3-p231-tcs-github
script/cibuild-on 2.0.0-github
script/cibuild-on 2.1.0-github
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册