From b1ce7e4d4ada3eedc361d90b637ca06274a0ac3d Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 10 Dec 2007 05:54:46 +0000 Subject: Ruby 1.9 compat: File.exists\? -> File.exist\? en masse. References #1689 [Pratik Naik] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/lib/rails_generator/commands.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails_generator/commands.rb') diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb index 98531d9771..6f90a44b8a 100644 --- a/railties/lib/rails_generator/commands.rb +++ b/railties/lib/rails_generator/commands.rb @@ -207,7 +207,7 @@ HELP # Determine full paths for source and destination files. source = source_path(relative_source) destination = destination_path(relative_destination) - destination_exists = File.exists?(destination) + destination_exists = File.exist?(destination) # If source and destination are identical then we're done. if destination_exists and identical?(source, destination, &block) @@ -306,7 +306,7 @@ HELP # Always directories which exist. def directory(relative_path) path = destination_path(relative_path) - if File.exists?(path) + if File.exist?(path) logger.exists relative_path else logger.create relative_path @@ -415,7 +415,7 @@ end_message # Remove a file if it exists and is a file. def file(relative_source, relative_destination, file_options = {}) destination = destination_path(relative_destination) - if File.exists?(destination) + if File.exist?(destination) logger.rm relative_destination unless options[:pretend] if options[:svn] @@ -450,7 +450,7 @@ end_message until parts.empty? partial = File.join(parts) path = destination_path(partial) - if File.exists?(path) + if File.exist?(path) if Dir[File.join(path, '*')].empty? logger.rmdir partial unless options[:pretend] -- cgit v1.2.3