diff options
author | Tsukuru Tanimichi <info+git@ttanimichi.com> | 2016-11-14 18:09:26 +0900 |
---|---|---|
committer | Tsukuru Tanimichi <info+git@ttanimichi.com> | 2016-11-14 20:56:49 +0900 |
commit | 592c06d7cb158df07bf87246c23af24b72d13c97 (patch) | |
tree | 21ccca2368356847c86837bc08de9559606e96fb /railties | |
parent | 5f3222155957e887516ffd4be58c4743553415b5 (diff) | |
download | rails-592c06d7cb158df07bf87246c23af24b72d13c97.tar.gz rails-592c06d7cb158df07bf87246c23af24b72d13c97.tar.bz2 rails-592c06d7cb158df07bf87246c23af24b72d13c97.zip |
Add `:skip_sprockets` to `Rails::PluginBuilder::PASSTHROUGH_OPTIONS`
`rails plugin new` with `--full` and `--skip-sprockets` options generates a dummy application that throws `NoMethodError`.
```
% rails plugin new my_engine -S --full --skip-gemspec
% cd my_engine
% bin/rails test
rails aborted!
NoMethodError: undefined method `assets' for #<Rails::Application::Configuration:0x007f83aa1e6100>
```
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG.md | 4 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/plugin_generator.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 8 |
3 files changed, 13 insertions, 1 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index b488e4ed8e..7db7e2e34d 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,7 @@ +* Add `:skip_sprockets` to `Rails::PluginBuilder::PASSTHROUGH_OPTIONS` + + *Tsukuru Tanimichi* + * Allow the use of listen's 3.1.x branch *Esteban Santana Santana* diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb index 1d968ec8f0..2186fa4ded 100644 --- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb @@ -81,7 +81,7 @@ task default: :test end PASSTHROUGH_OPTIONS = [ - :skip_active_record, :skip_action_mailer, :skip_javascript, :database, + :skip_active_record, :skip_action_mailer, :skip_javascript, :skip_sprockets, :database, :javascript, :quiet, :pretend, :force, :skip ] diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index 15079f2735..0fdc30ac43 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -100,6 +100,14 @@ class PluginGeneratorTest < Rails::Generators::TestCase end end + def test_generating_adds_dummy_app_in_full_mode_without_sprockets + run_generator [destination_root, "-S", "--full"] + + assert_file "test/dummy/config/environments/production.rb" do |contents| + assert_no_match(/config\.assets/, contents) + end + end + def test_generating_adds_dummy_app_rake_tasks_without_unit_test_files run_generator [destination_root, "-T", "--mountable", "--dummy-path", "my_dummy_app"] assert_file "Rakefile", /APP_RAKEFILE/ |