rubygems-update 3.3.3 → 3.3.4

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: 750773ce8a64c0d956a7a38abc7e14a70a361510081982f6e34dbbf85c5cbf65
4
- data.tar.gz: a6963c67ef4e2300c549c3d95b5d1e67ff54afcff113215b0a35e7f11973bdec
3
+ metadata.gz: a8b1ab86a06b30bdc5a03f3124e2e2c7ac40db3e5c5fb5d2e2ae9f42c6bfd549
4
+ data.tar.gz: c885501752d796f4a2b656a537242e889c04bb1e67f1d6d21da9047225e5d89f
5
5
  SHA512:
6
- metadata.gz: 158cd64df064a030d8d350f0f66f9d9805018fea3dba122349a1ad239db0579e832d021035bb8f33cccb78f7a227fcfd0ceb4b0a4602a944102c12378f6b480e
7
- data.tar.gz: d359d94fd7939b2c21f0830d64eb1d60d7b3dff016cb7e25299ca7391a24d76970cadb1a3287144a0354d72cf9461a1ca98faf22359e18df799a3a360580dd67
6
+ metadata.gz: bb514eb2ad2813f5ecf90fbe3ffd1c04bf5af6b34cad1b18f77da08a99c0755b18af42314c2ca1073b2d8af58db2eee81a946dd1890c5098ddaabf263cace321
7
+ data.tar.gz: 978538c03440b713418a53126275355e4b0cc3bf31ea0b6574c1813fcaa8b9efe643dcde824a48b2f19eebdf706d5aeba6a10e6ae488e928cf3058f00e2c6e9a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # 3.3.4 / 2021-12-29
2
+
3
+ ## Enhancements:
4
+
5
+ * Don't redownload `rubygems-update` package if already there. Pull
6
+ request #5230 by deivid-rodriguez
7
+ * Installs bundler 2.3.4 as a default gem.
8
+
9
+ ## Bug fixes:
10
+
11
+ * Fix `gem update --system` crashing when latest version not supported.
12
+ Pull request #5191 by deivid-rodriguez
13
+
14
+ ## Performance:
15
+
16
+ * Make SpecificationPolicy autoload constant. Pull request #5222 by pocke
17
+
1
18
  # 3.3.3 / 2021-12-24
2
19
 
3
20
  ## Enhancements:
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 2.3.4 (December 29, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Improve error message when `BUNDLED WITH` version does not exist [#5205](https://github.com/rubygems/rubygems/pull/5205)
6
+
7
+ ## Bug fixes:
8
+
9
+ - Fix `bundle update --bundler` no longer updating lockfile [#5224](https://github.com/rubygems/rubygems/pull/5224)
10
+
1
11
  # 2.3.3 (December 24, 2021)
2
12
 
3
13
  ## Bug fixes:
@@ -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 = "2021-12-24".freeze
8
- @git_commit_sha = "688b71febc".freeze
7
+ @built_at = "2021-12-29".freeze
8
+ @git_commit_sha = "2296a0d6cc".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -103,7 +103,7 @@ module Bundler
103
103
 
104
104
  def self.system
105
105
  ruby_engine = RUBY_ENGINE.dup
106
- ruby_version = ENV.fetch("BUNDLER_SPEC_RUBY_VERSION") { RUBY_VERSION }.dup
106
+ ruby_version = RUBY_VERSION.dup
107
107
  ruby_engine_version = RUBY_ENGINE_VERSION.dup
108
108
  patchlevel = RUBY_PATCHLEVEL.to_s
109
109
 
@@ -15,10 +15,6 @@ module Bundler
15
15
  def install_locked_bundler_and_restart_with_it_if_needed
16
16
  return unless needs_switching?
17
17
 
18
- Bundler.ui.info \
19
- "Bundler #{current_version} is running, but your lockfile was generated with #{lockfile_version}. " \
20
- "Installing Bundler #{lockfile_version} and restarting using that version."
21
-
22
18
  install_and_restart_with_locked_bundler
23
19
  end
24
20
 
@@ -26,8 +22,14 @@ module Bundler
26
22
 
27
23
  def install_and_restart_with_locked_bundler
28
24
  bundler_dep = Gem::Dependency.new("bundler", lockfile_version)
25
+ spec = fetch_spec_for(bundler_dep)
26
+ return if spec.nil?
29
27
 
30
- Gem.install(bundler_dep)
28
+ Bundler.ui.info \
29
+ "Bundler #{current_version} is running, but your lockfile was generated with #{lockfile_version}. " \
30
+ "Installing Bundler #{lockfile_version} and restarting using that version."
31
+
32
+ spec.source.install(spec)
31
33
  rescue StandardError => e
32
34
  Bundler.ui.trace e
33
35
  Bundler.ui.warn "There was an error installing the locked bundler version (#{lockfile_version}), rerun with the `--verbose` flag for more details. Going on using bundler #{current_version}."
@@ -35,6 +37,17 @@ module Bundler
35
37
  restart_with_locked_bundler
36
38
  end
37
39
 
40
+ def fetch_spec_for(bundler_dep)
41
+ source = Bundler::Source::Rubygems.new("remotes" => "https://rubygems.org")
42
+ source.remote!
43
+ source.add_dependency_names("bundler")
44
+ spec = source.specs.search(bundler_dep).first
45
+ if spec.nil?
46
+ Bundler.ui.warn "Your lockfile is locked to a version of bundler (#{lockfile_version}) that doesn't exist at https://rubygems.org/. Going on using #{current_version}"
47
+ end
48
+ spec
49
+ end
50
+
38
51
  def restart_with_locked_bundler
39
52
  configured_gem_home = ENV["GEM_HOME"]
40
53
  configured_gem_path = ENV["GEM_PATH"]
@@ -56,7 +69,12 @@ module Bundler
56
69
  SharedHelpers.in_bundle? &&
57
70
  lockfile_version &&
58
71
  !lockfile_version.end_with?(".dev") &&
59
- lockfile_version != current_version
72
+ lockfile_version != current_version &&
73
+ !updating?
74
+ end
75
+
76
+ def updating?
77
+ "update".start_with?(ARGV.first || " ") && ARGV[1..-1].any? {|a| a.start_with?("--bundler") }
60
78
  end
61
79
 
62
80
  def installed?
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.3.3".freeze
4
+ VERSION = "2.3.4".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -286,10 +286,11 @@ command to remove old versions.
286
286
 
287
287
  check_oldest_rubygems version
288
288
 
289
- update_gem 'rubygems-update', version
290
-
291
289
  installed_gems = Gem::Specification.find_all_by_name 'rubygems-update', requirement
292
- version = installed_gems.first.version
290
+ installed_gems = update_gem('rubygems-update', version) if installed_gems.empty?
291
+ return if installed_gems.empty?
292
+
293
+ version = installed_gems.first.version
293
294
 
294
295
  install_rubygems version
295
296
  end
@@ -11,7 +11,6 @@ require_relative 'basic_specification'
11
11
  require_relative 'stub_specification'
12
12
  require_relative 'platform'
13
13
  require_relative 'requirement'
14
- require_relative 'specification_policy'
15
14
  require_relative 'util/list'
16
15
 
17
16
  ##
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = "3.3.3".freeze
11
+ VERSION = "3.3.4".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -1316,6 +1316,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1316
1316
  autoload :Source, File.expand_path('rubygems/source', __dir__)
1317
1317
  autoload :SourceList, File.expand_path('rubygems/source_list', __dir__)
1318
1318
  autoload :SpecFetcher, File.expand_path('rubygems/spec_fetcher', __dir__)
1319
+ autoload :SpecificationPolicy, File.expand_path('rubygems/specification_policy', __dir__)
1319
1320
  autoload :Util, File.expand_path('rubygems/util', __dir__)
1320
1321
  autoload :Version, File.expand_path('rubygems/version', __dir__)
1321
1322
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.3.3"
5
+ s.version = "3.3.4"
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
 
@@ -106,6 +106,31 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
106
106
  assert_empty out
107
107
  end
108
108
 
109
+ def test_execute_system_when_latest_does_not_support_your_ruby
110
+ spec_fetcher do |fetcher|
111
+ fetcher.download 'rubygems-update', 9 do |s|
112
+ s.files = %w[setup.rb]
113
+ s.required_ruby_version = '> 9'
114
+ end
115
+ end
116
+
117
+ @cmd.options[:args] = []
118
+ @cmd.options[:system] = true
119
+
120
+ use_ui @ui do
121
+ @cmd.execute
122
+ end
123
+
124
+ out = @ui.output.split "\n"
125
+ assert_equal "Updating rubygems-update", out.shift
126
+ assert_empty out
127
+
128
+ err = @ui.error.split "\n"
129
+ assert_equal "ERROR: Error installing rubygems-update:", err.shift
130
+ assert_equal "\trubygems-update-9 requires Ruby version > 9. The current ruby version is #{Gem.ruby_version}.", err.shift
131
+ assert_empty err
132
+ end
133
+
109
134
  def test_execute_system_multiple
110
135
  spec_fetcher do |fetcher|
111
136
  fetcher.download 'rubygems-update', 8 do |s|
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.3
4
+ version: 3.3.4
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: 2021-12-24 00:00:00.000000000 Z
19
+ date: 2021-12-29 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
@@ -804,7 +804,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
804
804
  - !ruby/object:Gem::Version
805
805
  version: '0'
806
806
  requirements: []
807
- rubygems_version: 3.3.3
807
+ rubygems_version: 3.3.4
808
808
  signing_key:
809
809
  specification_version: 4
810
810
  summary: RubyGems is a package management framework for Ruby.