diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-29 11:47:12 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-12 10:13:16 +0200 |
commit | a7caa4dfc94ea0fc8a1b25c216edec1531ffab6f (patch) | |
tree | 9e9b221341592dfc3a92c44649adc4c4d6b58c69 | |
parent | 5960c7e639d077ea3ad5b2202b4bbaf3e7364d2c (diff) | |
download | bundler-a7caa4dfc94ea0fc8a1b25c216edec1531ffab6f.tar.gz |
Assume `exec_name` needs to be given
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 79ff277bbe..e8a22c4242 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -439,29 +439,25 @@ module Bundler redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args| exec_name = args.first + raise ArgumentError, "you must supply exec_name" unless exec_name spec_with_name = specs_by_name[gem_name] - spec = if exec_name + spec = if spec_with_name && spec_with_name.executables.include?(exec_name) spec_with_name else specs.find {|s| s.executables.include?(exec_name) } end - else - spec_with_name - end unless spec message = "can't find executable #{exec_name} for gem #{gem_name}" - if !exec_name || spec_with_name.nil? + if spec_with_name.nil? message += ". #{gem_name} is not currently included in the bundle, " \ "perhaps you meant to add it to your #{Bundler.default_gemfile.basename}?" end raise Gem::Exception, message end - raise Gem::Exception, "no default executable for #{spec.full_name}" unless exec_name ||= spec.default_executable - unless spec.name == gem_name Bundler::SharedHelpers.major_deprecation 2, "Bundler is using a binstub that was created for a different gem (#{spec.name}).\n" \ |