diff options
author | Yves Senn <yves.senn@gmail.com> | 2012-11-07 20:54:49 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@garaio.com> | 2012-11-08 13:08:19 +0100 |
commit | 1785bf7d6727c8c9d847eaa741ad41a9b750cd28 (patch) | |
tree | 090f95aca392a9efcd4bc1038713a3e5c3af65a9 /railties/lib/rails | |
parent | c1488232e75ff61dd4babfa20842c5c0746da0f9 (diff) | |
download | rails-1785bf7d6727c8c9d847eaa741ad41a9b750cd28.tar.gz rails-1785bf7d6727c8c9d847eaa741ad41a9b750cd28.tar.bz2 rails-1785bf7d6727c8c9d847eaa741ad41a9b750cd28.zip |
`plugin new` adds dummy app tasks when necessary.
Closes #8121
The `plugin new` generator always adds the dummy app rake tasks,
when a dummy app was created.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/plugin_new/templates/Rakefile | 2 |
2 files changed, 6 insertions, 2 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 4a0bcc35a4..48ce3e86a1 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 @@ -225,7 +225,7 @@ task default: :test end def create_test_dummy_files - return if options[:skip_test_unit] && options[:dummy_path] == 'test/dummy' + return unless with_dummy_app? create_dummy_app end @@ -279,6 +279,10 @@ task default: :test options[:mountable] end + def with_dummy_app? + options[:skip_test_unit].blank? || options[:dummy_path] != 'test/dummy' + end + def self.banner "rails plugin new #{self.arguments.map(&:usage).join(' ')} [options]" end diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile b/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile index 1369140537..65a5bae712 100644 --- a/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile +++ b/railties/lib/rails/generators/rails/plugin_new/templates/Rakefile @@ -14,7 +14,7 @@ RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_files.include('lib/**/*.rb') end -<% if full? && !options[:skip_active_record] && !options[:skip_test_unit] -%> +<% if full? && !options[:skip_active_record] && with_dummy_app? -%> APP_RAKEFILE = File.expand_path("../<%= dummy_path -%>/Rakefile", __FILE__) load 'rails/tasks/engine.rake' <% end %> |