Permalink
Browse files

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.
  • Loading branch information...
1 parent 492c8de commit 00fbee5bbf7896d38ccf3a26d4b6f36f9a63f358 @dabit dabit committed with senny May 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
@@ -282,7 +282,7 @@ def application_definition
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

0 comments on commit 00fbee5

Please sign in to comment.