1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

generic_erb.rb: read in binary mode

* tool/generic_erb.rb: read existing file in binary mode to
  convert nothing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-11-27 03:42:54 +00:00
parent c158fccd2b
commit 2092561366

View file

@ -24,7 +24,7 @@ erb = ERB.new(File.read(template), nil, '%-')
erb.filename = template
result = source ? erb.src : erb.result
if output
if ifchange and (vpath.open(output) {|f| f.read} rescue nil) == result
if ifchange and (vpath.open(output, "rb") {|f| f.read} rescue nil) == result
puts "#{output} unchanged"
else
open(output, "wb") {|f| f.print result}