Skip to content

Commit

Permalink
generate config/spring.rb in new applications [closes #18874]
Browse files Browse the repository at this point in the history
  • Loading branch information
fxn committed Feb 29, 2016
1 parent af2c427 commit b04d073
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions railties/CHANGELOG.md
@@ -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. * 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`.)


Expand Down
1 change: 1 addition & 0 deletions railties/lib/rails/generators/rails/app/app_generator.rb
Expand Up @@ -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"
Expand Down
@@ -0,0 +1,6 @@
%w(
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
).each { |path| Spring.watch(path) }
2 changes: 2 additions & 0 deletions railties/test/generators/app_generator_test.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b04d073

Please sign in to comment.