diff options
Diffstat (limited to 'railties/lib/generator')
-rw-r--r-- | railties/lib/generator/base.rb | 2 | ||||
-rw-r--r-- | railties/lib/generator/generators/app.rb (renamed from railties/lib/generator/generators/app.thor) | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/railties/lib/generator/base.rb b/railties/lib/generator/base.rb index ea1e5a0402..5f51f93520 100644 --- a/railties/lib/generator/base.rb +++ b/railties/lib/generator/base.rb @@ -27,7 +27,7 @@ module Rails klass_name.gsub!(/^Rails::Generators::/, '') klass_name.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2') klass_name.gsub!(/([a-z\d])([A-Z])/,'\1_\2') - File.join(File.dirname(__FILE__), 'templates', klass_name.downcase) + File.expand_path(File.join(File.dirname(__FILE__), 'templates', klass_name.downcase)) end end diff --git a/railties/lib/generator/generators/app.thor b/railties/lib/generator/generators/app.rb index 84f0504519..408a73a1e8 100644 --- a/railties/lib/generator/generators/app.thor +++ b/railties/lib/generator/generators/app.rb @@ -2,7 +2,6 @@ require File.dirname(__FILE__) + '/../base' require 'rbconfig' require 'digest/md5' require 'active_support/secure_random' -require 'rails/version' module Rails::Generators class App < Base @@ -48,7 +47,9 @@ module Rails::Generators self.root = File.expand_path(app_path, root) empty_directory '.' - app_name # Sets the app name + app_name # Sets the app name + source_root # Sets the source root + FileUtils.cd(root) end |