diff --git a/Gemfile b/Gemfile index 6cd2e5bd..a9d2e73f 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,8 @@ gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder' #, '~> 2.0' gem 'sdoc', group: :doc #, '~> 0.4.0' -# gem 'spring', group: :development +gem 'spring', group: :development +gem 'spring-commands-rspec', group: :development gem 'devise' gem 'devise_invitable' gem 'haml-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 3ce7800b..a67757a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -379,6 +379,9 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.3) + spring (3.0.0) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -472,6 +475,8 @@ DEPENDENCIES selenium-webdriver simple_form simplecov + spring + spring-commands-rspec sprockets (~> 3.7) turbolinks uglifier diff --git a/bin/rails b/bin/rails index ddbc1f2b..a68afc88 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,9 @@ #!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end if ENV['RAILS_ENV'] == 'development' ENV['PORT'] = '9012' end diff --git a/bin/rake b/bin/rake index 17240489..d87d5f57 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,9 @@ #!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/rspec b/bin/rspec index 0c86b5c6..7ca47330 100755 --- a/bin/rspec +++ b/bin/rspec @@ -5,6 +5,11 @@ # The application 'rspec' is installed as part of a gem, and # this file is here to facilitate running it. # +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end require 'pathname' ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", diff --git a/bin/spring b/bin/spring index 38fee6fb..d89ee495 100755 --- a/bin/spring +++ b/bin/spring @@ -1,16 +1,17 @@ #!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'spring' is installed as part of a gem, and -# this file is here to facilitate running it. -# -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) +# This file loads Spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. -require 'rubygems' -require 'bundler/setup' +unless defined?(Spring) + require 'rubygems' + require 'bundler' -load Gem.bin_path('spring', 'spring') + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == 'spring' } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end diff --git a/config/environments/test.rb b/config/environments/test.rb index 67f8bb93..9431d1fd 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -5,7 +5,7 @@ Rails.application.configure do # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true + config.cache_classes = false # 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