diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-02-18 21:11:06 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-02-18 21:24:17 +0900 |
commit | 8e95feb7234ce62a426418721aecd5e55806507b (patch) | |
tree | 4dab455f3a5f29bee5da534c3b40f36f094eff79 | |
parent | 011711ecc9bfe9bdbc1fc17d57d511373954d415 (diff) | |
download | rails-8e95feb7234ce62a426418721aecd5e55806507b.tar.gz rails-8e95feb7234ce62a426418721aecd5e55806507b.tar.bz2 rails-8e95feb7234ce62a426418721aecd5e55806507b.zip |
set `skip_listen` option to dummy appplication
If you want to use `EventedFileUpdateChecker`, need to specify `listen` to plugin's gemspec.
However, the default is not specified `listen` to plugin's gemspec,
`EventedFileUpdateChecker` should be disabled.
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/plugin_generator.rb | 1 | ||||
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb index 565764842b..56efd35a95 100644 --- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb @@ -90,6 +90,7 @@ task default: :test opts[:force] = force opts[:skip_bundle] = true opts[:api] = options.api? + opts[:skip_listen] = true invoke Rails::Generators::AppGenerator, [ File.expand_path(dummy_path, destination_root) ], opts diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index 4111a30664..d7d27e6b2e 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -444,6 +444,14 @@ class PluginGeneratorTest < Rails::Generators::TestCase end end + def test_dummy_appplication_skip_listen_by_default + run_generator + + assert_file 'test/dummy/config/environments/development.rb' do |contents| + assert_match(/^\s*# config.file_watcher = ActiveSupport::EventedFileUpdateChecker/, contents) + end + end + def test_ensure_that_gitignore_can_be_generated_from_a_template_for_dummy_path FileUtils.cd(Rails.root) run_generator([destination_root, "--dummy_path", "spec/dummy", "--skip-test"]) |