rubygems-update 3.5.20 → 3.5.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b333e62d8d40ff14565906d7d6eeebc3528d75a867bb55976b8e0af689041de
4
- data.tar.gz: b02067c1f5d373b50050680c8c5f30a37755687bcffbaf97af74ffa22ea2002b
3
+ metadata.gz: b93fb693eb681ac96e283d9cbeaa13d051f7aad74a1c5345efdb2f3197bc3ffa
4
+ data.tar.gz: 891fe98e7164fd5e684ea15055f56ebeb041e9c316ba0528cb08346aa26032b8
5
5
  SHA512:
6
- metadata.gz: 301d3005afa49dc6123b57f592feb69ba519c5844794df524a2193a2cf9ee30e347ff0336063c20e945e96fa0aa04390790d1d166980dfc25deffc2fa8328ed5
7
- data.tar.gz: 68bdf50470713768ff3baa8a9a9e13f249d6580d73d0cb95c63d2f791e0391eb9e5940c51c36262b852ed2f1f98b2784a5d724d98de2702b4433460acff542b8
6
+ metadata.gz: 40183fff5ed0fc360dd8399691277c6f13f179d8bccadbc07d5008c189b63ed3b4eb7987214230f7cd720fbc9bbcae548fc14b5b6caddf635730c8f206651acb
7
+ data.tar.gz: 01cb679ca372d6856e928f71da3a991acd9f27cf526d1b650e33ccec7aa8d09ece5a2ff8a5dcbb02f11a7fa2923ee25042e2da52b42c452adc34c98770c1951b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # 3.5.21 / 2024-10-03
2
+
3
+ ## Enhancements:
4
+
5
+ * Fix `Gem::MissingSpecVersionError#to_s` not showing exception message.
6
+ Pull request [#8074](https://github.com/rubygems/rubygems/pull/8074) by
7
+ deivid-rodriguez
8
+ * Remove code that makes suggest_gems_from_name give worse results. Pull
9
+ request [#8083](https://github.com/rubygems/rubygems/pull/8083) by
10
+ duckinator
11
+ * Warning about PATH in `--user-install` mode is only necessary for gems
12
+ with executables. Pull request
13
+ [#8071](https://github.com/rubygems/rubygems/pull/8071) by
14
+ deivid-rodriguez
15
+ * Installs bundler 2.5.21 as a default gem.
16
+
17
+ ## Bug fixes:
18
+
19
+ * Fix error in one source when fetching dependency APIs clearing results
20
+ from all sources. Pull request
21
+ [#8080](https://github.com/rubygems/rubygems/pull/8080) by
22
+ deivid-rodriguez
23
+ * Fix `gem cleanup` warning when two versions of psych installed. Pull
24
+ request [#8072](https://github.com/rubygems/rubygems/pull/8072) by
25
+ deivid-rodriguez
26
+
1
27
  # 3.5.20 / 2024-09-24
2
28
 
3
29
  ## Enhancements:
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 2.5.21 (October 3, 2024)
2
+
3
+ ## Bug fixes:
4
+
5
+ - Fix bug report template printed when changing a path source to a git source in frozen mode [#8079](https://github.com/rubygems/rubygems/pull/8079)
6
+ - Fix `stub.activated?` sometimes returning false after activation under bundler [#8073](https://github.com/rubygems/rubygems/pull/8073)
7
+ - Fix old cache format detection when application is not source controlled [#8076](https://github.com/rubygems/rubygems/pull/8076)
8
+ - Fix `bundler/inline` resetting ENV changes [#8059](https://github.com/rubygems/rubygems/pull/8059)
9
+
1
10
  # 2.5.20 (September 24, 2024)
2
11
 
3
12
  ## Enhancements:
@@ -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 = "2024-09-24".freeze
8
- @git_commit_sha = "a0fc99594a".freeze
7
+ @built_at = "2024-10-03".freeze
8
+ @git_commit_sha = "5cc66a2380b".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -39,7 +39,11 @@ def gemfile(install = false, options = {}, &gemfile)
39
39
  Bundler.ui = ui
40
40
  raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
41
41
 
42
- Bundler.with_unbundled_env do
42
+ old_gemfile = ENV["BUNDLE_GEMFILE"]
43
+
44
+ Bundler.unbundle_env!
45
+
46
+ begin
43
47
  Bundler.instance_variable_set(:@bundle_path, Pathname.new(Gem.dir))
44
48
  Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
45
49
 
@@ -80,9 +84,11 @@ def gemfile(install = false, options = {}, &gemfile)
80
84
 
81
85
  runtime.require
82
86
  end
83
- end
84
-
85
- if ENV["BUNDLE_GEMFILE"].nil?
86
- ENV["BUNDLE_GEMFILE"] = ""
87
+ ensure
88
+ if old_gemfile
89
+ ENV["BUNDLE_GEMFILE"] = old_gemfile
90
+ else
91
+ ENV["BUNDLE_GEMFILE"] = ""
92
+ end
87
93
  end
88
94
  end
@@ -84,8 +84,10 @@ module Bundler
84
84
  end
85
85
  end
86
86
 
87
- def not_a_bare_repository?
88
- git_local("rev-parse", "--is-bare-repository", dir: path).strip == "false"
87
+ def not_a_repository?
88
+ _, status = git_null("rev-parse", "--resolve-git-dir", path.to_s, dir: path)
89
+
90
+ !status.success?
89
91
  end
90
92
 
91
93
  def contains?(commit)
@@ -191,7 +191,7 @@ module Bundler
191
191
  set_up_app_cache!(app_cache_path) if use_app_cache?
192
192
 
193
193
  if requires_checkout? && !@copied
194
- FileUtils.rm_rf(app_cache_path) if use_app_cache? && git_proxy.not_a_bare_repository?
194
+ FileUtils.rm_rf(app_cache_path) if use_app_cache? && git_proxy.not_a_repository?
195
195
 
196
196
  fetch
197
197
  checkout
@@ -53,6 +53,8 @@ module Bundler
53
53
  "source at `#{@path}`"
54
54
  end
55
55
 
56
+ alias_method :to_gemfile, :path
57
+
56
58
  def hash
57
59
  [self.class, expanded_path, version].hash
58
60
  end
@@ -45,8 +45,8 @@ module Bundler
45
45
  true
46
46
  end
47
47
 
48
- def activated
49
- stub.activated
48
+ def activated?
49
+ stub.activated?
50
50
  end
51
51
 
52
52
  def activated=(activated)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.5.20".freeze
4
+ VERSION = "2.5.21".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -383,28 +383,12 @@ module Bundler
383
383
 
384
384
  # @return [Hash] Environment with all bundler-related variables removed
385
385
  def unbundled_env
386
- env = original_env
387
-
388
- if env.key?("BUNDLER_ORIG_MANPATH")
389
- env["MANPATH"] = env["BUNDLER_ORIG_MANPATH"]
390
- end
391
-
392
- env.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
393
-
394
- if env.key?("RUBYOPT")
395
- rubyopt = env["RUBYOPT"].split(" ")
396
- rubyopt.delete("-r#{File.expand_path("bundler/setup", __dir__)}")
397
- rubyopt.delete("-rbundler/setup")
398
- env["RUBYOPT"] = rubyopt.join(" ")
399
- end
400
-
401
- if env.key?("RUBYLIB")
402
- rubylib = env["RUBYLIB"].split(File::PATH_SEPARATOR)
403
- rubylib.delete(__dir__)
404
- env["RUBYLIB"] = rubylib.join(File::PATH_SEPARATOR)
405
- end
386
+ unbundle_env(original_env)
387
+ end
406
388
 
407
- env
389
+ # Remove all bundler-related variables from ENV
390
+ def unbundle_env!
391
+ ENV.replace(unbundle_env(ENV))
408
392
  end
409
393
 
410
394
  # Run block with environment present before Bundler was activated
@@ -633,6 +617,30 @@ module Bundler
633
617
 
634
618
  private
635
619
 
620
+ def unbundle_env(env)
621
+ if env.key?("BUNDLER_ORIG_MANPATH")
622
+ env["MANPATH"] = env["BUNDLER_ORIG_MANPATH"]
623
+ end
624
+
625
+ env.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
626
+ env.delete("BUNDLER_SETUP")
627
+
628
+ if env.key?("RUBYOPT")
629
+ rubyopt = env["RUBYOPT"].split(" ")
630
+ rubyopt.delete("-r#{File.expand_path("bundler/setup", __dir__)}")
631
+ rubyopt.delete("-rbundler/setup")
632
+ env["RUBYOPT"] = rubyopt.join(" ")
633
+ end
634
+
635
+ if env.key?("RUBYLIB")
636
+ rubylib = env["RUBYLIB"].split(File::PATH_SEPARATOR)
637
+ rubylib.delete(__dir__)
638
+ env["RUBYLIB"] = rubylib.join(File::PATH_SEPARATOR)
639
+ end
640
+
641
+ env
642
+ end
643
+
636
644
  def load_marshal(data, marshal_proc: nil)
637
645
  Marshal.load(data, marshal_proc)
638
646
  rescue TypeError => e
@@ -230,18 +230,11 @@ class Gem::CommandManager
230
230
  def load_and_instantiate(command_name)
231
231
  command_name = command_name.to_s
232
232
  const_name = command_name.capitalize.gsub(/_(.)/) { $1.upcase } << "Command"
233
- load_error = nil
234
233
 
235
234
  begin
236
- begin
237
- require "rubygems/commands/#{command_name}_command"
238
- rescue LoadError => e
239
- load_error = e
240
- end
235
+ require "rubygems/commands/#{command_name}_command"
241
236
  Gem::Commands.const_get(const_name).new
242
- rescue StandardError => e
243
- e = load_error if load_error
244
-
237
+ rescue StandardError, LoadError => e
245
238
  alert_error clean_text("Loading command: #{command_name} (#{e.class})\n\t#{e}")
246
239
  ui.backtrace e
247
240
  end
@@ -38,8 +38,6 @@ class Gem::Commands::CleanupCommand < Gem::Command
38
38
  @default_gems = []
39
39
  @full = nil
40
40
  @gems_to_cleanup = nil
41
- @original_home = nil
42
- @original_path = nil
43
41
  @primary_gems = nil
44
42
  end
45
43
 
@@ -95,9 +93,6 @@ If no gems are named all gems in GEM_HOME are cleaned.
95
93
  end
96
94
 
97
95
  def clean_gems
98
- @original_home = Gem.dir
99
- @original_path = Gem.path
100
-
101
96
  get_primary_gems
102
97
  get_candidate_gems
103
98
  get_gems_to_cleanup
@@ -112,8 +107,6 @@ If no gems are named all gems in GEM_HOME are cleaned.
112
107
  deps.reverse_each do |spec|
113
108
  uninstall_dep spec
114
109
  end
115
-
116
- Gem::Specification.reset
117
110
  end
118
111
 
119
112
  def get_candidate_gems
@@ -133,7 +126,7 @@ If no gems are named all gems in GEM_HOME are cleaned.
133
126
 
134
127
  default_gems, gems_to_cleanup = gems_to_cleanup.partition(&:default_gem?)
135
128
 
136
- uninstall_from = options[:user_install] ? Gem.user_dir : @original_home
129
+ uninstall_from = options[:user_install] ? Gem.user_dir : Gem.dir
137
130
 
138
131
  gems_to_cleanup = gems_to_cleanup.select do |spec|
139
132
  spec.base_dir == uninstall_from
@@ -181,8 +174,5 @@ If no gems are named all gems in GEM_HOME are cleaned.
181
174
  say "Unable to uninstall #{spec.full_name}:"
182
175
  say "\t#{e.class}: #{e.message}"
183
176
  end
184
- ensure
185
- # Restore path Gem::Uninstaller may have changed
186
- Gem.use_paths @original_home, *@original_path
187
177
  end
188
178
  end
@@ -30,6 +30,7 @@ module Gem
30
30
  @name = name
31
31
  @requirement = requirement
32
32
  @extra_message = extra_message
33
+ super(message)
33
34
  end
34
35
 
35
36
  def message # :nodoc:
@@ -53,8 +54,8 @@ module Gem
53
54
  attr_reader :specs
54
55
 
55
56
  def initialize(name, requirement, specs)
56
- super(name, requirement)
57
57
  @specs = specs
58
+ super(name, requirement)
58
59
  end
59
60
 
60
61
  private
@@ -66,8 +66,6 @@ class Gem::Installer
66
66
 
67
67
  attr_reader :package
68
68
 
69
- @path_warning = false
70
-
71
69
  class << self
72
70
  #
73
71
  # Changes in rubygems to lazily loading `rubygems/command` (in order to
@@ -86,11 +84,6 @@ class Gem::Installer
86
84
  super(klass)
87
85
  end
88
86
 
89
- ##
90
- # True if we've warned about PATH not including Gem.bindir
91
-
92
- attr_accessor :path_warning
93
-
94
87
  ##
95
88
  # Overrides the executable format.
96
89
  #
@@ -188,15 +181,6 @@ class Gem::Installer
188
181
  @package.dir_mode = options[:dir_mode]
189
182
  @package.prog_mode = options[:prog_mode]
190
183
  @package.data_mode = options[:data_mode]
191
-
192
- if @gem_home == Gem.user_dir
193
- # If we get here, then one of the following likely happened:
194
- # - `--user-install` was specified
195
- # - `Gem::PathSupport#home` fell back to `Gem.user_dir`
196
- # - GEM_HOME was manually set to `Gem.user_dir`
197
-
198
- check_that_user_bin_dir_is_in_path
199
- end
200
184
  end
201
185
 
202
186
  ##
@@ -488,11 +472,21 @@ class Gem::Installer
488
472
  end
489
473
 
490
474
  def generate_bin # :nodoc:
491
- return if spec.executables.nil? || spec.executables.empty?
475
+ executables = spec.executables
476
+ return if executables.nil? || executables.empty?
477
+
478
+ if @gem_home == Gem.user_dir
479
+ # If we get here, then one of the following likely happened:
480
+ # - `--user-install` was specified
481
+ # - `Gem::PathSupport#home` fell back to `Gem.user_dir`
482
+ # - GEM_HOME was manually set to `Gem.user_dir`
483
+
484
+ check_that_user_bin_dir_is_in_path(executables)
485
+ end
492
486
 
493
487
  ensure_writable_dir @bin_dir
494
488
 
495
- spec.executables.each do |filename|
489
+ executables.each do |filename|
496
490
  bin_path = File.join gem_dir, spec.bindir, filename
497
491
  next unless File.exist? bin_path
498
492
 
@@ -694,9 +688,7 @@ class Gem::Installer
694
688
  end
695
689
  end
696
690
 
697
- def check_that_user_bin_dir_is_in_path # :nodoc:
698
- return if self.class.path_warning
699
-
691
+ def check_that_user_bin_dir_is_in_path(executables) # :nodoc:
700
692
  user_bin_dir = @bin_dir || Gem.bindir(gem_home)
701
693
  user_bin_dir = user_bin_dir.tr(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
702
694
 
@@ -712,8 +704,7 @@ class Gem::Installer
712
704
 
713
705
  unless path.include? user_bin_dir
714
706
  unless !Gem.win_platform? && (path.include? user_bin_dir.sub(ENV["HOME"], "~"))
715
- alert_warning "You don't have #{user_bin_dir} in your PATH,\n\t gem executables will not run."
716
- self.class.path_warning = true
707
+ alert_warning "You don't have #{user_bin_dir} in your PATH,\n\t gem executables (#{executables.join(", ")}) will not run."
717
708
  end
718
709
  end
719
710
  end
@@ -104,16 +104,21 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
104
104
  end
105
105
 
106
106
  uri = @dep_uri + name
107
- str = Gem::RemoteFetcher.fetcher.fetch_path uri
108
107
 
109
- lines(str).each do |ver|
110
- number, platform, dependencies, requirements = parse_gem(ver)
108
+ begin
109
+ str = Gem::RemoteFetcher.fetcher.fetch_path uri
110
+ rescue Gem::RemoteFetcher::FetchError
111
+ @data[name] = []
112
+ else
113
+ lines(str).each do |ver|
114
+ number, platform, dependencies, requirements = parse_gem(ver)
111
115
 
112
- platform ||= "ruby"
113
- dependencies = dependencies.map {|dep_name, reqs| [dep_name, reqs.join(", ")] }
114
- requirements = requirements.map {|req_name, reqs| [req_name.to_sym, reqs] }.to_h
116
+ platform ||= "ruby"
117
+ dependencies = dependencies.map {|dep_name, reqs| [dep_name, reqs.join(", ")] }
118
+ requirements = requirements.map {|req_name, reqs| [req_name.to_sym, reqs] }.to_h
115
119
 
116
- @data[name] << { name: name, number: number, platform: platform, dependencies: dependencies, requirements: requirements }
120
+ @data[name] << { name: name, number: number, platform: platform, dependencies: dependencies, requirements: requirements }
121
+ end
117
122
  end
118
123
 
119
124
  @data[name]
@@ -29,8 +29,6 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
29
29
  pick_sets if @remote && @sets.empty?
30
30
 
31
31
  super
32
- rescue Gem::RemoteFetcher::FetchError
33
- []
34
32
  end
35
33
 
36
34
  def prefetch(reqs) # :nodoc:
@@ -176,19 +176,12 @@ class Gem::SpecFetcher
176
176
 
177
177
  matches = names.map do |n|
178
178
  next unless n.match_platform?
179
- [n.name, 0] if n.name.downcase.tr("_-", "").include?(gem_name)
179
+ distance = levenshtein_distance gem_name, n.name.downcase.tr("_-", "")
180
+ next if distance >= max
181
+ return [n.name] if distance == 0
182
+ [n.name, distance]
180
183
  end.compact
181
184
 
182
- if matches.length < num_results
183
- matches += names.map do |n|
184
- next unless n.match_platform?
185
- distance = levenshtein_distance gem_name, n.name.downcase.tr("_-", "")
186
- next if distance >= max
187
- return [n.name] if distance == 0
188
- [n.name, distance]
189
- end.compact
190
- end
191
-
192
185
  matches = if matches.empty? && type != :prerelease
193
186
  suggest_gems_from_name gem_name, :prerelease
194
187
  else
@@ -1208,7 +1208,7 @@ class Gem::Specification < Gem::BasicSpecification
1208
1208
  unresolved.values.each do |dep|
1209
1209
  warn " #{dep}"
1210
1210
 
1211
- versions = find_all_by_name(dep.name)
1211
+ versions = find_all_by_name(dep.name).uniq(&:full_name)
1212
1212
  unless versions.empty?
1213
1213
  warn " Available/installed versions of this gem:"
1214
1214
  versions.each {|s| warn " - #{s.version}" }
@@ -1412,7 +1412,7 @@ class Gem::Specification < Gem::BasicSpecification
1412
1412
  end
1413
1413
 
1414
1414
  begin
1415
- specs = spec_dep.to_specs
1415
+ specs = spec_dep.to_specs.uniq(&:full_name)
1416
1416
  rescue Gem::MissingSpecError => e
1417
1417
  raise Gem::MissingSpecError.new(e.name, e.requirement, "at: #{spec_file}")
1418
1418
  end
data/lib/rubygems.rb CHANGED
@@ -9,7 +9,7 @@
9
9
  require "rbconfig"
10
10
 
11
11
  module Gem
12
- VERSION = "3.5.20"
12
+ VERSION = "3.5.21"
13
13
  end
14
14
 
15
15
  # 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.5.20"
5
+ s.version = "3.5.21"
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
 
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.5.20
4
+ version: 3.5.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: exe
18
18
  cert_chain: []
19
- date: 2024-09-24 00:00:00.000000000 Z
19
+ date: 2024-10-03 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
@@ -737,7 +737,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
737
737
  - !ruby/object:Gem::Version
738
738
  version: '0'
739
739
  requirements: []
740
- rubygems_version: 3.5.20
740
+ rubygems_version: 3.5.21
741
741
  signing_key:
742
742
  specification_version: 4
743
743
  summary: RubyGems is a package management framework for Ruby. This gem is downloaded