diff options
| author | nagachika <nagachika@ruby-lang.org> | 2021-02-20 18:46:40 +0900 |
|---|---|---|
| committer | nagachika <nagachika@ruby-lang.org> | 2021-02-20 18:46:40 +0900 |
| commit | 931815bfd86df603337194f3fcefb46bfe3e7940 (patch) | |
| tree | 88cada33acfc5f71947c0b54ef6f8b4da5a358fd /lib/exe/bundle | |
| parent | 0cfd491732162eab61227ac4b49617c37ddbb316 (diff) | |
merge revision(s) eeacdcb9a073c7d8ad703e0dc9faf229a5ebbe3c: [Backport #17558]
Fixed premature return
After setting ruby2_keywords for bmethod, the rest of arguments
had been ignored. [Bug #17558]
---
test/ruby/test_keyword.rb | 9 +++++++++
vm_method.c | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
Diffstat (limited to 'lib/exe/bundle')
| -rwxr-xr-x | lib/exe/bundle | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/exe/bundle b/lib/exe/bundle new file mode 100755 index 0000000000..b3b1b691d8 --- /dev/null +++ b/lib/exe/bundle @@ -0,0 +1,47 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# Exit cleanly from an early interrupt +Signal.trap("INT") do + Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler) + exit 1 +end + +base_path = File.expand_path("../lib", __dir__) + +if File.exist?(base_path) + require_relative "../lib/bundler" +else + require "bundler" +end + +# Check if an older version of bundler is installed +$LOAD_PATH.each do |path| + next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9 + err = String.new + 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 + +if File.exist?(base_path) + require_relative "../lib/bundler/friendly_errors" +else + require "bundler/friendly_errors" +end + +Bundler.with_friendly_errors do + if File.exist?(base_path) + require_relative "../lib/bundler/cli" + else + require "bundler/cli" + end + + # Allow any command to use --help flag to show help for that command + help_flags = %w[--help -h] + help_flag_used = ARGV.any? {|a| help_flags.include? a } + args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV + + Bundler::CLI.start(args, :debug => true) +end |
