summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authormo <mokha@cisco.com>2017-04-27 21:07:40 -0600
committermo <mokha@cisco.com>2017-04-27 21:07:40 -0600
commitcfcfea9f19fdb11778c66f699f2192a5db5469fd (patch)
treec97d535869e18000842195c2bee916300d61f363 /bin
parentb007fbbe0d857f822933e0ffb7fe6b6f8058e5b2 (diff)
add rspec bin stub.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rspec14
-rwxr-xr-xbin/spring17
2 files changed, 31 insertions, 0 deletions
diff --git a/bin/rspec b/bin/rspec
new file mode 100755
index 00000000..51a46c06
--- /dev/null
+++ b/bin/rspec
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path('../spring', __FILE__)
+rescue LoadError => e
+ raise unless e.message.include?('spring')
+end
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("rspec-core", "rspec")
diff --git a/bin/spring b/bin/spring
new file mode 100755
index 00000000..fb2ec2eb
--- /dev/null
+++ b/bin/spring
@@ -0,0 +1,17 @@
+#!/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'
+
+ lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
+ spring = lockfile.specs.detect { |spec| spec.name == "spring" }
+ if spring
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
+ gem 'spring', spring.version
+ require 'spring/binstub'
+ end
+end