diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2015-04-20 00:34:20 -0400 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2015-04-20 00:34:20 -0400 |
commit | 01e37ed2a9cd42bb339b7123468c94b3ff8e12ed (patch) | |
tree | f37a8bccf75880ab4f724627fa5cb70720e2813b /railties | |
parent | 0cfc34ae9a8fa3d283ff1f5902cacfd41e14ea59 (diff) | |
download | rails-01e37ed2a9cd42bb339b7123468c94b3ff8e12ed.tar.gz rails-01e37ed2a9cd42bb339b7123468c94b3ff8e12ed.tar.bz2 rails-01e37ed2a9cd42bb339b7123468c94b3ff8e12ed.zip |
Implicitly skip spring for `rails new --dev`
Spring seems like an obvious foot gun for the `--dev` setup, presumably you are
about to make lots of changes to the codebase, so it should always reload the
framework.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 10deeb0ba2..119a7cb829 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -336,7 +336,7 @@ module Rails end def spring_install? - !options[:skip_spring] && Process.respond_to?(:fork) && !RUBY_PLATFORM.include?("cygwin") + !options[:skip_spring] && !options.dev? && Process.respond_to?(:fork) && !RUBY_PLATFORM.include?("cygwin") end def run_bundle diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 282e8cc4f9..2bfa05a0b8 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -560,6 +560,14 @@ class AppGeneratorTest < Rails::Generators::TestCase end end + def test_spring_with_dev_option + run_generator [destination_root, "--dev"] + + assert_file "Gemfile" do |content| + assert_no_match(/spring/, content) + end + end + def test_generator_if_skip_turbolinks_is_given run_generator [destination_root, "--skip-turbolinks"] |