Skip to content

Commit

Permalink
Update binstubs (spring binstub --all)
Browse files Browse the repository at this point in the history
  • Loading branch information
knu committed Oct 4, 2016
1 parent b4bf5c4 commit fd5bd09
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
5 changes: 3 additions & 2 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
Expand Down
5 changes: 3 additions & 2 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require_relative '../config/boot'
require 'rake'
Expand Down
5 changes: 3 additions & 2 deletions bin/rspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec')
12 changes: 6 additions & 6 deletions bin/spring
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# It gets overwritten when you run the `spring binstub` command.

unless defined?(Spring)
require "rubygems"
require "bundler"
require 'rubygems'
require 'bundler'

if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
gem "spring", match[1]
require "spring/binstub"
if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
gem 'spring', match[1]
require 'spring/binstub'
end
end

0 comments on commit fd5bd09

Please sign in to comment.