diff --git a/Gemfile b/Gemfile index 4073bd1e5..81bdaabe9 100644 --- a/Gemfile +++ b/Gemfile @@ -102,9 +102,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' - # deploy gem 'mina', '0.3.1' # for fast deployment gem 'puma' diff --git a/Gemfile.lock b/Gemfile.lock index de4749bd0..6e6d8baac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -408,10 +408,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) @@ -519,8 +515,6 @@ DEPENDENCIES selectize-rails (= 0.12.1) simplecov simpleidn (= 0.0.7) - spring - spring-commands-rspec uglifier uuidtools (= 2.1.5) validates_email_format_of (= 1.6.3) @@ -528,4 +522,4 @@ DEPENDENCIES 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 3b82ee748..544370369 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -2,7 +2,7 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. config.cache_classes = true - config.eager_load = true + config.eager_load = false config.serve_static_files = true config.static_cache_control = 'public, max-age=3600' @@ -25,4 +25,4 @@ Rails.application.configure do config.cache_store = :memory_store end -Que.mode = :sync \ No newline at end of file +Que.mode = :sync 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' diff --git a/lib/gem_ext/paper_trail.rb b/lib/gem_ext/paper_trail.rb index 200e71d48..c8454e550 100644 --- a/lib/gem_ext/paper_trail.rb +++ b/lib/gem_ext/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