diff options
| author | mo khan <mo@mokhan.ca> | 2015-04-12 11:31:06 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-04-12 11:31:06 -0600 |
| commit | 21ba5290c7c4a6741c1ab436acf430e49f8250ec (patch) | |
| tree | 0338392155658006bab72ca53f1d7c69aad56b04 /bin | |
| parent | 64da38306dcd219120240a7e714e60c1ff3fe6dc (diff) | |
add spring binstub for rspec.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/rspec | 4 | ||||
| -rwxr-xr-x | bin/spring | 26 |
2 files changed, 18 insertions, 12 deletions
@@ -1,4 +1,8 @@ #!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end # # This file was generated by Bundler. # @@ -1,16 +1,18 @@ #!/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') + 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 |
