Skip to content

Commit

Permalink
Add spring and springify
Browse files Browse the repository at this point in the history
  • Loading branch information
willnet committed Dec 23, 2014
1 parent a427a4d commit e99864c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ group :development do
gem "binding_of_caller"
gem 'meta_request'
gem 'letter_opener'
gem 'spring'
gem 'spring-commands-rspec'
end

group :test do
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ GEM
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
slop (3.6.0)
spring (1.2.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (2.12.3)
hike (~> 1.2)
multi_json (~> 1.0)
Expand Down Expand Up @@ -435,6 +438,8 @@ DEPENDENCIES
rspec-its
rspec-rails
sass-rails (~> 4.0.3)
spring
spring-commands-rspec
sunspot-rails-tester
sunspot_rails (= 2.1.0)
sunspot_solr
Expand Down
4 changes: 4 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -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'
4 changes: 4 additions & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions bin/rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec')
18 changes: 18 additions & 0 deletions bin/spring
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e99864c

Please sign in to comment.