rubygems-update 3.4.9 → 3.4.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -1
  3. data/Manifest.txt +0 -1
  4. data/bundler/CHANGELOG.md +25 -0
  5. data/bundler/lib/bundler/build_metadata.rb +2 -2
  6. data/bundler/lib/bundler/definition.rb +14 -2
  7. data/bundler/lib/bundler/gem_version_promoter.rb +1 -1
  8. data/bundler/lib/bundler/lazy_specification.rb +1 -1
  9. data/bundler/lib/bundler/plugin/installer.rb +5 -2
  10. data/bundler/lib/bundler/resolver/base.rb +37 -9
  11. data/bundler/lib/bundler/ruby_version.rb +1 -1
  12. data/bundler/lib/bundler/rubygems_ext.rb +5 -3
  13. data/bundler/lib/bundler/source/rubygems.rb +5 -8
  14. data/bundler/lib/bundler/spec_set.rb +15 -12
  15. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +5 -0
  16. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
  17. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +2 -2
  18. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  19. data/bundler/lib/bundler/version.rb +1 -1
  20. data/bundler/lib/bundler.rb +2 -3
  21. data/lib/rubygems/command_manager.rb +2 -2
  22. data/lib/rubygems/installer.rb +1 -1
  23. data/lib/rubygems/request_set.rb +2 -2
  24. data/lib/rubygems/specification.rb +3 -1
  25. data/lib/rubygems/stub_specification.rb +2 -1
  26. data/lib/rubygems.rb +1 -1
  27. data/rubygems-update.gemspec +1 -1
  28. data/test/rubygems/helper.rb +14 -0
  29. data/test/rubygems/test_bundled_ca.rb +1 -1
  30. data/test/rubygems/test_config.rb +1 -1
  31. data/test/rubygems/test_deprecate.rb +1 -1
  32. data/test/rubygems/test_exit.rb +1 -1
  33. data/test/rubygems/test_gem_ext_cargo_builder.rb +2 -1
  34. data/test/rubygems/test_kernel.rb +1 -1
  35. data/test/rubygems/test_project_sanity.rb +32 -3
  36. data/test/rubygems/test_remote_fetch_error.rb +1 -1
  37. data/test/rubygems/utilities.rb +8 -3
  38. metadata +3 -4
  39. data/bundler/lib/bundler/incomplete_specification.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0ce67a665c26fdc475dafc0858072799332dc0b01b57143bd46a25bd3d07c8d
4
- data.tar.gz: 88d69d29ecde40e8ca5112f6ee1d706a66c7819842902a0515b322eeff6187f8
3
+ metadata.gz: 7b282bb00b57945e0f0754620e2748128cd209c4babfd48a99b65cd4b3a49453
4
+ data.tar.gz: c0eff9cc6ff4ab163302bd9157a18ba0da4ff1bbf3a3c739f5e2cae74b5d82c5
5
5
  SHA512:
6
- metadata.gz: fd112dabe5437ac6a58a3bbcb73bd08bbc4061cce3c9e2923fead4816bdf956eb6ce4315fb16d40fc78179939bdb516c748fdb0a7a09debad2f520599968f137
7
- data.tar.gz: 1a2ec92153d67b8d8deb53ead80c6ab7652d709cceb4ffe9d97528f1adcd0be95892e90a573a6ff305b82b5fd1ead9c48223bce93bf6d6bfe960c1bd71478629
6
+ metadata.gz: a8d6983ca3a5bc09424c7182ad4d6467bd7f3d4c464c2145e2948b5a3a8bdc2d9beebfc5a1dccbc29d214fe957fee57493361609f93828f6c90ffa6a49ff6e5a
7
+ data.tar.gz: f625b38ddc0dfa4403f2e643a12b300f94fc373c2ba108f21c5be468229aef1bec8f6e31a49061284cd102d22cd15e53b26a71f9ca8af983496317659a4b696a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 3.4.11 / 2023-04-10
2
+
3
+ ## Enhancements:
4
+
5
+ * Installs bundler 2.4.11 as a default gem.
6
+
7
+ # 3.4.10 / 2023-03-27
8
+
9
+ ## Enhancements:
10
+
11
+ * Installs bundler 2.4.10 as a default gem.
12
+
1
13
  # 3.4.9 / 2023-03-20
2
14
 
3
15
  ## Enhancements:
@@ -510,7 +522,7 @@
510
522
  ## Breaking changes:
511
523
 
512
524
  * Removed deprecated `gem server` command. Pull request [#5034](https://github.com/rubygems/rubygems/pull/5034) by hsbt
513
- * Remove MacOS specific gem layout. Pull request [#4833](https://github.com/rubygems/rubygems/pull/4833) by deivid-rodriguez
525
+ * Remove macOS specific gem layout. Pull request [#4833](https://github.com/rubygems/rubygems/pull/4833) by deivid-rodriguez
514
526
  * Default `gem update` documentation format is now only `ri`. Pull request
515
527
  [#3888](https://github.com/rubygems/rubygems/pull/3888) by hsbt
516
528
 
data/Manifest.txt CHANGED
@@ -80,7 +80,6 @@ bundler/lib/bundler/gem_helpers.rb
80
80
  bundler/lib/bundler/gem_tasks.rb
81
81
  bundler/lib/bundler/gem_version_promoter.rb
82
82
  bundler/lib/bundler/graph.rb
83
- bundler/lib/bundler/incomplete_specification.rb
84
83
  bundler/lib/bundler/index.rb
85
84
  bundler/lib/bundler/injector.rb
86
85
  bundler/lib/bundler/inline.rb
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ # 2.4.11 (April 10, 2023)
2
+
3
+ ## Security:
4
+
5
+ - Use URI-0.12.1 (safe against CVE-2023-28755 ReDoS vulnerability) [#6558](https://github.com/rubygems/rubygems/pull/6558)
6
+
7
+ ## Enhancements:
8
+
9
+ - Remove one fallback to full indexes on big gemfiles [#6578](https://github.com/rubygems/rubygems/pull/6578)
10
+ - Generate native gems with `-fvisibility=hidden` [#6541](https://github.com/rubygems/rubygems/pull/6541)
11
+
12
+ ## Bug fixes:
13
+
14
+ - Fix resolver hangs when dealing with an incomplete lockfile [#6552](https://github.com/rubygems/rubygems/pull/6552)
15
+ - Fix prereleases not being considered by gem version promoter when there's no lockfile [#6537](https://github.com/rubygems/rubygems/pull/6537)
16
+
17
+ # 2.4.10 (March 27, 2023)
18
+
19
+ ## Bug fixes:
20
+
21
+ - Fix some unnecessary top level dependency downgrades [#6535](https://github.com/rubygems/rubygems/pull/6535)
22
+ - Fix incorrect ruby platform removal from lockfile when adding Gemfile dependencies [#6540](https://github.com/rubygems/rubygems/pull/6540)
23
+ - Fix installing plugins in frozen mode [#6543](https://github.com/rubygems/rubygems/pull/6543)
24
+ - Restore "enumerability" of `SpecSet` [#6532](https://github.com/rubygems/rubygems/pull/6532)
25
+
1
26
  # 2.4.9 (March 20, 2023)
2
27
 
3
28
  ## Security:
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2023-03-20".freeze
8
- @git_commit_sha = "6f8e92bcc6".freeze
7
+ @built_at = "2023-04-10".freeze
8
+ @git_commit_sha = "be1d1b4623".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -668,9 +668,17 @@ module Bundler
668
668
  def check_missing_lockfile_specs
669
669
  all_locked_specs = @locked_specs.map(&:name) << "bundler"
670
670
 
671
- @locked_specs.any? do |s|
671
+ missing = @locked_specs.select do |s|
672
672
  s.dependencies.any? {|dep| !all_locked_specs.include?(dep.name) }
673
673
  end
674
+
675
+ if missing.any?
676
+ @locked_specs.delete(missing)
677
+
678
+ true
679
+ else
680
+ false
681
+ end
674
682
  end
675
683
 
676
684
  def converge_paths
@@ -726,6 +734,8 @@ module Bundler
726
734
  dep.source = sources.get(dep.source)
727
735
  end
728
736
 
737
+ next if unlocking?
738
+
729
739
  unless locked_dep = @locked_deps[dep.name]
730
740
  changes = true
731
741
  next
@@ -886,8 +896,9 @@ module Bundler
886
896
  end
887
897
 
888
898
  def additional_base_requirements_for_resolve(resolution_packages, last_resolve)
889
- return resolution_packages unless @locked_gems && unlocking? && !sources.expired_sources?(@locked_gems.sources)
899
+ return resolution_packages unless @locked_gems && !sources.expired_sources?(@locked_gems.sources)
890
900
  converge_specs(@originally_locked_specs - last_resolve).each do |locked_spec|
901
+ next if locked_spec.source.is_a?(Source::Path)
891
902
  resolution_packages.base_requirements[locked_spec.name] = Gem::Requirement.new(">= #{locked_spec.version}")
892
903
  end
893
904
  resolution_packages
@@ -898,6 +909,7 @@ module Bundler
898
909
  Bundler.local_platform == Gem::Platform::RUBY ||
899
910
  !platforms.include?(Gem::Platform::RUBY) ||
900
911
  (@new_platform && platforms.last == Gem::Platform::RUBY) ||
912
+ @dependency_changes ||
901
913
  !@originally_locked_specs.incomplete_ruby_specs?(dependencies)
902
914
 
903
915
  remove_platform(Gem::Platform::RUBY)
@@ -93,7 +93,7 @@ module Bundler
93
93
  locked_version = package.locked_version
94
94
 
95
95
  result = specs.sort do |a, b|
96
- unless locked_version && (package.prerelease_specified? || pre?)
96
+ unless package.prerelease_specified? || pre?
97
97
  a_pre = a.prerelease?
98
98
  b_pre = b.prerelease?
99
99
 
@@ -122,7 +122,7 @@ module Bundler
122
122
  end
123
123
 
124
124
  def to_s
125
- @__to_s ||= if platform == Gem::Platform::RUBY
125
+ @to_s ||= if platform == Gem::Platform::RUBY
126
126
  "#{name} (#{version})"
127
127
  else
128
128
  "#{name} (#{version}-#{platform})"
@@ -83,8 +83,11 @@ module Bundler
83
83
 
84
84
  Bundler.configure_gem_home_and_path(Plugin.root)
85
85
 
86
- definition = Definition.new(nil, deps, source_list, true)
87
- install_definition(definition)
86
+ Bundler.settings.temporary(:deployment => false, :frozen => false) do
87
+ definition = Definition.new(nil, deps, source_list, true)
88
+
89
+ install_definition(definition)
90
+ end
88
91
  end
89
92
 
90
93
  # Installs the plugins and deps from the provided specs and returns map of
@@ -34,12 +34,8 @@ module Bundler
34
34
  @base[name]
35
35
  end
36
36
 
37
- def delete(incomplete_specs)
38
- incomplete_specs.each do |incomplete_spec|
39
- incomplete_spec.partially_complete_specs.each do |spec|
40
- @base.delete(spec)
41
- end
42
- end
37
+ def delete(specs)
38
+ @base.delete(specs)
43
39
  end
44
40
 
45
41
  def get_package(name)
@@ -51,10 +47,18 @@ module Bundler
51
47
  end
52
48
 
53
49
  def unlock_names(names)
54
- names.each do |name|
55
- @base.delete_by_name(name)
50
+ indirect_pins = indirect_pins(names)
56
51
 
57
- @base_requirements.delete(name)
52
+ if indirect_pins.any?
53
+ loosen_names(indirect_pins)
54
+ else
55
+ pins = pins(names)
56
+
57
+ if pins.any?
58
+ loosen_names(pins)
59
+ else
60
+ unrestrict_names(names)
61
+ end
58
62
  end
59
63
  end
60
64
 
@@ -66,6 +70,30 @@ module Bundler
66
70
 
67
71
  private
68
72
 
73
+ def indirect_pins(names)
74
+ names.select {|name| @base_requirements[name].exact? && @requirements.none? {|dep| dep.name == name } }
75
+ end
76
+
77
+ def pins(names)
78
+ names.select {|name| @base_requirements[name].exact? }
79
+ end
80
+
81
+ def loosen_names(names)
82
+ names.each do |name|
83
+ version = @base_requirements[name].requirements.first[1]
84
+
85
+ @base_requirements[name] = Gem::Requirement.new(">= #{version}")
86
+
87
+ @base.delete_by_name(name)
88
+ end
89
+ end
90
+
91
+ def unrestrict_names(names)
92
+ names.each do |name|
93
+ @base_requirements.delete(name)
94
+ end
95
+ end
96
+
69
97
  def build_base_requirements
70
98
  base_requirements = {}
71
99
  @base.each do |ls|
@@ -107,7 +107,7 @@ module Bundler
107
107
  ruby_engine_version = RUBY_ENGINE == "ruby" ? ruby_version : RUBY_ENGINE_VERSION.dup
108
108
  patchlevel = RUBY_PATCHLEVEL.to_s
109
109
 
110
- @ruby_version ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
110
+ @system ||= RubyVersion.new(ruby_version, patchlevel, ruby_engine, ruby_engine_version)
111
111
  end
112
112
 
113
113
  private
@@ -66,7 +66,9 @@ module Gem
66
66
 
67
67
  alias_method :rg_extension_dir, :extension_dir
68
68
  def extension_dir
69
- @bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
69
+ # following instance variable is already used in original method
70
+ # and that is the reason to prefix it with bundler_ and add rubocop exception
71
+ @bundler_extension_dir ||= if source.respond_to?(:extension_dir_name) # rubocop:disable Naming/MemoizedInstanceVariableName
70
72
  unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
71
73
  File.expand_path(File.join(extensions_dir, unique_extension_dir))
72
74
  else
@@ -203,9 +205,9 @@ module Gem
203
205
  protected
204
206
 
205
207
  def _requirements_sorted?
206
- return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
208
+ return @_requirements_sorted if defined?(@_requirements_sorted)
207
209
  strings = as_list
208
- @_are_requirements_sorted = strings == strings.sort
210
+ @_requirements_sorted = strings == strings.sort
209
211
  end
210
212
 
211
213
  def _with_sorted_requirements
@@ -7,8 +7,6 @@ module Bundler
7
7
  class Rubygems < Source
8
8
  autoload :Remote, File.expand_path("rubygems/remote", __dir__)
9
9
 
10
- # Use the API when installing less than X gems
11
- API_REQUEST_LIMIT = 500
12
10
  # Ask for X gems per API request
13
11
  API_REQUEST_SIZE = 50
14
12
 
@@ -401,12 +399,11 @@ module Bundler
401
399
  # gather lists from non-api sites
402
400
  fetch_names(index_fetchers, nil, idx, false)
403
401
 
404
- # because ensuring we have all the gems we need involves downloading
405
- # the gemspecs of those gems, if the non-api sites contain more than
406
- # about 500 gems, we treat all sites as non-api for speed.
407
- allow_api = idx.size < API_REQUEST_LIMIT && dependency_names.size < API_REQUEST_LIMIT
408
- Bundler.ui.debug "Need to query more than #{API_REQUEST_LIMIT} gems." \
409
- " Downloading full index instead..." unless allow_api
402
+ # legacy multi-remote sources need special logic to figure out
403
+ # dependency names and that logic can be very costly if one remote
404
+ # uses the dependency API but others don't. So use full indexes
405
+ # consistently in that particular case.
406
+ allow_api = !multiple_remotes?
410
407
 
411
408
  fetch_names(api_fetchers, allow_api && dependency_names, idx, false)
412
409
  end
@@ -7,8 +7,11 @@ module Bundler
7
7
  include Enumerable
8
8
  include TSort
9
9
 
10
- def initialize(specs)
10
+ attr_reader :incomplete_specs
11
+
12
+ def initialize(specs, incomplete_specs = [])
11
13
  @specs = specs
14
+ @incomplete_specs = incomplete_specs
12
15
  end
13
16
 
14
17
  def for(dependencies, check = false, platforms = [nil])
@@ -42,7 +45,7 @@ module Bundler
42
45
  end
43
46
 
44
47
  if incomplete && check
45
- specs << IncompleteSpecification.new(name, lookup[name])
48
+ @incomplete_specs += lookup[name].any? ? lookup[name] : [LazySpecification.new(name, nil, nil)]
46
49
  end
47
50
  end
48
51
 
@@ -60,8 +63,8 @@ module Bundler
60
63
  @sorted = nil
61
64
  end
62
65
 
63
- def delete(spec)
64
- @specs.delete(spec)
66
+ def delete(specs)
67
+ specs.each {|spec| @specs.delete(spec) }
65
68
  @lookup = nil
66
69
  @sorted = nil
67
70
  end
@@ -78,10 +81,10 @@ module Bundler
78
81
  lookup.dup
79
82
  end
80
83
 
81
- def materialize(deps, platforms = [nil])
82
- materialized = self.for(deps, true, platforms)
84
+ def materialize(deps)
85
+ materialized = self.for(deps, true)
83
86
 
84
- SpecSet.new(materialized)
87
+ SpecSet.new(materialized, incomplete_specs)
85
88
  end
86
89
 
87
90
  # Materialize for all the specs in the spec set, regardless of what platform they're for
@@ -100,17 +103,17 @@ module Bundler
100
103
  def incomplete_ruby_specs?(deps)
101
104
  return false if @specs.empty?
102
105
 
103
- materialize(deps, [Gem::Platform::RUBY]).incomplete_specs.any?
106
+ @incomplete_specs = []
107
+
108
+ self.for(deps, true, [Gem::Platform::RUBY])
109
+
110
+ @incomplete_specs.any?
104
111
  end
105
112
 
106
113
  def missing_specs
107
114
  @specs.select {|s| s.is_a?(LazySpecification) }
108
115
  end
109
116
 
110
- def incomplete_specs
111
- @specs.select {|s| s.is_a?(IncompleteSpecification) }
112
- end
113
-
114
117
  def merge(set)
115
118
  arr = sorted.dup
116
119
  set.each do |set_spec|
@@ -2,4 +2,9 @@
2
2
 
3
3
  require "mkmf"
4
4
 
5
+ # Makes all symbols private by default to avoid unintended conflict
6
+ # with other gems. To explicitly export symbols you can use RUBY_FUNC_EXPORTED
7
+ # selectively, or entirely remove this flag.
8
+ append_cflags("-fvisibility=hidden")
9
+
5
10
  create_makefile(<%= config[:makefile_path].inspect %>)
@@ -2,7 +2,7 @@
2
2
 
3
3
  VALUE rb_m<%= config[:constant_array].join %>;
4
4
 
5
- void
5
+ RUBY_FUNC_EXPORTED void
6
6
  Init_<%= config[:underscored_name] %>(void)
7
7
  {
8
8
  rb_m<%= config[:constant_array].join %> = rb_define_module(<%= config[:constant_name].inspect %>);
@@ -2,8 +2,8 @@
2
2
  module Bundler::URI
3
3
  class RFC3986_Parser # :nodoc:
4
4
  # Bundler::URI defined in RFC3986
5
- RFC3986_URI = /\A(?<Bundler::URI>(?<scheme>[A-Za-z][+\-.0-9A-Za-z]*):(?<hier-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:)?\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])*))(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-rootless>\g<segment-nz>(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>[^#]*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
6
- RFC3986_relative_ref = /\A(?<relative-ref>(?<relative-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:){,1}\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h+\.[!$&-.0-;=A-Z_a-z~]+))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])+))?(?::(?<port>\d*))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*))*)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])+)(?:\/\g<segment>)*)?)|(?<path-noscheme>(?<segment-nz-nc>(?:%\h\h|[!$&-.0-9;=@-Z_a-z~])+)(?:\/\g<segment>)*)|(?<path-empty>))(?:\?(?<query>[^#]*))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*))?)\z/
5
+ RFC3986_URI = /\A(?<Bundler::URI>(?<scheme>[A-Za-z][+\-.0-9A-Za-z]*+):(?<hier-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*+)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:)?\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h++\.[!$&-.0-;=A-Z_a-z~]++))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])*+))(?::(?<port>\d*+))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*+))*+)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])++)(?:\/\g<segment>)*+)?)|(?<path-rootless>\g<segment-nz>(?:\/\g<segment>)*+)|(?<path-empty>))(?:\?(?<query>[^#]*+))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*+))?)\z/
6
+ RFC3986_relative_ref = /\A(?<relative-ref>(?<relative-part>\/\/(?<authority>(?:(?<userinfo>(?:%\h\h|[!$&-.0-;=A-Z_a-z~])*+)@)?(?<host>(?<IP-literal>\[(?:(?<IPv6address>(?:\h{1,4}:){6}(?<ls32>\h{1,4}:\h{1,4}|(?<IPv4address>(?<dec-octet>[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]|\d)\.\g<dec-octet>\.\g<dec-octet>\.\g<dec-octet>))|::(?:\h{1,4}:){5}\g<ls32>|\h{1,4}?::(?:\h{1,4}:){4}\g<ls32>|(?:(?:\h{1,4}:){,1}\h{1,4})?::(?:\h{1,4}:){3}\g<ls32>|(?:(?:\h{1,4}:){,2}\h{1,4})?::(?:\h{1,4}:){2}\g<ls32>|(?:(?:\h{1,4}:){,3}\h{1,4})?::\h{1,4}:\g<ls32>|(?:(?:\h{1,4}:){,4}\h{1,4})?::\g<ls32>|(?:(?:\h{1,4}:){,5}\h{1,4})?::\h{1,4}|(?:(?:\h{1,4}:){,6}\h{1,4})?::)|(?<IPvFuture>v\h++\.[!$&-.0-;=A-Z_a-z~]++))\])|\g<IPv4address>|(?<reg-name>(?:%\h\h|[!$&-.0-9;=A-Z_a-z~])++))?(?::(?<port>\d*+))?)(?<path-abempty>(?:\/(?<segment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*+))*+)|(?<path-absolute>\/(?:(?<segment-nz>(?:%\h\h|[!$&-.0-;=@-Z_a-z~])++)(?:\/\g<segment>)*+)?)|(?<path-noscheme>(?<segment-nz-nc>(?:%\h\h|[!$&-.0-9;=@-Z_a-z~])++)(?:\/\g<segment>)*+)|(?<path-empty>))(?:\?(?<query>[^#]*+))?(?:\#(?<fragment>(?:%\h\h|[!$&-.0-;=@-Z_a-z~\/?])*+))?)\z/
7
7
  attr_reader :regexp
8
8
 
9
9
  def initialize
@@ -1,6 +1,6 @@
1
1
  module Bundler::URI
2
2
  # :stopdoc:
3
- VERSION_CODE = '001200'.freeze
3
+ VERSION_CODE = '001201'.freeze
4
4
  VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
5
5
  # :startdoc:
6
6
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.4.9".freeze
4
+ VERSION = "2.4.11".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -62,7 +62,6 @@ module Bundler
62
62
  autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
63
63
  autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
64
64
  autoload :Graph, File.expand_path("bundler/graph", __dir__)
65
- autoload :IncompleteSpecification, File.expand_path("bundler/incomplete_specification", __dir__)
66
65
  autoload :Index, File.expand_path("bundler/index", __dir__)
67
66
  autoload :Injector, File.expand_path("bundler/injector", __dir__)
68
67
  autoload :Installer, File.expand_path("bundler/installer", __dir__)
@@ -90,7 +89,7 @@ module Bundler
90
89
 
91
90
  class << self
92
91
  def configure
93
- @configured ||= configure_gem_home_and_path
92
+ @configure ||= configure_gem_home_and_path
94
93
  end
95
94
 
96
95
  def ui
@@ -582,7 +581,7 @@ EOF
582
581
  @bin_path = nil
583
582
  @bundler_major_version = nil
584
583
  @bundle_path = nil
585
- @configured = nil
584
+ @configure = nil
586
585
  @configured_bundle_path = nil
587
586
  @definition = nil
588
587
  @load = nil
@@ -83,7 +83,7 @@ class Gem::CommandManager
83
83
  # Return the authoritative instance of the command manager.
84
84
 
85
85
  def self.instance
86
- @command_manager ||= new
86
+ @instance ||= new
87
87
  end
88
88
 
89
89
  ##
@@ -98,7 +98,7 @@ class Gem::CommandManager
98
98
  # Reset the authoritative instance of the command manager.
99
99
 
100
100
  def self.reset
101
- @command_manager = nil
101
+ @instance = nil
102
102
  end
103
103
 
104
104
  ##
@@ -388,7 +388,7 @@ class Gem::Installer
388
388
  # we'll be installing into.
389
389
 
390
390
  def installed_specs
391
- @specs ||= begin
391
+ @installed_specs ||= begin
392
392
  specs = []
393
393
 
394
394
  Gem::Util.glob_files_in_dir("*.gemspec", File.join(gem_home, "specifications")).each do |path|
@@ -107,7 +107,7 @@ class Gem::RequestSet
107
107
  @requests = []
108
108
  @sets = []
109
109
  @soft_missing = false
110
- @sorted = nil
110
+ @sorted_requests = nil
111
111
  @specs = nil
112
112
  @vendor_set = nil
113
113
  @source_set = nil
@@ -424,7 +424,7 @@ class Gem::RequestSet
424
424
  end
425
425
 
426
426
  def sorted_requests
427
- @sorted ||= strongly_connected_components.flatten
427
+ @sorted_requests ||= strongly_connected_components.flatten
428
428
  end
429
429
 
430
430
  def specs
@@ -2233,7 +2233,7 @@ class Gem::Specification < Gem::BasicSpecification
2233
2233
  # The platform this gem runs on. See Gem::Platform for details.
2234
2234
 
2235
2235
  def platform
2236
- @new_platform ||= Gem::Platform::RUBY
2236
+ @new_platform ||= Gem::Platform::RUBY # rubocop:disable Naming/MemoizedInstanceVariableName
2237
2237
  end
2238
2238
 
2239
2239
  def pretty_print(q) # :nodoc:
@@ -2712,6 +2712,8 @@ class Gem::Specification < Gem::BasicSpecification
2712
2712
  end
2713
2713
 
2714
2714
  @installed_by_version ||= nil
2715
+
2716
+ nil
2715
2717
  end
2716
2718
 
2717
2719
  def flatten_require_paths # :nodoc:
@@ -183,7 +183,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
183
183
  ##
184
184
  # The full Gem::Specification for this gem, loaded from evalling its gemspec
185
185
 
186
- def to_spec
186
+ def spec
187
187
  @spec ||= if @data
188
188
  loaded = Gem.loaded_specs[name]
189
189
  loaded if loaded && loaded.version == version
@@ -191,6 +191,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
191
191
 
192
192
  @spec ||= Gem::Specification.load(loaded_from)
193
193
  end
194
+ alias_method :to_spec, :spec
194
195
 
195
196
  ##
196
197
  # Is this StubSpecification valid? i.e. have we found a stub line, OR does
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require "rbconfig"
9
9
 
10
10
  module Gem
11
- VERSION = "3.4.9"
11
+ VERSION = "3.4.11"
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.4.9"
5
+ s.version = "3.4.11"
6
6
  s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
7
7
  s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
8
8
 
@@ -1179,6 +1179,20 @@ Also, a list:
1179
1179
  RUBY_PLATFORM.match("mswin")
1180
1180
  end
1181
1181
 
1182
+ ##
1183
+ # Is this test being run on a version of Ruby built with mingw?
1184
+
1185
+ def self.mingw_windows?
1186
+ RUBY_PLATFORM.match("mingw")
1187
+ end
1188
+
1189
+ ##
1190
+ # Is this test being run on a version of Ruby built with mingw?
1191
+
1192
+ def mingw_windows?
1193
+ RUBY_PLATFORM.match("mingw")
1194
+ end
1195
+
1182
1196
  ##
1183
1197
  # Is this test being run on a ruby/ruby repository?
1184
1198
  #
@@ -14,7 +14,7 @@ require "rubygems/request"
14
14
  # The tested hosts are explained in detail here: https://github.com/rubygems/rubygems/commit/5e16a5428f973667cabfa07e94ff939e7a83ebd9
15
15
  #
16
16
 
17
- class TestBundledCA < Gem::TestCase
17
+ class TestGemBundledCA < Gem::TestCase
18
18
  def bundled_certificate_store
19
19
  store = OpenSSL::X509::Store.new
20
20
 
@@ -3,7 +3,7 @@ require_relative "helper"
3
3
  require "rubygems"
4
4
  require "shellwords"
5
5
 
6
- class TestConfig < Gem::TestCase
6
+ class TestGemConfig < Gem::TestCase
7
7
  def test_datadir
8
8
  util_make_gems
9
9
  spec = Gem::Specification.find_by_name("a")
@@ -2,7 +2,7 @@
2
2
  require_relative "helper"
3
3
  require "rubygems/deprecate"
4
4
 
5
- class TestDeprecate < Gem::TestCase
5
+ class TestGemDeprecate < Gem::TestCase
6
6
  def setup
7
7
  super
8
8
 
@@ -3,7 +3,7 @@
3
3
  require_relative "helper"
4
4
  require "rubygems"
5
5
 
6
- class TestExit < Gem::TestCase
6
+ class TestGemExit < Gem::TestCase
7
7
  def test_exit
8
8
  system(*ruby_with_rubygems_in_load_path, "-e", "raise Gem::SystemExitException.new(2)")
9
9
  assert_equal 2, $?.exitstatus
@@ -87,7 +87,7 @@ class TestGemExtCargoBuilder < Gem::TestCase
87
87
  end
88
88
  end
89
89
 
90
- assert_match /cargo\s.*\sfailed/, error.message
90
+ assert_match(/cargo\s.*\sfailed/, error.message)
91
91
  end
92
92
 
93
93
  def test_full_integration
@@ -145,6 +145,7 @@ class TestGemExtCargoBuilder < Gem::TestCase
145
145
  system(@rust_envs, "cargo", "-V", out: IO::NULL, err: [:child, :out])
146
146
  pend "cargo not present" unless $?.success?
147
147
  pend "ruby.h is not provided by ruby repo" if ruby_repo?
148
+ pend "rust toolchain of mingw is broken" if mingw_windows?
148
149
  end
149
150
 
150
151
  def assert_ffi_handle(bundle, name)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require_relative "helper"
3
3
 
4
- class TestKernel < Gem::TestCase
4
+ class TestGemKernel < Gem::TestCase
5
5
  def setup
6
6
  super
7
7
 
@@ -3,13 +3,36 @@
3
3
  require_relative "helper"
4
4
  require "open3"
5
5
 
6
- class TestProjectSanity < Gem::TestCase
6
+ class TestGemProjectSanity < Gem::TestCase
7
+ def setup
8
+ end
9
+
10
+ def teardown
11
+ end
12
+
7
13
  def test_manifest_is_up_to_date
8
- pend unless File.exist?(File.expand_path("../../Rakefile", __dir__))
14
+ pend unless File.exist?("#{root}/Rakefile")
9
15
 
10
16
  _, status = Open3.capture2e("rake check_manifest")
11
17
 
12
- assert status.success?, "Expected Manifest.txt to be up to date, but it's not. Run `rake update_manifest` to sync it."
18
+ unless status.success?
19
+ original_contents = File.read("#{root}/Manifest.txt")
20
+
21
+ # Update the manifest to see if it fixes the problem
22
+ Open3.capture2e("rake update_manifest")
23
+
24
+ out, status = Open3.capture2e("rake check_manifest")
25
+
26
+ # If `rake update_manifest` fixed the problem, that was the original
27
+ # issue, otherwise it was an unknown error, so print the error output
28
+ if status.success?
29
+ File.write("#{root}/Manifest.txt", original_contents)
30
+
31
+ raise "Expected Manifest.txt to be up to date, but it's not. Run `rake update_manifest` to sync it."
32
+ else
33
+ raise "There was an error running `rake check_manifest`: #{out}"
34
+ end
35
+ end
13
36
  end
14
37
 
15
38
  def test_require_rubygems_package
@@ -17,4 +40,10 @@ class TestProjectSanity < Gem::TestCase
17
40
 
18
41
  assert status.success?, err
19
42
  end
43
+
44
+ private
45
+
46
+ def root
47
+ File.expand_path("../..", __dir__)
48
+ end
20
49
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require_relative "helper"
3
3
 
4
- class TestRemoteFetchError < Gem::TestCase
4
+ class TestGemRemoteFetchError < Gem::TestCase
5
5
  def test_password_redacted
6
6
  error = Gem::RemoteFetcher::FetchError.new("There was an error fetching", "https://user:secret@gemsource.org")
7
7
  refute_match %r{secret}, error.to_s
@@ -167,7 +167,7 @@ end
167
167
  #
168
168
  # Example:
169
169
  #
170
- # HTTPResponseFactory.create(
170
+ # Gem::HTTPResponseFactory.create(
171
171
  # body: "",
172
172
  # code: 301,
173
173
  # msg: "Moved Permanently",
@@ -175,7 +175,7 @@ end
175
175
  # )
176
176
  #
177
177
 
178
- class HTTPResponseFactory
178
+ class Gem::HTTPResponseFactory
179
179
  def self.create(body:, code:, msg:, headers: {})
180
180
  response = Net::HTTPResponse.send(:response_class, code.to_s).new("1.0", code.to_s, msg)
181
181
  response.instance_variable_set(:@body, body)
@@ -372,7 +372,7 @@ end
372
372
  #
373
373
  # This class was added to flush out problems in Rubinius' IO implementation.
374
374
 
375
- class TempIO < Tempfile
375
+ class Gem::TempIO < Tempfile
376
376
  ##
377
377
  # Creates a new TempIO that will be initialized to contain +string+.
378
378
 
@@ -391,3 +391,8 @@ class TempIO < Tempfile
391
391
  Gem.read_binary path
392
392
  end
393
393
  end
394
+
395
+ class Gem::TestCase
396
+ TempIO = Gem::TempIO
397
+ HTTPResponseFactory = Gem::HTTPResponseFactory
398
+ end
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.4.9
4
+ version: 3.4.11
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: 2023-03-20 00:00:00.000000000 Z
19
+ date: 2023-04-10 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
@@ -136,7 +136,6 @@ files:
136
136
  - bundler/lib/bundler/gem_tasks.rb
137
137
  - bundler/lib/bundler/gem_version_promoter.rb
138
138
  - bundler/lib/bundler/graph.rb
139
- - bundler/lib/bundler/incomplete_specification.rb
140
139
  - bundler/lib/bundler/index.rb
141
140
  - bundler/lib/bundler/injector.rb
142
141
  - bundler/lib/bundler/inline.rb
@@ -837,7 +836,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
837
836
  - !ruby/object:Gem::Version
838
837
  version: '0'
839
838
  requirements: []
840
- rubygems_version: 3.4.9
839
+ rubygems_version: 3.4.11
841
840
  signing_key:
842
841
  specification_version: 4
843
842
  summary: RubyGems is a package management framework for Ruby.
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bundler
4
- #
5
- # Represents a package name that was found to be incomplete when trying to
6
- # materialize a fresh resolution or the lockfile.
7
- #
8
- # Holds the actual partially complete set of specifications for the name.
9
- # These are used so that they can be unlocked in a future resolution, and fix
10
- # the situation.
11
- #
12
- class IncompleteSpecification
13
- attr_reader :name, :partially_complete_specs
14
-
15
- def initialize(name, partially_complete_specs = [])
16
- @name = name
17
- @partially_complete_specs = partially_complete_specs
18
- end
19
-
20
- def ==(other)
21
- partially_complete_specs == other.partially_complete_specs
22
- end
23
- end
24
- end