diff options
author | David Padilla <david@crowdint.com> | 2012-05-10 15:56:13 -0500 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-05-10 17:37:12 -0700 |
commit | 0d48b12fc56df574bb81cfaf0f5fb4713e9230fc (patch) | |
tree | 4a06eddbb9de39e50ae593bb1164f2826b54667f /railties/lib | |
parent | b14d1cd8aefac1895f83139c00ce130e89277c9f (diff) | |
download | rails-0d48b12fc56df574bb81cfaf0f5fb4713e9230fc.tar.gz rails-0d48b12fc56df574bb81cfaf0f5fb4713e9230fc.tar.bz2 rails-0d48b12fc56df574bb81cfaf0f5fb4713e9230fc.zip |
Fixes issue #6251
Plugin generator crashes when using the --dummy-path option
Code was assuming the application name in `config/application.rb`
was module Dummy.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb index f4263d1b98..722e37e20b 100644 --- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb +++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb @@ -302,7 +302,7 @@ task :default => :test dummy_application_path = File.expand_path("#{dummy_path}/config/application.rb", destination_root) unless options[:pretend] || !File.exists?(dummy_application_path) contents = File.read(dummy_application_path) - contents[(contents.index("module Dummy"))..-1] + contents[(contents.index(/module ([\w]+)\n(.*)class Application/m))..-1] end end end |