Permalink
Browse files

Small bug fixes.

Ruby 1.8.7 complained about missing brackets.

file is just a String, so it has no method exist?. Used the
File class' method instead.
  • Loading branch information...
1 parent 6c56ce6 commit cf6c03ec0778f64b0f71099dd8cf3cd74422b7d1 @oneiros oneiros committed Mar 22, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/generators/localized_language_select/locales_generator.rb
@@ -26,7 +26,7 @@ def locales
end
def locale_dir
- File.expand_path(locale_ref, File.dirname __FILE__)
+ File.expand_path(locale_ref, File.dirname(__FILE__))
end
def locale_ref
@@ -41,7 +41,7 @@ def copy_locales
locales.each do |locale|
locale_file = "#{locale}.#{file_ext}"
file = File.join(locale_dir, locale_file)
- copy_file File.join(locale_ref, locale_file), "config/locales/#{locale_name}.#{locale}.#{file_ext}" if file.exist?
+ copy_file File.join(locale_ref, locale_file), "config/locales/#{locale_name}.#{locale}.#{file_ext}" if File.exist?(file)
end
end
end

0 comments on commit cf6c03e

Please sign in to comment.