diff --git a/.rubocop.yml b/.rubocop.yml index a7e5fc01..3f18c985 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -129,3 +129,4 @@ AllCops: - 'vendor/bundle/**/*' - 'bundle/**/*' - 'config/**/*' + - 'bin/*' diff --git a/Gemfile.lock b/Gemfile.lock index f604c9ce..135d6dad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -415,8 +415,8 @@ GEM simplecov-html (0.8.0) sixarm_ruby_unaccent (1.1.1) slop (3.6.0) - spring (1.1.2) - spring-commands-rspec (1.0.2) + spring (1.6.3) + spring-commands-rspec (1.0.4) spring (>= 0.9.1) sprockets (2.11.3) hike (~> 1.2) diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 00000000..20060ebd --- /dev/null +++ b/bin/rspec @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end +require 'bundler/setup' +load Gem.bin_path('rspec-core', 'rspec') diff --git a/bin/spring b/bin/spring new file mode 100755 index 00000000..253ec37c --- /dev/null +++ b/bin/spring @@ -0,0 +1,18 @@ +#!/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) + ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) + ENV["GEM_HOME"] = "" + Gem.paths = ENV + + gem "spring", match[1] + require "spring/binstub" + end +end