Permalink
Browse files

Skip directories when checking for identical source and destination f…

…iles.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2495 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
Marcel Molina
Marcel Molina committed Oct 8, 2005
1 parent a7cdaad commit 6b590118626e29f2045ecf53fa200a2f4f6d4472
Showing with 1 addition and 0 deletions.
  1. +1 −0 railties/lib/rails_generator/commands.rb
@@ -217,6 +217,7 @@ def file(relative_source, relative_destination, file_options = {}, &block)
# passed a block then the source file is a template that needs to first
# be evaluated before being compared to the destination.
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

0 comments on commit 6b59011

Please sign in to comment.