Skip to content

Commit fd61044

Browse files
committedJul 24, 2014
Keep the Spring binstubbed commands
1 parent ac1a947 commit fd61044

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed
 

‎bin/rails

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
begin
3+
load File.expand_path("../spring", __FILE__)
4+
rescue LoadError
5+
end
6+
require 'bundler/setup'
7+
load Gem.bin_path('rails', 'rails')

‎bin/rake

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
begin
3+
load File.expand_path("../spring", __FILE__)
4+
rescue LoadError
5+
end
6+
require 'bundler/setup'
7+
load Gem.bin_path('rake', 'rake')

‎bin/rspec

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
begin
3+
load File.expand_path("../spring", __FILE__)
4+
rescue LoadError
5+
end
6+
require 'bundler/setup'
7+
load Gem.bin_path('rspec-core', 'rspec')

‎bin/spring

+18
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)