From 0a8acc72c92daa0251c0829456dd82a61e25f627 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 1 Jun 2018 14:43:44 +0300 Subject: [PATCH] Remove "spring" gem - Regenerate binstubs --- Gemfile | 2 -- Gemfile.lock | 8 +------ bin/rails | 7 +------ bin/rake | 5 ----- bin/rspec | 4 ---- bin/setup | 29 ++++++++++++++++++++++++++ bin/spring | 15 ------------- config/environments/test.rb | 2 +- config/initializers/001_paper_trail.rb | 2 +- config/spring.rb | 1 - 10 files changed, 33 insertions(+), 42 deletions(-) create mode 100644 bin/setup delete mode 100755 bin/spring delete mode 100644 config/spring.rb diff --git a/Gemfile b/Gemfile index 0af80fddf..a0efeacbc 100644 --- a/Gemfile +++ b/Gemfile @@ -101,8 +101,6 @@ gem 'jquery-ui-rails', '5.0.5' gem 'active_model-errors_details' # Backport from Rails 5, https://github.com/rails/rails/pull/18322 group :development do - gem 'spring' - gem 'spring-commands-rspec' gem 'rubocop' # deploy diff --git a/Gemfile.lock b/Gemfile.lock index b12b28a2d..fac725cfd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -423,10 +423,6 @@ GEM sixarm_ruby_unaccent (1.1.1) slop (3.6.0) socksify (1.7.1) - spring (2.0.2) - activesupport (>= 4.2) - spring-commands-rspec (1.0.4) - spring (>= 0.9.1) sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -534,12 +530,10 @@ DEPENDENCIES selectize-rails (= 0.12.1) simplecov simpleidn (= 0.0.7) - spring - spring-commands-rspec uuidtools (= 2.1.5) validates_email_format_of (= 1.6.3) webmock whenever (= 0.9.4) BUNDLED WITH - 1.16.1 + 1.16.2 diff --git a/bin/rails b/bin/rails index 284b01d72..5191e6927 100755 --- a/bin/rails +++ b/bin/rails @@ -1,9 +1,4 @@ #!/usr/bin/env ruby -begin - load File.expand_path('../spring', __FILE__) -rescue LoadError - 'no spring' -end -APP_PATH = File.expand_path('../../config/application', __FILE__) +APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/rake b/bin/rake index 7b36ecbff..17240489f 100755 --- a/bin/rake +++ b/bin/rake @@ -1,9 +1,4 @@ #!/usr/bin/env ruby -begin - load File.expand_path('../spring', __FILE__) -rescue LoadError - 'no spring' -end require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/rspec b/bin/rspec index 534d2bb5f..8bc84617e 100755 --- a/bin/rspec +++ b/bin/rspec @@ -1,8 +1,4 @@ #!/usr/bin/env ruby -begin - load File.expand_path("../spring", __FILE__) -rescue LoadError -end # # This file was generated by Bundler. # diff --git a/bin/setup b/bin/setup new file mode 100644 index 000000000..acdb2c138 --- /dev/null +++ b/bin/setup @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby +require 'pathname' + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +Dir.chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file: + + puts "== Installing dependencies ==" + system "gem install bundler --conservative" + system "bundle check || bundle install" + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # system "cp config/database.yml.sample config/database.yml" + # end + + puts "\n== Preparing database ==" + system "bin/rake db:setup" + + puts "\n== Removing old logs and tempfiles ==" + system "rm -f log/*" + system "rm -rf tmp/cache" + + puts "\n== Restarting application server ==" + system "touch tmp/restart.txt" +end diff --git a/bin/spring b/bin/spring deleted file mode 100755 index 7b45d374f..000000000 --- a/bin/spring +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby - -# This file loads spring without using Bundler, in order to be fast. -# It gets overwritten when you run the `spring binstub` command. - -unless defined?(Spring) - require "rubygems" - require "bundler" - - if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) - Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq } - gem "spring", match[1] - require "spring/binstub" - end -end diff --git a/config/environments/test.rb b/config/environments/test.rb index 9b22ad426..8e5d52a5b 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -10,7 +10,7 @@ Rails.application.configure do # Do not eager load code on boot. This avoids loading your whole application # just for the purpose of running a single test. If you are using a tool that # preloads Rails for running tests, you may have to set it to true. - config.eager_load = true + config.eager_load = false # Configure static asset server for tests with Cache-Control for performance. config.serve_static_files = true diff --git a/config/initializers/001_paper_trail.rb b/config/initializers/001_paper_trail.rb index 9dec5fb12..645e6535c 100644 --- a/config/initializers/001_paper_trail.rb +++ b/config/initializers/001_paper_trail.rb @@ -6,7 +6,7 @@ PaperTrail::Version.module_eval do end # Store console and rake changes in versions -if defined?(::Rails::Console) || File.basename($PROGRAM_NAME).split(' ').first == 'spring' +if defined?(::Rails::Console) PaperTrail.whodunnit = "console-#{`whoami`.strip}" elsif File.basename($PROGRAM_NAME) == "rake" # rake username does not work when spring enabled diff --git a/config/spring.rb b/config/spring.rb deleted file mode 100644 index 12c701147..000000000 --- a/config/spring.rb +++ /dev/null @@ -1 +0,0 @@ -Spring.watch 'config/application.yml'