summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-05 17:43:29 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-12 10:14:11 +0200
commitb2ce7f93a630e837f5ef3e09f46b96e3c6e6cc7f (patch)
tree42725970e93013ee20fd806d4df4608b7e22970e
parenteacb43e569f985d6d836eef4053d3632ea4e16d5 (diff)
downloadbundler-b2ce7f93a630e837f5ef3e09f46b96e3c6e6cc7f.tar.gz
Another try
-rw-r--r--lib/bundler/rubygems_integration.rb6
-rw-r--r--spec/bundler/shared_helpers_spec.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 4c8155b2b4..a4519246a9 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -434,7 +434,7 @@ module Bundler
# Used to make bin stubs that are not created by bundler work
# under bundler. The new Gem.bin_path only considers gems in
# +specs+
- def replace_bin_path(specs, specs_by_name)
+ def replace_bin_path(specs_by_name)
gem_class = (class << Gem; self; end)
redefine_method(gem_class, :find_spec_for_exe) do |gem_name, *args|
@@ -442,7 +442,7 @@ module Bundler
raise ArgumentError, "you must supply exec_name" unless exec_name
spec_with_name = specs_by_name[gem_name]
- matching_specs_by_exec_name = specs.select {|s| s.executables.include?(exec_name) }
+ matching_specs_by_exec_name = specs_by_name.values.select {|s| s.executables.include?(exec_name) }
spec = matching_specs_by_exec_name.delete(spec_with_name)
unless spec || !matching_specs_by_exec_name.empty?
@@ -525,7 +525,7 @@ module Bundler
replace_gem(specs, specs_by_name)
stub_rubygems(specs)
- replace_bin_path(specs, specs_by_name)
+ replace_bin_path(specs_by_name)
replace_refresh
Gem.clear_paths
diff --git a/spec/bundler/shared_helpers_spec.rb b/spec/bundler/shared_helpers_spec.rb
index 445bc18265..f42d9ed485 100644
--- a/spec/bundler/shared_helpers_spec.rb
+++ b/spec/bundler/shared_helpers_spec.rb
@@ -389,7 +389,7 @@ RSpec.describe Bundler::SharedHelpers do
context "bundle executable in ENV['BUNDLE_BIN_PATH'] does not exist" do
before { ENV["BUNDLE_BIN_PATH"] = "/does/not/exist" }
- before { Bundler.rubygems.replace_bin_path [], [] }
+ before { Bundler.rubygems.replace_bin_path [] }
it "sets BUNDLE_BIN_PATH to the bundle executable file" do
subject.set_bundle_environment