Skip to content

Commit 43f80b1

Browse files
Merge pull request #4638 from rubygems/release/bundler_2.2.19_rubygems_3.2.19
Prepare rubygems 3.2.19 and bundler 2.2.19
2 parents 6a9e89b + 8175eb1 commit 43f80b1

File tree

17 files changed

+93
-16
lines changed

17 files changed

+93
-16
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 3.2.19 / 2021-05-31
2+
3+
## Enhancements:
4+
5+
* Fix `gem help build` output format. Pull request #4613 by tnir
6+
17
# 3.2.18 / 2021-05-25
28

39
## Enhancements:

bundler/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 2.2.19 (May 31, 2021)
2+
3+
## Bug fixes:
4+
5+
- Restore support for configuration keys with dashes [#4582](https://github.com/rubygems/rubygems/pull/4582)
6+
- Fix some cached gems being unintentionally ignored when using rubygems 3.2.18 [#4623](https://github.com/rubygems/rubygems/pull/4623)
7+
18
# 2.2.18 (May 25, 2021)
29

310
## Security fixes:

bundler/lib/bundler/settings.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,20 @@ def load_config(config_file)
442442
valid_file = file.exist? && !file.size.zero?
443443
return {} unless valid_file
444444
require_relative "yaml_serializer"
445-
YAMLSerializer.load file.read
445+
YAMLSerializer.load(file.read).inject({}) do |config, (k, v)|
446+
new_k = k
447+
448+
if k.include?("-")
449+
Bundler.ui.warn "Your #{file} config includes `#{k}`, which contains the dash character (`-`).\n" \
450+
"This is deprecated, because configuration through `ENV` should be possible, but `ENV` keys cannot include dashes.\n" \
451+
"Please edit #{file} and replace any dashes in configuration keys with a triple underscore (`___`)."
452+
453+
new_k = k.gsub("-", "___")
454+
end
455+
456+
config[new_k] = v
457+
config
458+
end
446459
end
447460
end
448461

bundler/lib/bundler/source/rubygems.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,6 @@ def cached_specs
398398
next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
399399
s ||= Bundler.rubygems.spec_from_gem(gemfile)
400400
s.source = self
401-
if Bundler.rubygems.spec_missing_extensions?(s, false)
402-
Bundler.ui.debug "Source #{self} is ignoring #{s} because it is missing extensions"
403-
next
404-
end
405401
idx << s
406402
end
407403

bundler/lib/bundler/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: false
22

33
module Bundler
4-
VERSION = "2.2.18".freeze
4+
VERSION = "2.2.19".freeze
55

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

bundler/spec/bundler/settings_spec.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,16 +312,26 @@
312312
describe "BUNDLE_ keys format" do
313313
let(:settings) { described_class.new(bundled_app(".bundle")) }
314314

315-
it "converts older keys without double dashes" do
315+
it "converts older keys without double underscore" do
316316
config("BUNDLE_MY__PERSONAL.RACK" => "~/Work/git/rack")
317317
expect(settings["my.personal.rack"]).to eq("~/Work/git/rack")
318318
end
319319

320-
it "converts older keys without trailing slashes and double dashes" do
320+
it "converts older keys without trailing slashes and double underscore" do
321321
config("BUNDLE_MIRROR__HTTPS://RUBYGEMS.ORG" => "http://rubygems-mirror.org")
322322
expect(settings["mirror.https://rubygems.org/"]).to eq("http://rubygems-mirror.org")
323323
end
324324

325+
it "converts older keys with dashes" do
326+
config("BUNDLE_MY-PERSONAL-SERVER__ORG" => "my-personal-server.org")
327+
expect(Bundler.ui).to receive(:warn).with(
328+
"Your #{bundled_app(".bundle/config")} config includes `BUNDLE_MY-PERSONAL-SERVER__ORG`, which contains the dash character (`-`).\n" \
329+
"This is deprecated, because configuration through `ENV` should be possible, but `ENV` keys cannot include dashes.\n" \
330+
"Please edit #{bundled_app(".bundle/config")} and replace any dashes in configuration keys with a triple underscore (`___`)."
331+
)
332+
expect(settings["my-personal-server.org"]).to eq("my-personal-server.org")
333+
end
334+
325335
it "reads newer keys format properly" do
326336
config("BUNDLE_MIRROR__HTTPS://RUBYGEMS__ORG/" => "http://rubygems-mirror.org")
327337
expect(settings["mirror.https://rubygems.org/"]).to eq("http://rubygems-mirror.org")

bundler/spec/commands/cache_spec.rb

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,30 @@
302302
expect(out).to include("frozen").or include("deployment")
303303
end
304304
end
305+
306+
context "with gems with extensions" do
307+
before do
308+
build_repo2 do
309+
build_gem "racc", "2.0" do |s|
310+
s.add_dependency "rake"
311+
s.extensions << "Rakefile"
312+
s.write "Rakefile", "task(:default) { puts 'INSTALLING rack' }"
313+
end
314+
end
315+
316+
gemfile <<~G
317+
source "#{file_uri_for(gem_repo2)}"
318+
319+
gem "racc"
320+
G
321+
end
322+
323+
it "installs them properly from cache to a different path" do
324+
bundle "cache"
325+
bundle "config set --local path vendor/bundle"
326+
bundle "install --local"
327+
end
328+
end
305329
end
306330

307331
RSpec.describe "bundle install with gem sources" do
@@ -321,7 +345,7 @@
321345
expect(the_bundle).to include_gems "rack 1.0.0"
322346
end
323347

324-
it "does not hit the remote at all" do
348+
it "does not hit the remote at all in frozen mode" do
325349
build_repo2
326350
install_gemfile <<-G
327351
source "#{file_uri_for(gem_repo2)}"

bundler/tool/bundler/rubocop23_gems.rb.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ DEPENDENCIES
5454
test-unit
5555

5656
BUNDLED WITH
57-
2.2.18
57+
2.2.19

bundler/tool/bundler/rubocop_gems.rb.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ DEPENDENCIES
5656
test-unit
5757

5858
BUNDLED WITH
59-
2.2.18
59+
2.2.19

bundler/tool/bundler/test_gems.rb.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ DEPENDENCIES
4040
webrick (= 1.7.0)
4141

4242
BUNDLED WITH
43-
2.2.18
43+
2.2.19

0 commit comments

Comments
 (0)