Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit 8bd21aa

Browse files
Merge #7502
7502: Release 2.1.1 r=deivid-rodriguez a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was I want to get regression fixed as soon as possible to reduce impact. ### What is your fix for the problem, implemented in this PR? My fix is to release what we have already fixed as soon as possible. Co-authored-by: Bundlerbot <[email protected]> Co-authored-by: David Rodríguez <[email protected]>
2 parents 683fe97 + 0a5db7e commit 8bd21aa

File tree

8 files changed

+41
-14
lines changed

8 files changed

+41
-14
lines changed

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
- rvm: 2.6.5
4949
script: bin/rake rubocop
5050
stage: linting
51+
- rvm: 2.6.5
52+
script: bin/rake check_rvm_integration
53+
stage: linting
5154
# Ruby 2.3 also tested in 2.x mode
5255
- rvm: 2.3.8
5356
env: RGV=master

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 2.1.1 (December 17, 2019)
2+
3+
Bugfixes:
4+
5+
- Fix some cases of shelling out to `rubygems` still being silent [#7493](https://github.com/bundler/bundler/pull/7493)
6+
- Restore compatibility with `rubygems-bundler` so that binstubs work under `RVM` [#7498](https://github.com/bundler/bundler/pull/7498)
7+
18
## 2.1.0 (December 15, 2019)
29

310
Features:

Rakefile

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# frozen_string_literal: true
22

3-
$:.unshift File.expand_path("../lib", __FILE__)
43
require "benchmark"
54

65
require_relative "spec/support/rubygems_ext"
@@ -123,6 +122,14 @@ task :rubocop do
123122
sh("bin/rubocop --parallel")
124123
end
125124

125+
desc "Check RVM integration"
126+
task :check_rvm_integration do
127+
# The rubygems-bundler gem is installed by RVM by default and it could easily
128+
# break when we change bundler. Make sure that binstubs still run with it
129+
# installed.
130+
sh("bin/rake install && gem install rubygems-bundler && rake -T")
131+
end
132+
126133
namespace :man do
127134
if RUBY_ENGINE == "jruby"
128135
task(:build) {}

lib/bundler/cli/exec.rb

+3-12
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ def run
2525
SharedHelpers.set_bundle_environment
2626
if bin_path = Bundler.which(cmd)
2727
if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
28-
return with_verbose_rubygems { kernel_load(bin_path, *args) }
28+
return kernel_load(bin_path, *args)
2929
end
30-
with_verbose_rubygems { kernel_exec(bin_path, *args) }
30+
kernel_exec(bin_path, *args)
3131
else
3232
# exec using the given command
33-
with_verbose_rubygems { kernel_exec(cmd, *args) }
33+
kernel_exec(cmd, *args)
3434
end
3535
end
3636

@@ -89,14 +89,5 @@ def ruby_shebang?(file)
8989
first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
9090
possibilities.any? {|shebang| first_line.start_with?(shebang) }
9191
end
92-
93-
def with_verbose_rubygems
94-
old_ui = Gem::DefaultUserInteraction.ui
95-
Gem::DefaultUserInteraction.ui = nil
96-
97-
yield
98-
ensure
99-
Gem::DefaultUserInteraction.ui = old_ui
100-
end
10192
end
10293
end

lib/bundler/rubygems_integration.rb

+8
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,14 @@ def stub_rubygems(specs)
525525
end
526526
end
527527

528+
def plain_specs
529+
Gem::Specification._all
530+
end
531+
532+
def plain_specs=(specs)
533+
Gem::Specification.all = specs
534+
end
535+
528536
def fetch_specs(remote, name)
529537
path = remote.uri.to_s + "#{name}.#{Gem.marshal_version}.gz"
530538
fetcher = gem_remote_fetcher

lib/bundler/setup.rb

+5
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@
1919
else
2020
Bundler.ui.silence { Bundler.setup }
2121
end
22+
23+
# We might be in the middle of shelling out to rubygems
24+
# (RUBYOPT=-rbundler/setup), so we need to give rubygems the opportunity of
25+
# not being silent.
26+
Gem::DefaultUserInteraction.ui = nil
2227
end

lib/bundler/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: false
22

33
module Bundler
4-
VERSION = "2.1.0".freeze
4+
VERSION = "2.1.1".freeze
55

66
def self.bundler_major_version
77
@bundler_major_version ||= VERSION.split(".").first.to_i

spec/commands/exec_spec.rb

+6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@
6161
expect(out).to eq(Gem::VERSION)
6262
end
6363

64+
it "works when exec'ing to rubygems through sh -c" do
65+
install_gemfile 'gem "rack"'
66+
bundle "exec sh -c '#{gem_cmd} --version'"
67+
expect(out).to eq(Gem::VERSION)
68+
end
69+
6470
it "respects custom process title when loading through ruby" do
6571
script_that_changes_its_own_title_and_checks_if_picked_up_by_ps_unix_utility = <<~'RUBY'
6672
Process.setproctitle("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15")

0 commit comments

Comments
 (0)