diff options
author | Samuel E. Giddins <segiddins@segiddins.me> | 2015-07-06 17:25:18 -0700 |
---|---|---|
committer | Samuel E. Giddins <segiddins@segiddins.me> | 2015-07-15 18:39:52 -0700 |
commit | 3abb8229d46993c59c70eb44d6bbd80f55287345 (patch) | |
tree | 8a7d5d8f1a4e85ff0b200aee821b5262a76789f7 /bin | |
parent | 3a889f0214345f91686cc6a804b49a042eaca824 (diff) | |
download | bundler-3abb8229d46993c59c70eb44d6bbd80f55287345.tar.gz |
Add new binstubs for rake and rspec in bin, move executables to exe
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bundle | 21 | ||||
-rwxr-xr-x | bin/bundle_ruby | 58 | ||||
-rwxr-xr-x | bin/bundler | 21 | ||||
-rwxr-xr-x | bin/rake | 8 | ||||
-rwxr-xr-x | bin/rspec | 8 |
5 files changed, 16 insertions, 100 deletions
diff --git a/bin/bundle b/bin/bundle deleted file mode 100755 index 89c823ea..00000000 --- a/bin/bundle +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env ruby - -# Exit cleanly from an early interrupt -Signal.trap("INT") { exit 1 } - -require 'bundler' -# Check if an older version of bundler is installed -$LOAD_PATH.each do |path| - if path =~ %r'/bundler-0\.(\d+)' && $1.to_i < 9 - err = "Looks like you have a version of bundler that's older than 0.9.\n" - err << "Please remove your old versions.\n" - err << "An easy way to do this is by running `gem cleanup bundler`." - abort(err) - end -end - -require 'bundler/friendly_errors' -Bundler.with_friendly_errors do - require 'bundler/cli' - Bundler::CLI.start(ARGV, :debug => true) -end diff --git a/bin/bundle_ruby b/bin/bundle_ruby deleted file mode 100755 index d0cfdc27..00000000 --- a/bin/bundle_ruby +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env ruby - -Signal.trap("INT") { exit 1 } - -require 'bundler/ruby_version' -require 'bundler/ruby_dsl' -require 'bundler/shared_helpers' - -module Bundler - class GemfileError < RuntimeError; end - class Dsl - include RubyDsl - - attr_accessor :ruby_version - - def initialize - @ruby_version = nil - end - - def eval_gemfile(gemfile, contents = nil) - contents ||= File.open(gemfile, "rb") { |f| f.read } - instance_eval(contents, gemfile.to_s, 1) - rescue SyntaxError => e - bt = e.message.split("\n")[1..-1] - raise GemfileError, ["Gemfile syntax error:", *bt].join("\n") - rescue ScriptError, RegexpError, NameError, ArgumentError => e - e.backtrace[0] = "#{e.backtrace[0]}: #{e.message} (#{e.class})" - STDERR.puts e.backtrace.join("\n ") - raise GemfileError, "There was an error in your Gemfile," \ - " and Bundler cannot continue." - end - - def source(source, options = {}) - end - - def gem(name, *args) - end - - def group(*args, &blk) - end - end -end - -STDERR.puts "Warning: bundle_ruby will be deprecated in Bundler 2.0.0." - -dsl = Bundler::Dsl.new -begin - dsl.eval_gemfile(Bundler::SharedHelpers.default_gemfile) - ruby_version = dsl.ruby_version - if ruby_version - puts ruby_version - else - puts "No ruby version specified" - end -rescue Bundler::GemfileError => e - puts e.message - exit(-1) -end diff --git a/bin/bundler b/bin/bundler deleted file mode 100755 index 89c823ea..00000000 --- a/bin/bundler +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env ruby - -# Exit cleanly from an early interrupt -Signal.trap("INT") { exit 1 } - -require 'bundler' -# Check if an older version of bundler is installed -$LOAD_PATH.each do |path| - if path =~ %r'/bundler-0\.(\d+)' && $1.to_i < 9 - err = "Looks like you have a version of bundler that's older than 0.9.\n" - err << "Please remove your old versions.\n" - err << "An easy way to do this is by running `gem cleanup bundler`." - abort(err) - end -end - -require 'bundler/friendly_errors' -Bundler.with_friendly_errors do - require 'bundler/cli' - Bundler::CLI.start(ARGV, :debug => true) -end diff --git a/bin/rake b/bin/rake new file mode 100755 index 00000000..4abe5efe --- /dev/null +++ b/bin/rake @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby + +bundler_spec = Gem::Specification.load(File.expand_path("../../bundler.gemspec", __FILE__)) +bundler_spec.dependencies.each do |dep| + gem dep.name, dep.requirement.to_s +end + +load Gem.bin_path('rake', 'rake') diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 00000000..dc429cd5 --- /dev/null +++ b/bin/rspec @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby + +bundler_spec = Gem::Specification.load(File.expand_path("../../bundler.gemspec", __FILE__)) +bundler_spec.dependencies.each do |dep| + gem dep.name, dep.requirement.to_s +end + +load Gem.bin_path('rspec', 'rspec') |