Commit 99dc9c6fc9880519dddf2cb2557b984792843848
1 parent
4bbb3d55
Exists in
spb-stable
and in
3 other branches
Inserted spring in the binstubs
Now possible to run: `bin/rails` `bin/rspec` `bin/spinach` `bin/rake`
Showing
5 changed files
with
40 additions
and
0 deletions
Show diff stats
bin/rails
| 1 | #!/usr/bin/env ruby | 1 | #!/usr/bin/env ruby |
| 2 | +begin | ||
| 3 | + load File.expand_path("../spring", __FILE__) | ||
| 4 | +rescue LoadError | ||
| 5 | +end | ||
| 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) | 6 | APP_PATH = File.expand_path('../../config/application', __FILE__) |
| 3 | require_relative '../config/boot' | 7 | require_relative '../config/boot' |
| 4 | require 'rails/commands' | 8 | require 'rails/commands' |
bin/rake
| @@ -0,0 +1,18 @@ | @@ -0,0 +1,18 @@ | ||
| 1 | +#!/usr/bin/env ruby | ||
| 2 | + | ||
| 3 | +# This file loads spring without using Bundler, in order to be fast | ||
| 4 | +# It gets overwritten when you run the `spring binstub` command | ||
| 5 | + | ||
| 6 | +unless defined?(Spring) | ||
| 7 | + require "rubygems" | ||
| 8 | + require "bundler" | ||
| 9 | + | ||
| 10 | + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) | ||
| 11 | + ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) | ||
| 12 | + ENV["GEM_HOME"] = "" | ||
| 13 | + Gem.paths = ENV | ||
| 14 | + | ||
| 15 | + gem "spring", match[1] | ||
| 16 | + require "spring/binstub" | ||
| 17 | + end | ||
| 18 | +end |