Skip to content

Commit

Permalink
Compare md5 checksums of files rather than files themselves, as it's …
Browse files Browse the repository at this point in the history
…far faster for large files (like logs).

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2496 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
Marcel Molina committed Oct 8, 2005
1 parent 6b59011 commit d949948
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion railties/lib/rails_generator/commands.rb
@@ -1,6 +1,7 @@
require 'delegate'
require 'optparse'
require 'fileutils'
require 'digest/md5'
require 'erb'

module Rails
Expand Down Expand Up @@ -220,7 +221,7 @@ def identical?(source, destination, &block)
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.
Expand Down

0 comments on commit d949948

Please sign in to comment.