From 6b590118626e29f2045ecf53fa200a2f4f6d4472 Mon Sep 17 00:00:00 2001 From: Marcel Molina Date: Sat, 8 Oct 2005 18:57:14 +0000 Subject: 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 --- railties/lib/rails_generator/commands.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'railties/lib') 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 -- cgit v1.2.3