summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2016-04-21 09:33:39 -0600
committermo khan <mo@mokhan.ca>2016-04-21 09:33:39 -0600
commitcff1d71f284adadd5deff3ea223229afbb2ead12 (patch)
treeb5ae7ca60d75129345f22b8f9b8507595bc40751 /bin
parent1966716d31814fbaf4c8a330acab62dfe7dfc7c8 (diff)
fix cucumber binstubs.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cucumber27
-rwxr-xr-xbin/spring10
2 files changed, 24 insertions, 13 deletions
diff --git a/bin/cucumber b/bin/cucumber
index 7fa5c92..8162dfa 100755
--- a/bin/cucumber
+++ b/bin/cucumber
@@ -1,10 +1,21 @@
#!/usr/bin/env ruby
-
-vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
-if vendored_cucumber_bin
- load File.expand_path(vendored_cucumber_bin)
-else
- require 'rubygems' unless ENV['NO_RUBYGEMS']
- require 'cucumber'
- load Cucumber::BINARY
+begin
+ load File.expand_path('../spring', __FILE__)
+rescue LoadError => e
+ raise unless e.message.include?('spring')
end
+#
+# This file was generated by Bundler.
+#
+# The application 'cucumber' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require "rubygems"
+require "bundler/setup"
+
+load Gem.bin_path("cucumber", "cucumber")
diff --git a/bin/spring b/bin/spring
index 5e7ecc4..7fe232c 100755
--- a/bin/spring
+++ b/bin/spring
@@ -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"
+ 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