generate config/spring.rb in new applications [closes #18874]

This commit is contained in:
Xavier Noria 2016-02-29 23:34:00 +01:00
parent af2c427c39
commit b04d07337f
4 changed files with 14 additions and 0 deletions

@ -1,3 +1,8 @@
* The application generator writes a new file `config/spring.rb`, which tells
Spring to watch additional common files.
*Xavier Noria*
* The tasks in the rails task namespace is deprecated in favor of app namespace.
(e.g. `rails:update` and `rails:template` tasks is renamed to `app:update` and `app:template`.)

@ -80,6 +80,7 @@ def config
template "secrets.yml"
template "cable.yml" unless options[:skip_action_cable]
template "puma.rb" unless options[:skip_puma]
template "spring.rb" if spring_install?
directory "environments"
directory "initializers"

@ -0,0 +1,6 @@
%w(
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
).each { |path| Spring.watch(path) }

@ -28,6 +28,7 @@
config/locales
config/cable.yml
config/puma.rb
config/spring.rb
db
lib
lib/tasks
@ -681,6 +682,7 @@ def test_spring_no_fork
def test_skip_spring
run_generator [destination_root, "--skip-spring"]
assert_no_file 'config/spring.rb'
assert_file "Gemfile" do |content|
assert_no_match(/spring/, content)
end