提交 b04d0733 编写于 作者: X Xavier Noria

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

上级 af2c427c
* 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. * 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`.) (e.g. `rails:update` and `rails:template` tasks is renamed to `app:update` and `app:template`.)
......
...@@ -80,6 +80,7 @@ def config ...@@ -80,6 +80,7 @@ def config
template "secrets.yml" template "secrets.yml"
template "cable.yml" unless options[:skip_action_cable] template "cable.yml" unless options[:skip_action_cable]
template "puma.rb" unless options[:skip_puma] template "puma.rb" unless options[:skip_puma]
template "spring.rb" if spring_install?
directory "environments" directory "environments"
directory "initializers" directory "initializers"
......
%w(
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
).each { |path| Spring.watch(path) }
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
config/locales config/locales
config/cable.yml config/cable.yml
config/puma.rb config/puma.rb
config/spring.rb
db db
lib lib
lib/tasks lib/tasks
...@@ -681,6 +682,7 @@ def test_spring_no_fork ...@@ -681,6 +682,7 @@ def test_spring_no_fork
def test_skip_spring def test_skip_spring
run_generator [destination_root, "--skip-spring"] run_generator [destination_root, "--skip-spring"]
assert_no_file 'config/spring.rb'
assert_file "Gemfile" do |content| assert_file "Gemfile" do |content|
assert_no_match(/spring/, content) assert_no_match(/spring/, content)
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册