1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Plugin generator crashes when using the --dummy-path option

Code was assuming the application name in `config/application.rb`
was module Dummy.
This commit is contained in:
David Padilla 2012-05-10 15:56:13 -05:00 committed by Piotr Sarnacki
parent b14d1cd8ae
commit 0d48b12fc5

View file

@ -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