mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
6b59011862
commit
d94994867f
1 changed files with 2 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue