diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-27 03:42:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-27 03:42:54 +0000 |
commit | 2092561366e45e398bbec6c4eea156598aa37f21 (patch) | |
tree | 6b8d43c6ab21f70127e7b6b10eecb82b95918746 /tool | |
parent | c158fccd2b1213ac69846a5a832cc1a1d4f2d431 (diff) | |
download | ruby-2092561366e45e398bbec6c4eea156598aa37f21.tar.gz |
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
Diffstat (limited to 'tool')
-rw-r--r-- | tool/generic_erb.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/generic_erb.rb b/tool/generic_erb.rb index 9e07f2f2e1..6641b0e649 100644 --- a/tool/generic_erb.rb +++ b/tool/generic_erb.rb @@ -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} |