rubygems-update 3.4.12 → 3.4.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 630124afddc18f8f7cb265b5de44eca7014d434e5ea8cd6371aefe67c70ea548
4
- data.tar.gz: 5d6c95dc48dd7a700c98d000f02fc4fd24a6110ad5b4b584e80eb1d2f6a66d32
3
+ metadata.gz: 5d8a97e5b6198a831e3a4f9394870dbf6a2d53b720cfd769bf11876061199bb1
4
+ data.tar.gz: 0623b2dbd7c85370eabf89e2f908d4fbeb59ffcd725eac2bf883e0b760a9402d
5
5
  SHA512:
6
- metadata.gz: 7b48042d92e123bdd1923b74d3b3453efed7ff69096995605267f0e17d23110c3c33a7e70e288554f5088ab8ea60ffd2264007acffabc19c56b8f1a55304e31a
7
- data.tar.gz: d5d31837a2e3e200876195b3eb4ce91000ae809a867017fe8264301d045995321adc5f88a8ce30a2a1271fcb26a28d200b51b92359f841a0ed1ad309d506f18c
6
+ metadata.gz: 8a95e7a9fd03a2552b5d1c3be6529ddf8c13b352f1ba7b9079a914dd060275386a6f2fa1a47b0b68b9a2ee68b67d37a1bdf31a90d0716bd9b805d73421d579d0
7
+ data.tar.gz: 172343a13367b7973cc14f9c721b92a876cc518e00ab257d6af34424b25011053e3bfed66f16dd005f59ca5da32d5c825f6d36845d99ed14f74caf44710a2e8f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ # 3.4.14 / 2023-06-12
2
+
3
+ ## Enhancements:
4
+
5
+ * Load plugin immediately. Pull request
6
+ [#6673](https://github.com/rubygems/rubygems/pull/6673) by kou
7
+ * Installs bundler 2.4.14 as a default gem.
8
+
9
+ ## Documentation:
10
+
11
+ * Clarify what the `rubygems-update` gem is for, and link to source code
12
+ and guides. Pull request
13
+ [#6710](https://github.com/rubygems/rubygems/pull/6710) by davetron5000
14
+
15
+ # 3.4.13 / 2023-05-09
16
+
17
+ ## Enhancements:
18
+
19
+ * Installs bundler 2.4.13 as a default gem.
20
+
1
21
  # 3.4.12 / 2023-04-11
2
22
 
3
23
  ## Enhancements:
data/Manifest.txt CHANGED
@@ -180,6 +180,7 @@ bundler/lib/bundler/rubygems_ext.rb
180
180
  bundler/lib/bundler/rubygems_gem_installer.rb
181
181
  bundler/lib/bundler/rubygems_integration.rb
182
182
  bundler/lib/bundler/runtime.rb
183
+ bundler/lib/bundler/safe_marshal.rb
183
184
  bundler/lib/bundler/self_manager.rb
184
185
  bundler/lib/bundler/settings.rb
185
186
  bundler/lib/bundler/settings/validator.rb
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # 2.4.14 (June 12, 2023)
2
+
3
+ ## Enhancements:
4
+
5
+ - Stop publishing Gemfile in default gem template [#6723](https://github.com/rubygems/rubygems/pull/6723)
6
+ - Avoid infinite loops when hitting resolution bugs [#6722](https://github.com/rubygems/rubygems/pull/6722)
7
+ - Make `LockfileParser` usable with just a lockfile [#6694](https://github.com/rubygems/rubygems/pull/6694)
8
+ - Always rely on `$LOAD_PATH` when jumping from `exe/` to `lib/` [#6702](https://github.com/rubygems/rubygems/pull/6702)
9
+ - Make `frozen` setting take precedence over `deployment` setting [#6685](https://github.com/rubygems/rubygems/pull/6685)
10
+ - Show an error when trying to update bundler in frozen mode [#6684](https://github.com/rubygems/rubygems/pull/6684)
11
+
12
+ ## Bug fixes:
13
+
14
+ - Fix `deployment` vs `path` precedence [#6703](https://github.com/rubygems/rubygems/pull/6703)
15
+ - Fix inline mode with multiple sources [#6699](https://github.com/rubygems/rubygems/pull/6699)
16
+
17
+ # 2.4.13 (May 9, 2023)
18
+
19
+ ## Bug fixes:
20
+
21
+ - Fix unexpected fallbacks to full index by adding FalseClass and Time to the SafeMarshal list [#6655](https://github.com/rubygems/rubygems/pull/6655)
22
+
23
+ ## Documentation:
24
+
25
+ - Fix broken hyperlinks in bundle cache documentation [#6606](https://github.com/rubygems/rubygems/pull/6606)
26
+
1
27
  # 2.4.12 (April 11, 2023)
2
28
 
3
29
  ## Enhancements:
data/bundler/exe/bundle CHANGED
@@ -10,11 +10,11 @@ end
10
10
  base_path = File.expand_path("../lib", __dir__)
11
11
 
12
12
  if File.exist?(base_path)
13
- require_relative "../lib/bundler"
14
- else
15
- require "bundler"
13
+ $LOAD_PATH.unshift(base_path)
16
14
  end
17
15
 
16
+ require "bundler"
17
+
18
18
  if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.7.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
19
19
  Bundler.ui.warn \
20
20
  "Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
@@ -24,18 +24,10 @@ if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::V
24
24
  "and silence this warning by running `gem update --system 3.2.3`"
25
25
  end
26
26
 
27
- if File.exist?(base_path)
28
- require_relative "../lib/bundler/friendly_errors"
29
- else
30
- require "bundler/friendly_errors"
31
- end
27
+ require "bundler/friendly_errors"
32
28
 
33
29
  Bundler.with_friendly_errors do
34
- if File.exist?(base_path)
35
- require_relative "../lib/bundler/cli"
36
- else
37
- require "bundler/cli"
38
- end
30
+ require "bundler/cli"
39
31
 
40
32
  # Allow any command to use --help flag to show help for that command
41
33
  help_flags = %w[--help -h]
@@ -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-04-11".freeze
8
- @git_commit_sha = "e2cf278db1".freeze
7
+ @built_at = "2023-06-12".freeze
8
+ @git_commit_sha = "69f47cf53a".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -217,6 +217,7 @@ module Bundler
217
217
  rescue BundlerError => e
218
218
  @resolve = nil
219
219
  @resolver = nil
220
+ @resolution_packages = nil
220
221
  @specs = nil
221
222
  @gem_version_promoter = nil
222
223
 
@@ -361,10 +362,8 @@ module Bundler
361
362
  "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
362
363
 
363
364
  unless explicit_flag
364
- suggested_command = if Bundler.settings.locations("frozen").keys.&([:global, :local]).any?
365
- "bundle config unset frozen"
366
- elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
367
- "bundle config unset deployment"
365
+ suggested_command = unless Bundler.settings.locations("frozen").keys.include?(:env)
366
+ "bundle config set frozen false"
368
367
  end
369
368
  msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
370
369
  "freeze \nby running `#{suggested_command}`." if suggested_command
@@ -886,7 +885,8 @@ module Bundler
886
885
  if preserve_unknown_sections
887
886
  sections_to_ignore = LockfileParser.sections_to_ignore(@locked_bundler_version)
888
887
  sections_to_ignore += LockfileParser.unknown_sections_in_lockfile(current)
889
- sections_to_ignore += LockfileParser::ENVIRONMENT_VERSION_SECTIONS
888
+ sections_to_ignore << LockfileParser::RUBY
889
+ sections_to_ignore << LockfileParser::BUNDLED unless @unlocking_bundler
890
890
  pattern = /#{Regexp.union(sections_to_ignore)}\n(\s{2,}.*\n)+/
891
891
  whitespace_cleanup = /\n{2,}/
892
892
  current = current.gsub(pattern, "\n").gsub(whitespace_cleanup, "\n\n").strip
@@ -90,7 +90,7 @@ module Bundler
90
90
 
91
91
  Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
92
92
 
93
- lock unless Bundler.frozen_bundle?
93
+ lock
94
94
  Standalone.new(options[:standalone], @definition).generate if options[:standalone]
95
95
  end
96
96
  end
@@ -26,6 +26,7 @@ module Bundler
26
26
  KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten.freeze
27
27
 
28
28
  ENVIRONMENT_VERSION_SECTIONS = [BUNDLED, RUBY].freeze
29
+ deprecate_constant(:ENVIRONMENT_VERSION_SECTIONS)
29
30
 
30
31
  def self.sections_in_lockfile(lockfile_contents)
31
32
  lockfile_contents.scan(/^\w[\w ]*$/).uniq
@@ -13,7 +13,7 @@
13
13
  alias: \fBpackage\fR, \fBpack\fR
14
14
  .
15
15
  .SH "DESCRIPTION"
16
- Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running [bundle install(1)][bundle\-install], use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\.
16
+ Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR, use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\.
17
17
  .
18
18
  .SH "GIT AND PATH GEMS"
19
19
  The \fBbundle cache\fR command can also package \fB:git\fR and \fB:path\fR dependencies besides \.gem files\. This needs to be explicitly enabled via the \fB\-\-all\fR option\. Once used, the \fB\-\-all\fR option will be remembered\.
@@ -22,7 +22,7 @@ The \fBbundle cache\fR command can also package \fB:git\fR and \fB:path\fR depen
22
22
  When using gems that have different packages for different platforms, Bundler supports caching of gems for other platforms where the Gemfile has been resolved (i\.e\. present in the lockfile) in \fBvendor/cache\fR\. This needs to be enabled via the \fB\-\-all\-platforms\fR option\. This setting will be remembered in your local bundler configuration\.
23
23
  .
24
24
  .SH "REMOTE FETCHING"
25
- By default, if you run \fBbundle install(1)\fR](bundle\-install\.1\.html) after running bundle cache(1) \fIbundle\-cache\.1\.html\fR, bundler will still connect to \fBrubygems\.org\fR to check whether a platform\-specific gem exists for any of the gems in \fBvendor/cache\fR\.
25
+ By default, if you run \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR after running bundle cache(1) \fIbundle\-cache\.1\.html\fR, bundler will still connect to \fBrubygems\.org\fR to check whether a platform\-specific gem exists for any of the gems in \fBvendor/cache\fR\.
26
26
  .
27
27
  .P
28
28
  For instance, consider this Gemfile(5):
@@ -10,7 +10,7 @@ alias: `package`, `pack`
10
10
  ## DESCRIPTION
11
11
 
12
12
  Copy all of the `.gem` files needed to run the application into the
13
- `vendor/cache` directory. In the future, when running [bundle install(1)][bundle-install],
13
+ `vendor/cache` directory. In the future, when running [`bundle install(1)`](bundle-install.1.html),
14
14
  use the gems in the cache in preference to the ones on `rubygems.org`.
15
15
 
16
16
  ## GIT AND PATH GEMS
@@ -29,7 +29,7 @@ bundler configuration.
29
29
 
30
30
  ## REMOTE FETCHING
31
31
 
32
- By default, if you run `bundle install(1)`](bundle-install.1.html) after running
32
+ By default, if you run [`bundle install(1)`](bundle-install.1.html) after running
33
33
  [bundle cache(1)](bundle-cache.1.html), bundler will still connect to `rubygems.org`
34
34
  to check whether a platform-specific gem exists for any of the gems
35
35
  in `vendor/cache`.
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ module SafeMarshal
5
+ ALLOWED_CLASSES = [
6
+ Array,
7
+ FalseClass,
8
+ Gem::Specification,
9
+ Gem::Version,
10
+ Hash,
11
+ String,
12
+ Symbol,
13
+ Time,
14
+ TrueClass,
15
+ ].freeze
16
+
17
+ ERROR = "Unexpected class %s present in marshaled data. Only %s are allowed."
18
+
19
+ PROC = proc do |object|
20
+ object.tap do
21
+ unless ALLOWED_CLASSES.include?(object.class)
22
+ raise TypeError, format(ERROR, object.class, ALLOWED_CLASSES.join(", "))
23
+ end
24
+ end
25
+ end
26
+
27
+ def self.proc
28
+ PROC
29
+ end
30
+ end
31
+ end
@@ -219,7 +219,6 @@ module Bundler
219
219
  def path
220
220
  configs.each do |_level, settings|
221
221
  path = value_for("path", settings)
222
- path = "vendor/bundle" if value_for("deployment", settings) && path.nil?
223
222
  path_system = value_for("path.system", settings)
224
223
  disabled_shared_gems = value_for("disable_shared_gems", settings)
225
224
  next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
@@ -227,7 +226,9 @@ module Bundler
227
226
  return Path.new(path, system_path)
228
227
  end
229
228
 
230
- Path.new(nil, false)
229
+ path = "vendor/bundle" if self[:deployment]
230
+
231
+ Path.new(path, false)
231
232
  end
232
233
 
233
234
  Path = Struct.new(:explicit_path, :system_path) do
@@ -10,7 +10,7 @@ module Bundler
10
10
  # Ask for X gems per API request
11
11
  API_REQUEST_SIZE = 50
12
12
 
13
- attr_reader :remotes, :caches
13
+ attr_reader :remotes
14
14
 
15
15
  def initialize(options = {})
16
16
  @options = options
@@ -19,11 +19,14 @@ module Bundler
19
19
  @allow_remote = false
20
20
  @allow_cached = false
21
21
  @allow_local = options["allow_local"] || false
22
- @caches = [cache_path, *Bundler.rubygems.gem_cache]
23
22
 
24
23
  Array(options["remotes"]).reverse_each {|r| add_remote(r) }
25
24
  end
26
25
 
26
+ def caches
27
+ @caches ||= [cache_path, *Bundler.rubygems.gem_cache]
28
+ end
29
+
27
30
  def local_only!
28
31
  @specs = nil
29
32
  @allow_local = true
@@ -324,9 +327,9 @@ module Bundler
324
327
 
325
328
  def cached_path(spec)
326
329
  global_cache_path = download_cache_path(spec)
327
- @caches << global_cache_path if global_cache_path
330
+ caches << global_cache_path if global_cache_path
328
331
 
329
- possibilities = @caches.map {|p| package_path(p, spec) }
332
+ possibilities = caches.map {|p| package_path(p, spec) }
330
333
  possibilities.find {|p| File.exist?(p) }
331
334
  end
332
335
 
@@ -29,7 +29,8 @@ Gem::Specification.new do |spec|
29
29
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
30
  spec.files = Dir.chdir(__dir__) do
31
31
  `git ls-files -z`.split("\x0").reject do |f|
32
- (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
32
+ (File.expand_path(f) == __FILE__) ||
33
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
33
34
  end
34
35
  end
35
36
  spec.bindir = "exe"
@@ -162,7 +162,7 @@ module Bundler::PubGrub
162
162
  def resolve_conflict(incompatibility)
163
163
  logger.info { "conflict: #{incompatibility}" }
164
164
 
165
- new_incompatibility = false
165
+ new_incompatibility = nil
166
166
 
167
167
  while !incompatibility.failure?
168
168
  most_recent_term = nil
@@ -204,7 +204,7 @@ module Bundler::PubGrub
204
204
  solution.backtrack(previous_level)
205
205
 
206
206
  if new_incompatibility
207
- add_incompatibility(incompatibility)
207
+ add_incompatibility(new_incompatibility)
208
208
  end
209
209
 
210
210
  return incompatibility
@@ -219,9 +219,14 @@ module Bundler::PubGrub
219
219
  new_terms << difference.invert
220
220
  end
221
221
 
222
- incompatibility = Incompatibility.new(new_terms, cause: Incompatibility::ConflictCause.new(incompatibility, most_recent_satisfier.cause))
222
+ new_incompatibility = Incompatibility.new(new_terms, cause: Incompatibility::ConflictCause.new(incompatibility, most_recent_satisfier.cause))
223
223
 
224
- new_incompatibility = true
224
+ if incompatibility.to_s == new_incompatibility.to_s
225
+ logger.info { "!! failed to resolve conflicts, this shouldn't have happened" }
226
+ break
227
+ end
228
+
229
+ incompatibility = new_incompatibility
225
230
 
226
231
  partially = difference ? " partially" : ""
227
232
  logger.info { "! #{most_recent_term} is#{partially} satisfied by #{most_recent_satisfier.term}" }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.4.12".freeze
4
+ VERSION = "2.4.14".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -39,16 +39,6 @@ module Bundler
39
39
  environment_preserver.replace_with_backup
40
40
  SUDO_MUTEX = Thread::Mutex.new
41
41
 
42
- SAFE_MARSHAL_CLASSES = [Symbol, TrueClass, String, Array, Hash, Gem::Version, Gem::Specification].freeze
43
- SAFE_MARSHAL_ERROR = "Unexpected class %s present in marshaled data. Only %s are allowed."
44
- SAFE_MARSHAL_PROC = proc do |object|
45
- object.tap do
46
- unless SAFE_MARSHAL_CLASSES.include?(object.class)
47
- raise TypeError, format(SAFE_MARSHAL_ERROR, object.class, SAFE_MARSHAL_CLASSES.join(", "))
48
- end
49
- end
50
- end
51
-
52
42
  autoload :Definition, File.expand_path("bundler/definition", __dir__)
53
43
  autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
54
44
  autoload :Deprecate, File.expand_path("bundler/deprecate", __dir__)
@@ -86,6 +76,7 @@ module Bundler
86
76
  autoload :UI, File.expand_path("bundler/ui", __dir__)
87
77
  autoload :URICredentialsFilter, File.expand_path("bundler/uri_credentials_filter", __dir__)
88
78
  autoload :URINormalizer, File.expand_path("bundler/uri_normalizer", __dir__)
79
+ autoload :SafeMarshal, File.expand_path("bundler/safe_marshal", __dir__)
89
80
 
90
81
  class << self
91
82
  def configure
@@ -219,9 +210,10 @@ module Bundler
219
210
  end
220
211
 
221
212
  def frozen_bundle?
222
- frozen = settings[:deployment]
223
- frozen ||= settings[:frozen]
224
- frozen
213
+ frozen = settings[:frozen]
214
+ return frozen unless frozen.nil?
215
+
216
+ settings[:deployment]
225
217
  end
226
218
 
227
219
  def locked_gems
@@ -523,7 +515,7 @@ EOF
523
515
  end
524
516
 
525
517
  def safe_load_marshal(data)
526
- load_marshal(data, :marshal_proc => SAFE_MARSHAL_PROC)
518
+ load_marshal(data, :marshal_proc => SafeMarshal.proc)
527
519
  end
528
520
 
529
521
  def load_gemspec(file, validate = false)
@@ -342,6 +342,8 @@ class Gem::Installer
342
342
 
343
343
  Gem::Specification.add_spec(spec)
344
344
 
345
+ load_plugin
346
+
345
347
  run_post_install_hooks
346
348
 
347
349
  spec
@@ -1002,4 +1004,17 @@ TEXT
1002
1004
  ""
1003
1005
  end
1004
1006
  end
1007
+
1008
+ def load_plugin
1009
+ specs = Gem::Specification.find_all_by_name(spec.name)
1010
+ # If old version already exists, this plugin isn't loaded
1011
+ # immediately. It's for avoiding a case that multiple versions
1012
+ # are loaded at the same time.
1013
+ return unless specs.size == 1
1014
+
1015
+ plugin_files = spec.plugins.map do |plugin|
1016
+ File.join(@plugins_dir, "#{spec.name}_plugin#{File.extname(plugin)}")
1017
+ end
1018
+ Gem.load_plugin_files(plugin_files)
1019
+ end
1005
1020
  end
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require "rbconfig"
9
9
 
10
10
  module Gem
11
- VERSION = "3.4.12"
11
+ VERSION = "3.4.14"
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -2,18 +2,19 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.4.12"
5
+ s.version = "3.4.14"
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
 
9
- s.summary = "RubyGems is a package management framework for Ruby."
9
+ s.summary = "RubyGems is a package management framework for Ruby. This gem is downloaded and installed by `gem update --system`, so that the `gem` CLI can update itself."
10
10
  s.description = "A package (also known as a library) contains a set of functionality
11
11
  that can be invoked by a Ruby program, such as reading and parsing an XML file. We call
12
12
  these packages 'gems' and RubyGems is a tool to install, create, manage and load these
13
13
  packages in your Ruby environment. RubyGems is also a client for RubyGems.org, a public
14
14
  repository of Gems that allows you to publish a Gem that can be shared and used by other
15
15
  developers. See our guide on publishing a Gem at guides.rubygems.org"
16
- s.homepage = "https://rubygems.org"
16
+ s.homepage = "https://guides.rubygems.org"
17
+ s.metadata = { "source_code_uri" => "https://github.com/rubygems/rubygems" }
17
18
  s.licenses = ["Ruby", "MIT"]
18
19
 
19
20
  s.files = File.read("Manifest.txt").split
@@ -1435,6 +1435,8 @@ class TestGem < Gem::TestCase
1435
1435
  def test_load_plugins
1436
1436
  plugin_path = File.join "lib", "rubygems_plugin.rb"
1437
1437
 
1438
+ foo1_plugin_path = nil
1439
+ foo2_plugin_path = nil
1438
1440
  Dir.chdir @tempdir do
1439
1441
  FileUtils.mkdir_p "lib"
1440
1442
  File.open plugin_path, "w" do |fp|
@@ -1444,17 +1446,22 @@ class TestGem < Gem::TestCase
1444
1446
  foo1 = util_spec "foo", "1" do |s|
1445
1447
  s.files << plugin_path
1446
1448
  end
1449
+ foo1_plugin_path = File.join(foo1.gem_dir, plugin_path)
1447
1450
 
1448
1451
  install_gem foo1
1449
1452
 
1450
1453
  foo2 = util_spec "foo", "2" do |s|
1451
1454
  s.files << plugin_path
1452
1455
  end
1456
+ foo2_plugin_path = File.join(foo2.gem_dir, plugin_path)
1453
1457
 
1454
1458
  install_gem foo2
1455
1459
  end
1456
1460
 
1457
1461
  Gem::Specification.reset
1462
+ PLUGINS_LOADED.clear
1463
+ $LOADED_FEATURES.delete(foo1_plugin_path)
1464
+ $LOADED_FEATURES.delete(foo2_plugin_path)
1458
1465
 
1459
1466
  gem "foo"
1460
1467
 
@@ -545,7 +545,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
545
545
  fp.puts "puts __FILE__"
546
546
  end
547
547
  write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |fp|
548
- fp.puts "puts __FILE__"
548
+ fp.puts "# do nothing"
549
549
  end
550
550
  write_file File.join(@tempdir, "bin", "foo") do |fp|
551
551
  fp.puts "#!/usr/bin/ruby"
@@ -433,7 +433,7 @@ class TestGemCommandsSetupCommand < Gem::TestCase
433
433
  s.files = %W[lib/rubygems_plugin.rb]
434
434
  end
435
435
  write_file File.join @tempdir, "lib", "rubygems_plugin.rb" do |f|
436
- f.puts "require '#{gem.plugins.first}'"
436
+ f.puts "# do nothing"
437
437
  end
438
438
  install_gem gem
439
439
 
@@ -3,9 +3,6 @@ require_relative "helper"
3
3
 
4
4
  class TestGemGemRunner < Gem::TestCase
5
5
  def setup
6
- @orig_gem_home = ENV["GEM_HOME"]
7
- ENV["GEM_HOME"] = @gemhome
8
-
9
6
  require "rubygems/command"
10
7
  @orig_args = Gem::Command.build_args
11
8
  @orig_specific_extra_args = Gem::Command.specific_extra_args_hash.dup
@@ -13,18 +10,21 @@ class TestGemGemRunner < Gem::TestCase
13
10
 
14
11
  super
15
12
 
13
+ @orig_gem_home = ENV["GEM_HOME"]
14
+ ENV["GEM_HOME"] = @gemhome
15
+
16
16
  require "rubygems/gem_runner"
17
17
  @runner = Gem::GemRunner.new
18
18
  end
19
19
 
20
20
  def teardown
21
+ ENV["GEM_HOME"] = @orig_gem_home
22
+
21
23
  super
22
24
 
23
25
  Gem::Command.build_args = @orig_args
24
26
  Gem::Command.specific_extra_args_hash = @orig_specific_extra_args
25
27
  Gem::Command.extra_args = @orig_extra_args
26
-
27
- ENV["GEM_HOME"] = @orig_gem_home
28
28
  end
29
29
 
30
30
  def test_do_configuration
@@ -766,7 +766,7 @@ gem 'other', version
766
766
  def test_generate_plugins
767
767
  installer = util_setup_installer do |spec|
768
768
  write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
769
- io.write "puts __FILE__"
769
+ io.write "# do nothing"
770
770
  end
771
771
 
772
772
  spec.files += %w[lib/rubygems_plugin.rb]
@@ -853,11 +853,59 @@ gem 'other', version
853
853
  refute_includes File.read(build_root_path), build_root
854
854
  end
855
855
 
856
+ class << self
857
+ attr_accessor :plugin_loaded
858
+ attr_accessor :post_install_is_called
859
+ end
860
+
861
+ def test_use_plugin_immediately
862
+ self.class.plugin_loaded = false
863
+ self.class.post_install_is_called = false
864
+ spec_version = nil
865
+ plugin_path = nil
866
+ installer = util_setup_installer do |spec|
867
+ spec_version = spec.version
868
+ plugin_path = File.join("lib", "rubygems_plugin.rb")
869
+ write_file File.join(@tempdir, plugin_path) do |io|
870
+ io.write <<-PLUGIN
871
+ #{self.class}.plugin_loaded = true
872
+ Gem.post_install do
873
+ #{self.class}.post_install_is_called = true
874
+ end
875
+ PLUGIN
876
+ end
877
+ spec.files += [plugin_path]
878
+ plugin_path = File.join(spec.gem_dir, plugin_path)
879
+ end
880
+ build_rake_in do
881
+ installer.install
882
+ end
883
+ assert self.class.plugin_loaded, "plugin is not loaded"
884
+ assert self.class.post_install_is_called,
885
+ "post install hook registered by plugin is not called"
886
+
887
+ self.class.plugin_loaded = false
888
+ $LOADED_FEATURES.delete(plugin_path)
889
+ installer_new = util_setup_installer do |spec_new|
890
+ spec_new.version = spec_version.version.succ
891
+ plugin_path = File.join("lib", "rubygems_plugin.rb")
892
+ write_file File.join(@tempdir, plugin_path) do |io|
893
+ io.write "#{self.class}.plugin_loaded = true"
894
+ end
895
+ spec_new.files += [plugin_path]
896
+ end
897
+ build_rake_in do
898
+ installer_new.install
899
+ end
900
+ assert !self.class.plugin_loaded,
901
+ "plugin is loaded even when old version is already loaded"
902
+ end
903
+
856
904
  def test_keeps_plugins_up_to_date
857
905
  # NOTE: version a-2 is already installed by setup hooks
858
906
 
859
907
  write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
860
- io.write "puts __FILE__"
908
+ io.write "# do nothing"
861
909
  end
862
910
 
863
911
  build_rake_in do
@@ -172,7 +172,7 @@ class TestGemUninstaller < Gem::InstallerTestCase
172
172
 
173
173
  def test_remove_plugins
174
174
  write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
175
- io.write "puts __FILE__"
175
+ io.write "# do nothing"
176
176
  end
177
177
 
178
178
  @spec.files += %w[lib/rubygems_plugin.rb]
@@ -189,7 +189,7 @@ class TestGemUninstaller < Gem::InstallerTestCase
189
189
 
190
190
  def test_remove_plugins_with_install_dir
191
191
  write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
192
- io.write "puts __FILE__"
192
+ io.write "# do nothing"
193
193
  end
194
194
 
195
195
  @spec.files += %w[lib/rubygems_plugin.rb]
@@ -207,7 +207,7 @@ class TestGemUninstaller < Gem::InstallerTestCase
207
207
 
208
208
  def test_regenerate_plugins_for
209
209
  write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
210
- io.write "puts __FILE__"
210
+ io.write "# do nothing"
211
211
  end
212
212
 
213
213
  @spec.files += %w[lib/rubygems_plugin.rb]
@@ -634,7 +634,7 @@ create_makefile '#{@spec.name}'
634
634
 
635
635
  def test_uninstall_keeps_plugins_up_to_date
636
636
  write_file File.join(@tempdir, "lib", "rubygems_plugin.rb") do |io|
637
- io.write "puts __FILE__"
637
+ io.write "# do nothing"
638
638
  end
639
639
 
640
640
  plugin_path = File.join Gem.plugindir, "a_plugin.rb"
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.12
4
+ version: 3.4.14
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-04-11 00:00:00.000000000 Z
19
+ date: 2023-06-12 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
@@ -236,6 +236,7 @@ files:
236
236
  - bundler/lib/bundler/rubygems_gem_installer.rb
237
237
  - bundler/lib/bundler/rubygems_integration.rb
238
238
  - bundler/lib/bundler/runtime.rb
239
+ - bundler/lib/bundler/safe_marshal.rb
239
240
  - bundler/lib/bundler/self_manager.rb
240
241
  - bundler/lib/bundler/settings.rb
241
242
  - bundler/lib/bundler/settings/validator.rb
@@ -817,11 +818,12 @@ files:
817
818
  - test/rubygems/wrong_key_cert.pem
818
819
  - test/rubygems/wrong_key_cert_32.pem
819
820
  - test/test_changelog_generator.rb
820
- homepage: https://rubygems.org
821
+ homepage: https://guides.rubygems.org
821
822
  licenses:
822
823
  - Ruby
823
824
  - MIT
824
- metadata: {}
825
+ metadata:
826
+ source_code_uri: https://github.com/rubygems/rubygems
825
827
  post_install_message:
826
828
  rdoc_options:
827
829
  - "--main"
@@ -840,8 +842,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
840
842
  - !ruby/object:Gem::Version
841
843
  version: '0'
842
844
  requirements: []
843
- rubygems_version: 3.4.12
845
+ rubygems_version: 3.4.14
844
846
  signing_key:
845
847
  specification_version: 4
846
- summary: RubyGems is a package management framework for Ruby.
848
+ summary: RubyGems is a package management framework for Ruby. This gem is downloaded
849
+ and installed by `gem update --system`, so that the `gem` CLI can update itself.
847
850
  test_files: []