File tree Expand file tree Collapse file tree 6 files changed +21
-15
lines changed
lib/rails/generators/rails/app/templates Expand file tree Collapse file tree 6 files changed +21
-15
lines changed Original file line number Diff line number Diff line change
1
+ <% if spring_install? -%>
2
+ load File.expand_path("spring", __dir__)
3
+ <% end -%>
1
4
APP_PATH = File.expand_path('../config/application', __dir__)
2
5
require_relative "../config/boot"
3
6
require "rails/commands"
Original file line number Diff line number Diff line change
1
+ <% if spring_install? -%>
2
+ load File.expand_path("spring", __dir__)
3
+ <% end -%>
1
4
require_relative "../config/boot"
2
5
require "rake"
3
6
Rake.application.run
Original file line number Diff line number Diff line change 1
- # Load Spring without loading other gems in the Gemfile, for speed.
2
- require "bundler"
3
- Bundler.locked_gems.specs.find { |spec| spec.name == "spring" }&.tap do |spring|
4
- Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
5
- gem "spring", spring.version
6
- require "spring/binstub"
1
+ if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
2
+ # Load Spring without loading other gems in the Gemfile, for speed.
3
+ require "bundler"
4
+ Bundler.locked_gems.specs.find { |spec| spec.name == "spring" }&.tap do |spring|
5
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
6
+ gem "spring", spring.version
7
+ require "spring/binstub"
8
+ end
7
9
end
Original file line number Diff line number Diff line change 1
1
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2
- <% if spring_install? -%>
3
-
4
- if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
5
- load File.expand_path("../bin/spring", __dir__)
6
- end
7
- <% end -%>
8
2
9
3
require "bundler/setup" # Set up gems listed in the Gemfile.
10
4
<% if depend_on_bootsnap? -%>
Original file line number Diff line number Diff line change @@ -862,7 +862,8 @@ def test_spring
862
862
863
863
assert_gem "spring"
864
864
assert_file "bin/spring" , %r{^\s *require "spring/binstub"}
865
- assert_file "config/boot.rb" , %r{^\s *load .+\b bin/spring"}
865
+ assert_file "bin/rails" , %r{^\s *load .+"spring"}
866
+ assert_file "bin/rake" , %r{^\s *load .+"spring"}
866
867
assert_file ( "config/environments/test.rb" ) do |contents |
867
868
assert_match ( "config.cache_classes = false" , contents )
868
869
assert_match ( "config.action_view.cache_template_loading = true" , contents )
@@ -893,7 +894,10 @@ def test_skip_spring
893
894
assert_file ( "config/environments/test.rb" ) do |contents |
894
895
assert_match ( "config.cache_classes = true" , contents )
895
896
end
896
- assert_file "config/boot.rb" do |contents |
897
+ assert_file "bin/rails" do |contents |
898
+ assert_no_match %r{spring} , contents
899
+ end
900
+ assert_file "bin/rake" do |contents |
897
901
assert_no_match %r{spring} , contents
898
902
end
899
903
end
Original file line number Diff line number Diff line change @@ -510,7 +510,7 @@ def self.sh(cmd)
510
510
FileUtils . rm_rf ( app_template_path )
511
511
FileUtils . mkdir_p ( app_template_path )
512
512
513
- sh "#{ Gem . ruby } #{ RAILS_FRAMEWORK_ROOT } /railties/exe/rails new #{ app_template_path } --skip-bundle --skip-listen --no-rc --skip-webpack-install --quiet"
513
+ sh "#{ Gem . ruby } #{ RAILS_FRAMEWORK_ROOT } /railties/exe/rails new #{ app_template_path } --skip-bundle --skip-spring --skip- listen --no-rc --skip-webpack-install --quiet"
514
514
File . open ( "#{ app_template_path } /config/boot.rb" , "w" ) do |f |
515
515
f . puts 'require "rails/all"'
516
516
end
You can’t perform that action at this time.
0 commit comments