Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit d94994867f793fcf24ee03d5a45475a9ed90c599 1 parent 6b59011
Marcel Molina authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  railties/lib/rails_generator/commands.rb
View
3  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 @@ 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.
Please sign in to comment.
Something went wrong with that request. Please try again.