aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2005-10-08 18:57:14 +0000
committerMarcel Molina <marcel@vernix.org>2005-10-08 18:57:14 +0000
commit6b590118626e29f2045ecf53fa200a2f4f6d4472 (patch)
tree6cdf3e53454023d51c2892be54c2ef267294d119
parenta7cdaadd1933cb4565ab9c2de5996821d3748d0a (diff)
downloadrails-6b590118626e29f2045ecf53fa200a2f4f6d4472.tar.gz
rails-6b590118626e29f2045ecf53fa200a2f4f6d4472.tar.bz2
rails-6b590118626e29f2045ecf53fa200a2f4f6d4472.zip
Skip directories when checking for identical source and destination files.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2495 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--railties/lib/rails_generator/commands.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb
index f8a7e706a3..2da82f545d 100644
--- a/railties/lib/rails_generator/commands.rb
+++ b/railties/lib/rails_generator/commands.rb
@@ -217,6 +217,7 @@ module Rails
# 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