diff options
| author | mo khan <mo@mokhan.ca> | 2015-04-11 12:51:20 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-04-11 12:51:20 -0600 |
| commit | b4cb1dd42f25bbac5e90f6ac4090ffeea2791f7d (patch) | |
| tree | 664dd8872a2ed2c4f769056fcfb7525b46d0a551 /bin | |
| parent | c252e88a8c2bb425f4c6f8999abb38dab70d0c75 (diff) | |
add spring binstub.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/rails | 4 | ||||
| -rwxr-xr-x | bin/rake | 4 | ||||
| -rwxr-xr-x | bin/spring | 18 |
3 files changed, 26 insertions, 0 deletions
@@ -1,4 +1,8 @@ #!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' @@ -1,4 +1,8 @@ #!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/spring b/bin/spring new file mode 100755 index 0000000..7f24d96 --- /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 |
