diff options
author | Marcel Molina <marcel@vernix.org> | 2005-10-08 19:03:08 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2005-10-08 19:03:08 +0000 |
commit | d94994867f793fcf24ee03d5a45475a9ed90c599 (patch) | |
tree | 8ca6c7a04a2594f92993ac5ab3ef83e47c35168a /railties/lib/rails_generator/commands.rb | |
parent | 6b590118626e29f2045ecf53fa200a2f4f6d4472 (diff) | |
download | rails-d94994867f793fcf24ee03d5a45475a9ed90c599.tar.gz rails-d94994867f793fcf24ee03d5a45475a9ed90c599.tar.bz2 rails-d94994867f793fcf24ee03d5a45475a9ed90c599.zip |
Compare md5 checksums of files rather than files themselves, as it's far faster for large files (like logs).
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2496 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/commands.rb')
-rw-r--r-- | railties/lib/rails_generator/commands.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb index 2da82f545d..aa9bc677ef 100644 --- a/railties/lib/rails_generator/commands.rb +++ b/railties/lib/rails_generator/commands.rb @@ -1,6 +1,7 @@ require 'delegate' require 'optparse' require 'fileutils' +require 'digest/md5' require 'erb' module Rails @@ -220,7 +221,7 @@ module Rails return false if File.directory? destination source = block_given? ? File.open(source) {|sf| yield(sf)} : IO.read(source) destination = IO.read(destination) - source == destination + Digest::MD5.hexdigest(source) == Digest::MD5.hexdigest(destination) end # Generate a file for a Rails application using an ERuby template. |