Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Generator copies files in binary mode. References #3156.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3256 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 3fb58286211b0cf23b18aa26ba0a37fef6bf8745 1 parent dc106b9
@jeremy jeremy authored
Showing with 4 additions and 2 deletions.
  1. +2 −0  railties/CHANGELOG
  2. +2 −2 railties/lib/rails_generator/commands.rb
View
2  railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Generator copies files in binary mode. #3156 [minimudboy@gmail.com]
+
* Add builtin/ to the gemspec. Closes #3047. [Nicholas Seckar, Sam Stephenson]
* Add install.rb file to plugin generation which is loaded, if it exists, when you install a plugin. [Marcel Molina Jr.]
View
4 railties/lib/rails_generator/commands.rb
@@ -215,8 +215,8 @@ def file(relative_source, relative_destination, file_options = {}, &block)
# if block given so templaters may render the source file. If a
# shebang is requested, replace the existing shebang or insert a
# new one.
- File.open(destination, 'w') do |df|
- File.open(source) do |sf|
+ File.open(destination, 'wb') do |df|
+ File.open(source, 'rb') do |sf|
if block_given?
df.write(yield(sf))
else

0 comments on commit 3fb5828

Please sign in to comment.
Something went wrong with that request. Please try again.