Remove Spring and spring-commands-rspec gem (#16848)

* Remove spring and spring-commands-rspec

* Remove all traces of Spring

* Temporarily remove warning gem

* Remove comment
This commit is contained in:
Mac Siri 2022-03-10 10:12:51 -05:00 committed by GitHub
parent 39bc67ec15
commit dbe1fb6ff3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 3 additions and 54 deletions

View file

@ -145,8 +145,6 @@ group :development, :test do
gem "rubocop-rails", "~> 2.13", require: false # Automatic Rails code style checking tool
gem "rubocop-rspec", "~> 2.9", require: false # Code style checking for RSpec files
gem "sassc-rails", "~> 2.1.2" # Integrate SassC-Ruby into Rails
gem "spring", "~> 4.0" # Preloads your application so things like console, rake and tests run faster
gem "spring-commands-rspec", "~> 1.0" # rspec command for spring
end
group :test do

View file

@ -793,9 +793,6 @@ GEM
thor (~> 1.0)
tilt (~> 2.0)
yard (~> 0.9, >= 0.9.24)
spring (4.0.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (4.0.3)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@ -1021,8 +1018,6 @@ DEPENDENCIES
simplecov (~> 0.21.2)
slack-notifier (~> 2.4)
solargraph (~> 0.44)
spring (~> 4.0)
spring-commands-rspec (~> 1.0)
sprockets (~> 4.0)
staccato (~> 0.5)
stackprof (~> 0.2)

View file

@ -19,23 +19,13 @@
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle exec rspec'
# * bundler binstubs: 'bin/rspec'
# * spring: 'bin/rspec' (This will use spring if running and you have
# installed the spring binstubs per the docs)
# * zeus: 'zeus rspec' (requires the server to be started separately)
# * 'just' rspec: 'rspec'
ignore([%r{^bin/*}, %r{^config/*}, %r{^db/*}, %r{^lib/*}, %r{^log/*}, %r{^public/*}, %r{^tmp/*}, %r{^node_modules/*}])
rspec_options = {
results_file: File.expand_path("tmp/guard_rspec_results.txt"),
#############################
# BECAUSE spring doesn't seem to work well with simplecov, choose
# between the following two.
# slow but good coverage
# cmd: "bin/rspec -p",
# fast but no coverage
cmd: "bin/spring rspec -p",
#############################
cmd: "bin/rspec -p",
failed_mode: :focus,
bundler_env: :clean_env
}

View file

@ -21,8 +21,7 @@ read -t 10 -p "Choose yes to setup a test database or if you're running the scri
if [[ $REPLY =~ ^[Yy]$ ]]; then
printf "\n\nSetting up the E2E database before running E2E tests...\n\n"
# Spring is disabled only for E2E tests run locally. Otherwise, there are all kinds of errors.
DISABLE_SPRING=1 RAILS_ENV=test E2E=true bin/e2e-setup
RAILS_ENV=test E2E=true bin/e2e-setup
else
printf "\n\nSkipping database setup...\n\n"
fi

View file

@ -1,5 +1,4 @@
#!/usr/bin/env ruby
load File.expand_path("spring", __dir__)
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative "../config/boot"
require "rails/commands"

View file

@ -1,5 +1,4 @@
#!/usr/bin/env ruby
load File.expand_path("spring", __dir__)
require_relative "../config/boot"
require "rake"
Rake.application.run

View file

@ -1,14 +0,0 @@
#!/usr/bin/env ruby
if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
gem "bundler"
require "bundler"
# Load Spring without loading other gems in the Gemfile, for speed.
Bundler.locked_gems&.specs&.find { |spec| spec.name == "spring" }&.tap do |spring|
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
gem "spring", spring.version
require "spring/binstub"
rescue Gem::LoadError
# Ignore when Spring is not installed.
end
end

View file

@ -1,14 +1,4 @@
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
# NOTE: We need to ignore this warning early during app startup.
# 1. `parser` is a transitive dependency (`erb_lint` -> `better_html` -> `parser`)
# 2. The warnings are generated while reading the class body, so we need to ignore
# them *before* the gem's code is read.
# 3. The warning is intentional, it will always occur when the used point release
# isn't the most recent. Since our update schedule is somewhat influenced by
# Fedora release cycles right now, this can occur frequently.
require "warning"
Warning.ignore(%r{parser/current})
require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.

View file

@ -11,9 +11,8 @@ Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# cache_classes should be false when Spring is enabled, and true when it's disabled
# https://guides.rubyonrails.org/configuring.html#config-cache-classes
config.cache_classes = ActiveModel::Type::Boolean.new.cast(ENV["DISABLE_SPRING"])
config.cache_classes = true
# See https://github.com/rails/rails/issues/40613#issuecomment-727283155
config.action_view.cache_template_loading = true

View file

@ -1,6 +0,0 @@
Spring.watch(
".ruby-version",
".rbenv-vars",
"tmp/restart.txt",
"tmp/caching-dev.txt",
)

Binary file not shown.

Binary file not shown.