rubygems-update 3.3.21 → 3.3.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +32 -0
- data/Manifest.txt +8 -0
- data/POLICIES.md +38 -5
- data/bundler/CHANGELOG.md +40 -0
- data/bundler/bundler.gemspec +6 -8
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/init.rb +5 -1
- data/bundler/lib/bundler/cli.rb +2 -1
- data/bundler/lib/bundler/current_ruby.rb +14 -5
- data/bundler/lib/bundler/definition.rb +7 -20
- data/bundler/lib/bundler/dependency.rb +18 -85
- data/bundler/lib/bundler/dsl.rb +0 -1
- data/bundler/lib/bundler/endpoint_specification.rb +1 -1
- data/bundler/lib/bundler/feature_flag.rb +0 -1
- data/bundler/lib/bundler/gem_version_promoter.rb +10 -25
- data/bundler/lib/bundler/index.rb +3 -26
- data/bundler/lib/bundler/injector.rb +2 -1
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/man/bundle-add.1 +6 -2
- data/bundler/lib/bundler/man/bundle-add.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +1 -1
- data/bundler/lib/bundler/man/bundle-console.1 +53 -0
- data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
- data/bundler/lib/bundler/man/bundle-help.1 +13 -0
- data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-version.1 +35 -0
- data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +6 -2
- data/bundler/lib/bundler/man/bundle.1.ronn +4 -1
- data/bundler/lib/bundler/man/gemfile.5 +8 -38
- data/bundler/lib/bundler/man/gemfile.5.ronn +9 -27
- data/bundler/lib/bundler/man/index.txt +3 -0
- data/bundler/lib/bundler/match_remote_metadata.rb +4 -1
- data/bundler/lib/bundler/resolver/base.rb +50 -0
- data/bundler/lib/bundler/resolver.rb +72 -93
- data/bundler/lib/bundler/rubygems_ext.rb +24 -3
- data/bundler/lib/bundler/settings.rb +0 -1
- data/bundler/lib/bundler/spec_set.rb +11 -1
- data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +5 -4
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems/gemcutter_utilities.rb +8 -1
- data/lib/rubygems/package.rb +9 -4
- data/lib/rubygems/platform.rb +17 -1
- data/lib/rubygems/query_utils.rb +2 -2
- data/lib/rubygems/resolver.rb +1 -1
- data/lib/rubygems.rb +1 -1
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/helper.rb +23 -19
- data/test/rubygems/packages/Bluebie-legs-0.6.2.gem +0 -0
- data/test/rubygems/test_gem.rb +254 -212
- data/test/rubygems/test_gem_commands_info_command.rb +26 -0
- data/test/rubygems/test_gem_commands_owner_command.rb +105 -24
- data/test/rubygems/test_gem_commands_push_command.rb +44 -23
- data/test/rubygems/test_gem_commands_signin_command.rb +28 -3
- data/test/rubygems/test_gem_commands_yank_command.rb +9 -9
- data/test/rubygems/test_gem_gemcutter_utilities.rb +16 -12
- data/test/rubygems/test_gem_package.rb +15 -0
- data/test/rubygems/test_gem_platform.rb +67 -0
- data/test/rubygems/test_gem_resolver.rb +33 -0
- data/test/rubygems/test_require.rb +5 -5
- data/test/rubygems/utilities.rb +36 -14
- metadata +11 -3
@@ -93,7 +93,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
93
93
|
|
94
94
|
def test_sign_in
|
95
95
|
api_key = "a5fdbb6ba150cbb83aad2bb2fede64cf040453903"
|
96
|
-
util_sign_in
|
96
|
+
util_sign_in HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK")
|
97
97
|
|
98
98
|
assert_match %r{Enter your RubyGems.org credentials.}, @sign_in_ui.output
|
99
99
|
assert @fetcher.last_request["authorization"]
|
@@ -106,7 +106,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
106
106
|
def test_sign_in_with_host
|
107
107
|
api_key = "a5fdbb6ba150cbb83aad2bb2fede64cf040453903"
|
108
108
|
|
109
|
-
util_sign_in
|
109
|
+
util_sign_in HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK"), "http://example.com", ["http://example.com"]
|
110
110
|
|
111
111
|
assert_match "Enter your http://example.com credentials.",
|
112
112
|
@sign_in_ui.output
|
@@ -120,7 +120,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
120
120
|
def test_sign_in_with_host_nil
|
121
121
|
api_key = "a5fdbb6ba150cbb83aad2bb2fede64cf040453903"
|
122
122
|
|
123
|
-
util_sign_in
|
123
|
+
util_sign_in HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK"), nil, [nil]
|
124
124
|
|
125
125
|
assert_match "Enter your RubyGems.org credentials.",
|
126
126
|
@sign_in_ui.output
|
@@ -133,7 +133,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
133
133
|
|
134
134
|
def test_sign_in_with_host_ENV
|
135
135
|
api_key = "a5fdbb6ba150cbb83aad2bb2fede64cf040453903"
|
136
|
-
util_sign_in
|
136
|
+
util_sign_in HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK"), "http://example.com"
|
137
137
|
|
138
138
|
assert_match "Enter your http://example.com credentials.",
|
139
139
|
@sign_in_ui.output
|
@@ -148,7 +148,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
148
148
|
api_key = "a5fdbb6ba150cbb83aad2bb2fede64cf040453903"
|
149
149
|
Gem.configuration.rubygems_api_key = api_key
|
150
150
|
|
151
|
-
util_sign_in
|
151
|
+
util_sign_in HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK")
|
152
152
|
|
153
153
|
assert_equal "", @sign_in_ui.output
|
154
154
|
end
|
@@ -157,7 +157,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
157
157
|
api_key = "a5fdbb6ba150cbb83aad2bb2fede64cf040453903"
|
158
158
|
Gem.configuration.api_keys[:KEY] = "other"
|
159
159
|
@cmd.options[:key] = :KEY
|
160
|
-
util_sign_in
|
160
|
+
util_sign_in HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK")
|
161
161
|
|
162
162
|
assert_equal "", @sign_in_ui.output
|
163
163
|
end
|
@@ -169,7 +169,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
169
169
|
File.open Gem.configuration.credentials_path, "w" do |f|
|
170
170
|
f.write Hash[:other_api_key, other_api_key].to_yaml
|
171
171
|
end
|
172
|
-
util_sign_in
|
172
|
+
util_sign_in HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK")
|
173
173
|
|
174
174
|
assert_match %r{Enter your RubyGems.org credentials.}, @sign_in_ui.output
|
175
175
|
assert_match %r{Signed in.}, @sign_in_ui.output
|
@@ -181,7 +181,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
181
181
|
|
182
182
|
def test_sign_in_with_bad_credentials
|
183
183
|
assert_raise Gem::MockGemUi::TermError do
|
184
|
-
util_sign_in
|
184
|
+
util_sign_in HTTPResponseFactory.create(body: "Access Denied.", code: 403, msg: "Forbidden")
|
185
185
|
end
|
186
186
|
|
187
187
|
assert_match %r{Enter your RubyGems.org credentials.}, @sign_in_ui.output
|
@@ -192,7 +192,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
192
192
|
ENV["GEM_HOST_OTP_CODE"] = "111111"
|
193
193
|
api_key = "a5fdbb6ba150cbb83aad2bb2fede64cf040453903"
|
194
194
|
|
195
|
-
util_sign_in
|
195
|
+
util_sign_in HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK")
|
196
196
|
|
197
197
|
assert_match "Signed in with API key:", @sign_in_ui.output
|
198
198
|
assert_equal "111111", @fetcher.last_request["OTP"]
|
@@ -204,7 +204,11 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
204
204
|
|
205
205
|
util_sign_in(proc do
|
206
206
|
@call_count ||= 0
|
207
|
-
(@call_count += 1).odd?
|
207
|
+
if (@call_count += 1).odd?
|
208
|
+
HTTPResponseFactory.create(body: response_fail, code: 401, msg: "Unauthorized")
|
209
|
+
else
|
210
|
+
HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK")
|
211
|
+
end
|
208
212
|
end, nil, [], "111111\n")
|
209
213
|
|
210
214
|
assert_match "You have enabled multi-factor authentication. Please enter OTP code.", @sign_in_ui.output
|
@@ -217,7 +221,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
217
221
|
response = "You have enabled multifactor authentication but your request doesn't have the correct OTP code. Please check it and retry."
|
218
222
|
|
219
223
|
assert_raise Gem::MockGemUi::TermError do
|
220
|
-
util_sign_in
|
224
|
+
util_sign_in HTTPResponseFactory.create(body: response, code: 401, msg: "Unauthorized"), nil, [], "111111\n"
|
221
225
|
end
|
222
226
|
|
223
227
|
assert_match "You have enabled multi-factor authentication. Please enter OTP code.", @sign_in_ui.output
|
@@ -229,7 +233,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
229
233
|
def util_sign_in(response, host = nil, args = [], extra_input = "")
|
230
234
|
email = "you@example.com"
|
231
235
|
password = "secret"
|
232
|
-
profile_response =
|
236
|
+
profile_response = HTTPResponseFactory.create(body: "mfa: disabled\n", code: 200, msg: "OK")
|
233
237
|
|
234
238
|
if host
|
235
239
|
ENV["RUBYGEMS_HOST"] = host
|
@@ -510,6 +510,21 @@ class TestGemPackage < Gem::Package::TarTestCase
|
|
510
510
|
assert_path_exist @destination
|
511
511
|
end
|
512
512
|
|
513
|
+
def test_extract_file_permissions
|
514
|
+
pend "chmod not supported" if win_platform?
|
515
|
+
|
516
|
+
gem_with_long_permissions = File.expand_path("packages/Bluebie-legs-0.6.2.gem", __dir__)
|
517
|
+
|
518
|
+
package = Gem::Package.new gem_with_long_permissions
|
519
|
+
|
520
|
+
package.extract_files @destination
|
521
|
+
|
522
|
+
filepath = File.join @destination, "README.rdoc"
|
523
|
+
assert_path_exist filepath
|
524
|
+
|
525
|
+
assert_equal 0104444, File.stat(filepath).mode
|
526
|
+
end
|
527
|
+
|
513
528
|
def test_extract_tar_gz_absolute
|
514
529
|
package = Gem::Package.new @gem
|
515
530
|
|
@@ -138,6 +138,10 @@ class TestGemPlatform < Gem::TestCase
|
|
138
138
|
"x86_64-linux-gnu" => ["x86_64", "linux", "gnu"],
|
139
139
|
"x86_64-linux-musl" => ["x86_64", "linux", "musl"],
|
140
140
|
"x86_64-linux-uclibc" => ["x86_64", "linux", "uclibc"],
|
141
|
+
"arm-linux-eabi" => ["arm", "linux", "eabi"],
|
142
|
+
"arm-linux-gnueabi" => ["arm", "linux", "gnueabi"],
|
143
|
+
"arm-linux-musleabi" => ["arm", "linux", "musleabi"],
|
144
|
+
"arm-linux-uclibceabi" => ["arm", "linux", "uclibceabi"],
|
141
145
|
"x86_64-openbsd3.9" => ["x86_64", "openbsd", "3.9"],
|
142
146
|
"x86_64-openbsd4.0" => ["x86_64", "openbsd", "4.0"],
|
143
147
|
"x86_64-openbsd" => ["x86_64", "openbsd", nil],
|
@@ -301,6 +305,62 @@ class TestGemPlatform < Gem::TestCase
|
|
301
305
|
refute(x86_linux_uclibc === x86_linux, "linux-uclibc =~ linux")
|
302
306
|
end
|
303
307
|
|
308
|
+
def test_eabi_version_is_stricter_for_linux_os
|
309
|
+
arm_linux_eabi = Gem::Platform.new "arm-linux-eabi"
|
310
|
+
arm_linux_gnueabi = Gem::Platform.new "arm-linux-gnueabi"
|
311
|
+
arm_linux_musleabi = Gem::Platform.new "arm-linux-musleabi"
|
312
|
+
arm_linux_uclibceabi = Gem::Platform.new "arm-linux-uclibceabi"
|
313
|
+
|
314
|
+
# a naked linux runtime is implicit gnu, as it represents the common glibc-linked runtime
|
315
|
+
assert(arm_linux_eabi === arm_linux_gnueabi, "linux-eabi =~ linux-gnueabi")
|
316
|
+
assert(arm_linux_gnueabi === arm_linux_eabi, "linux-gnueabi =~ linux-eabi")
|
317
|
+
|
318
|
+
# musl and explicit gnu should differ
|
319
|
+
refute(arm_linux_gnueabi === arm_linux_musleabi, "linux-gnueabi =~ linux-musleabi")
|
320
|
+
refute(arm_linux_musleabi === arm_linux_gnueabi, "linux-musleabi =~ linux-gnueabi")
|
321
|
+
|
322
|
+
# explicit libc differ
|
323
|
+
refute(arm_linux_uclibceabi === arm_linux_musleabi, "linux-uclibceabi =~ linux-musleabi")
|
324
|
+
refute(arm_linux_musleabi === arm_linux_uclibceabi, "linux-musleabi =~ linux-uclibceabi")
|
325
|
+
|
326
|
+
# musl host runtime accepts libc-generic or statically linked gems...
|
327
|
+
assert(arm_linux_eabi === arm_linux_musleabi, "linux-eabi =~ linux-musleabi")
|
328
|
+
# ...but implicit gnu runtime generally does not accept musl-specific gems
|
329
|
+
refute(arm_linux_musleabi === arm_linux_eabi, "linux-musleabi =~ linux-eabi")
|
330
|
+
|
331
|
+
# other libc are not glibc compatible
|
332
|
+
refute(arm_linux_eabi === arm_linux_uclibceabi, "linux-eabi =~ linux-uclibceabi")
|
333
|
+
refute(arm_linux_uclibceabi === arm_linux_eabi, "linux-uclibceabi =~ linux-eabi")
|
334
|
+
end
|
335
|
+
|
336
|
+
def test_eabi_and_nil_version_combination_strictness
|
337
|
+
arm_linux = Gem::Platform.new "arm-linux"
|
338
|
+
arm_linux_eabi = Gem::Platform.new "arm-linux-eabi"
|
339
|
+
arm_linux_eabihf = Gem::Platform.new "arm-linux-eabihf"
|
340
|
+
arm_linux_gnueabi = Gem::Platform.new "arm-linux-gnueabi"
|
341
|
+
arm_linux_gnueabihf = Gem::Platform.new "arm-linux-gnueabihf"
|
342
|
+
arm_linux_musleabi = Gem::Platform.new "arm-linux-musleabi"
|
343
|
+
arm_linux_musleabihf = Gem::Platform.new "arm-linux-musleabihf"
|
344
|
+
arm_linux_uclibceabi = Gem::Platform.new "arm-linux-uclibceabi"
|
345
|
+
arm_linux_uclibceabihf = Gem::Platform.new "arm-linux-uclibceabihf"
|
346
|
+
|
347
|
+
# generic arm host runtime with eabi modifier accepts generic arm gems
|
348
|
+
assert(arm_linux === arm_linux_eabi, "arm-linux =~ arm-linux-eabi")
|
349
|
+
assert(arm_linux === arm_linux_eabihf, "arm-linux =~ arm-linux-eabihf")
|
350
|
+
|
351
|
+
# explicit gnu arm host runtime with eabi modifier accepts generic arm gems
|
352
|
+
assert(arm_linux === arm_linux_gnueabi, "arm-linux =~ arm-linux-gnueabi")
|
353
|
+
assert(arm_linux === arm_linux_gnueabihf, "arm-linux =~ arm-linux-gnueabihf")
|
354
|
+
|
355
|
+
# musl arm host runtime accepts libc-generic or statically linked gems...
|
356
|
+
assert(arm_linux === arm_linux_musleabi, "arm-linux =~ arm-linux-musleabi")
|
357
|
+
assert(arm_linux === arm_linux_musleabihf, "arm-linux =~ arm-linux-musleabihf")
|
358
|
+
|
359
|
+
# other libc arm hosts are not glibc compatible
|
360
|
+
refute(arm_linux === arm_linux_uclibceabi, "arm-linux =~ arm-linux-uclibceabi")
|
361
|
+
refute(arm_linux === arm_linux_uclibceabihf, "arm-linux =~ arm-linux-uclibceabihf")
|
362
|
+
end
|
363
|
+
|
304
364
|
def test_equals3_cpu_arm
|
305
365
|
arm = Gem::Platform.new "arm-linux"
|
306
366
|
armv5 = Gem::Platform.new "armv5-linux"
|
@@ -420,6 +480,13 @@ class TestGemPlatform < Gem::TestCase
|
|
420
480
|
assert_equal 1, result.scan(/@version=/).size
|
421
481
|
end
|
422
482
|
|
483
|
+
def test_gem_platform_match_with_string_argument
|
484
|
+
util_set_arch "x86_64-linux-musl"
|
485
|
+
|
486
|
+
assert(Gem::Platform.match(Gem::Platform.new("x86_64-linux")), "should match Gem::Platform")
|
487
|
+
assert(Gem::Platform.match("x86_64-linux"), "should match String platform")
|
488
|
+
end
|
489
|
+
|
423
490
|
def assert_local_match(name)
|
424
491
|
assert_match Gem::Platform.local, name
|
425
492
|
end
|
@@ -391,6 +391,39 @@ class TestGemResolver < Gem::TestCase
|
|
391
391
|
end
|
392
392
|
end
|
393
393
|
|
394
|
+
def test_pick_generic_linux_variants_on_musl_linux
|
395
|
+
util_set_arch "aarch64-linux-musl" do
|
396
|
+
is = Gem::Resolver::IndexSpecification
|
397
|
+
|
398
|
+
linux = Gem::Platform.new("aarch64-linux")
|
399
|
+
|
400
|
+
spec_fetcher do |fetcher|
|
401
|
+
fetcher.spec "libv8-node", "15.14.0.1" do |s|
|
402
|
+
s.platform = linux
|
403
|
+
end
|
404
|
+
|
405
|
+
fetcher.spec "libv8-node", "15.14.0.1"
|
406
|
+
end
|
407
|
+
|
408
|
+
v15 = v("15.14.0.1")
|
409
|
+
source = Gem::Source.new @gem_repo
|
410
|
+
|
411
|
+
s = set
|
412
|
+
|
413
|
+
v15_ruby = is.new s, "libv8-node", v15, source, Gem::Platform::RUBY
|
414
|
+
v15_linux = is.new s, "libv8-node", v15, source, linux.to_s
|
415
|
+
|
416
|
+
s.add v15_linux
|
417
|
+
s.add v15_ruby
|
418
|
+
|
419
|
+
ad = make_dep "libv8-node", "= 15.14.0.1"
|
420
|
+
|
421
|
+
res = Gem::Resolver.new([ad], s)
|
422
|
+
|
423
|
+
assert_resolves_to [v15_linux.spec], res
|
424
|
+
end
|
425
|
+
end
|
426
|
+
|
394
427
|
def test_only_returns_spec_once
|
395
428
|
a1 = util_spec "a", "1", "c" => "= 1"
|
396
429
|
b1 = util_spec "b", "1", "c" => "= 1"
|
@@ -252,9 +252,9 @@ class TestGemRequire < Gem::TestCase
|
|
252
252
|
# Activates a-1, but not b-1 and b-2
|
253
253
|
assert_require "test_gem_require_a"
|
254
254
|
assert_equal %w[a-1], loaded_spec_names
|
255
|
-
assert $LOAD_PATH.include? a1.
|
256
|
-
refute $LOAD_PATH.include? b1.
|
257
|
-
refute $LOAD_PATH.include? b2.
|
255
|
+
assert $LOAD_PATH.include? a1.full_require_paths[0]
|
256
|
+
refute $LOAD_PATH.include? b1.full_require_paths[0]
|
257
|
+
refute $LOAD_PATH.include? b2.full_require_paths[0]
|
258
258
|
|
259
259
|
assert_equal unresolved_names, ["b (>= 1)"]
|
260
260
|
|
@@ -265,13 +265,13 @@ class TestGemRequire < Gem::TestCase
|
|
265
265
|
# and as a result #gem_original_require returns false.
|
266
266
|
refute require("benchmark"), "the benchmark stdlib should be recognized as already loaded"
|
267
267
|
|
268
|
-
assert_includes $LOAD_PATH, b2.
|
268
|
+
assert_includes $LOAD_PATH, b2.full_require_paths[0]
|
269
269
|
assert_includes $LOAD_PATH, rubylibdir
|
270
270
|
message = proc {
|
271
271
|
"this test relies on the b-2 gem lib/ to be before stdlib to make sense\n" +
|
272
272
|
$LOAD_PATH.pretty_inspect
|
273
273
|
}
|
274
|
-
assert_operator $LOAD_PATH.index(b2.
|
274
|
+
assert_operator $LOAD_PATH.index(b2.full_require_paths[0]), :<, $LOAD_PATH.index(rubylibdir), message
|
275
275
|
|
276
276
|
# We detected that we should activate b-2, so we did so, but
|
277
277
|
# then #gem_original_require decided "I've already got some benchmark.rb" loaded.
|
data/test/rubygems/utilities.rb
CHANGED
@@ -54,13 +54,21 @@ class Gem::FakeFetcher
|
|
54
54
|
raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", path)
|
55
55
|
end
|
56
56
|
|
57
|
-
if @data[path].kind_of?(Array)
|
57
|
+
if @data[path].kind_of?(Array)
|
58
58
|
@data[path].shift
|
59
59
|
else
|
60
60
|
@data[path]
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
+
def create_response(uri)
|
65
|
+
data = find_data(uri)
|
66
|
+
response = data.respond_to?(:call) ? data.call : data
|
67
|
+
raise TypeError, "#{response.class} is not a type of Net::HTTPResponse" unless response.kind_of?(Net::HTTPResponse)
|
68
|
+
|
69
|
+
response
|
70
|
+
end
|
71
|
+
|
64
72
|
def fetch_path(path, mtime = nil, head = false)
|
65
73
|
data = find_data(path)
|
66
74
|
|
@@ -85,26 +93,16 @@ class Gem::FakeFetcher
|
|
85
93
|
|
86
94
|
# Thanks, FakeWeb!
|
87
95
|
def open_uri_or_path(path)
|
88
|
-
|
89
|
-
body, code, msg = data
|
96
|
+
find_data(path)
|
90
97
|
|
91
|
-
|
92
|
-
response.instance_variable_set(:@body, body)
|
93
|
-
response.instance_variable_set(:@read, true)
|
94
|
-
response
|
98
|
+
create_response(uri)
|
95
99
|
end
|
96
100
|
|
97
101
|
def request(uri, request_class, last_modified = nil)
|
98
|
-
data = find_data(uri)
|
99
|
-
body, code, msg = (data.respond_to?(:call) ? data.call : data)
|
100
|
-
|
101
102
|
@last_request = request_class.new uri.request_uri
|
102
103
|
yield @last_request if block_given?
|
103
104
|
|
104
|
-
|
105
|
-
response.instance_variable_set(:@body, body)
|
106
|
-
response.instance_variable_set(:@read, true)
|
107
|
-
response
|
105
|
+
create_response(uri)
|
108
106
|
end
|
109
107
|
|
110
108
|
def pretty_print(q) # :nodoc:
|
@@ -164,6 +162,30 @@ class Gem::FakeFetcher
|
|
164
162
|
end
|
165
163
|
end
|
166
164
|
|
165
|
+
##
|
166
|
+
# The HTTPResponseFactory allows easy creation of Net::HTTPResponse instances in RubyGems tests:
|
167
|
+
#
|
168
|
+
# Example:
|
169
|
+
#
|
170
|
+
# HTTPResponseFactory.create(
|
171
|
+
# body: "",
|
172
|
+
# code: 301,
|
173
|
+
# msg: "Moved Permanently",
|
174
|
+
# headers: { "location" => "http://example.com" }
|
175
|
+
# )
|
176
|
+
#
|
177
|
+
|
178
|
+
class HTTPResponseFactory
|
179
|
+
def self.create(body:, code:, msg:, headers: {})
|
180
|
+
response = Net::HTTPResponse.send(:response_class, code.to_s).new("1.0", code.to_s, msg)
|
181
|
+
response.instance_variable_set(:@body, body)
|
182
|
+
response.instance_variable_set(:@read, true)
|
183
|
+
headers.each {|name, value| response[name] = value }
|
184
|
+
|
185
|
+
response
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
167
189
|
# :stopdoc:
|
168
190
|
class Gem::RemoteFetcher
|
169
191
|
def self.fetcher=(fetcher)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems-update
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Weirich
|
@@ -16,7 +16,7 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2022-
|
19
|
+
date: 2022-10-05 00:00:00.000000000 Z
|
20
20
|
dependencies: []
|
21
21
|
description: |-
|
22
22
|
A package (also known as a library) contains a set of functionality
|
@@ -159,12 +159,16 @@ files:
|
|
159
159
|
- bundler/lib/bundler/man/bundle-clean.1.ronn
|
160
160
|
- bundler/lib/bundler/man/bundle-config.1
|
161
161
|
- bundler/lib/bundler/man/bundle-config.1.ronn
|
162
|
+
- bundler/lib/bundler/man/bundle-console.1
|
163
|
+
- bundler/lib/bundler/man/bundle-console.1.ronn
|
162
164
|
- bundler/lib/bundler/man/bundle-doctor.1
|
163
165
|
- bundler/lib/bundler/man/bundle-doctor.1.ronn
|
164
166
|
- bundler/lib/bundler/man/bundle-exec.1
|
165
167
|
- bundler/lib/bundler/man/bundle-exec.1.ronn
|
166
168
|
- bundler/lib/bundler/man/bundle-gem.1
|
167
169
|
- bundler/lib/bundler/man/bundle-gem.1.ronn
|
170
|
+
- bundler/lib/bundler/man/bundle-help.1
|
171
|
+
- bundler/lib/bundler/man/bundle-help.1.ronn
|
168
172
|
- bundler/lib/bundler/man/bundle-info.1
|
169
173
|
- bundler/lib/bundler/man/bundle-info.1.ronn
|
170
174
|
- bundler/lib/bundler/man/bundle-init.1
|
@@ -193,6 +197,8 @@ files:
|
|
193
197
|
- bundler/lib/bundler/man/bundle-show.1.ronn
|
194
198
|
- bundler/lib/bundler/man/bundle-update.1
|
195
199
|
- bundler/lib/bundler/man/bundle-update.1.ronn
|
200
|
+
- bundler/lib/bundler/man/bundle-version.1
|
201
|
+
- bundler/lib/bundler/man/bundle-version.1.ronn
|
196
202
|
- bundler/lib/bundler/man/bundle-viz.1
|
197
203
|
- bundler/lib/bundler/man/bundle-viz.1.ronn
|
198
204
|
- bundler/lib/bundler/man/bundle.1
|
@@ -217,6 +223,7 @@ files:
|
|
217
223
|
- bundler/lib/bundler/process_lock.rb
|
218
224
|
- bundler/lib/bundler/remote_specification.rb
|
219
225
|
- bundler/lib/bundler/resolver.rb
|
226
|
+
- bundler/lib/bundler/resolver/base.rb
|
220
227
|
- bundler/lib/bundler/resolver/spec_group.rb
|
221
228
|
- bundler/lib/bundler/retry.rb
|
222
229
|
- bundler/lib/bundler/ruby_dsl.rb
|
@@ -626,6 +633,7 @@ files:
|
|
626
633
|
- test/rubygems/invalidchild_cert_32.pem
|
627
634
|
- test/rubygems/invalidchild_key.pem
|
628
635
|
- test/rubygems/package/tar_test_case.rb
|
636
|
+
- test/rubygems/packages/Bluebie-legs-0.6.2.gem
|
629
637
|
- test/rubygems/packages/ascii_binder-0.1.10.1.gem
|
630
638
|
- test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem
|
631
639
|
- test/rubygems/plugin/exception/rubygems_plugin.rb
|
@@ -824,7 +832,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
824
832
|
- !ruby/object:Gem::Version
|
825
833
|
version: '0'
|
826
834
|
requirements: []
|
827
|
-
rubygems_version: 3.3.
|
835
|
+
rubygems_version: 3.3.23
|
828
836
|
signing_key:
|
829
837
|
specification_version: 4
|
830
838
|
summary: RubyGems is a package management framework for Ruby.
|