rubygems-update 3.3.14 → 3.3.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/bundler/CHANGELOG.md +19 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/dsl.rb +5 -7
- data/bundler/lib/bundler/errors.rb +12 -4
- data/bundler/lib/bundler/friendly_errors.rb +16 -2
- data/bundler/lib/bundler/injector.rb +4 -0
- data/bundler/lib/bundler/inline.rb +1 -11
- data/bundler/lib/bundler/installer.rb +1 -10
- data/bundler/lib/bundler/process_lock.rb +1 -1
- data/bundler/lib/bundler/resolver.rb +7 -8
- data/bundler/lib/bundler/rubygems_gem_installer.rb +3 -8
- data/bundler/lib/bundler/settings.rb +1 -1
- data/bundler/lib/bundler/source/rubygems.rb +1 -1
- data/bundler/lib/bundler/stub_specification.rb +5 -3
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +11 -0
- data/lib/rubygems/command_manager.rb +6 -1
- data/lib/rubygems/commands/update_command.rb +4 -5
- data/lib/rubygems/specification.rb +8 -6
- data/lib/rubygems.rb +1 -1
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/data/null-type.gemspec.rz +0 -0
- data/test/rubygems/test_gem_command_manager.rb +7 -1
- data/test/rubygems/test_gem_commands_update_command.rb +31 -0
- data/test/rubygems/test_gem_specification.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c8251cdf4ded47257679e20301da2396899478015bbf63592a1e0953949761d
|
4
|
+
data.tar.gz: 6db38aaea1698dac8472f55f7a778c511f0d3807441e0de7af1d1d4ac607188f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 933a409f4ecba3a01f5141058d3a2796af6920c098a704471ee5400f98df4f9054520e5cd2d0eab88fe8afc010cff4e9d985d05caf84304d17f2e61403b6eb1e
|
7
|
+
data.tar.gz: 35d232187dde951c88c90e856e304b417b4984c40b6e5409a96bc9456a4bffd9650cdc37aac82c4ae40f83eca108a04bde4ba533e8db0bc29276a054bad659f2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# 3.3.15 / 2022-06-01
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
* Support the change of did_you_mean about `Exception#detailed_message`.
|
6
|
+
Pull request #5560 by mame
|
7
|
+
* Installs bundler 2.3.15 as a default gem.
|
8
|
+
|
9
|
+
## Bug fixes:
|
10
|
+
|
11
|
+
* Fix loading old marshaled specs including `YAML::PrivateType` constant.
|
12
|
+
Pull request #5415 by deivid-rodriguez
|
13
|
+
* Fix rubygems update when non default `--install-dir` is configured. Pull
|
14
|
+
request #5566 by deivid-rodriguez
|
15
|
+
|
1
16
|
# 3.3.14 / 2022-05-18
|
2
17
|
|
3
18
|
## Enhancements:
|
data/bundler/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
# 2.3.15 (June 1, 2022)
|
2
|
+
|
3
|
+
## Enhancements:
|
4
|
+
|
5
|
+
- Show better error when previous installation fails to be removed [#5564](https://github.com/rubygems/rubygems/pull/5564)
|
6
|
+
- Show exception cause in bug report template [#5563](https://github.com/rubygems/rubygems/pull/5563)
|
7
|
+
|
8
|
+
## Bug fixes:
|
9
|
+
|
10
|
+
- Fix `bundle remove` by invalidating cached `Bundle.definition` [#5443](https://github.com/rubygems/rubygems/pull/5443)
|
11
|
+
- Fix generated standalone script when it includes default gems [#5586](https://github.com/rubygems/rubygems/pull/5586)
|
12
|
+
- Skip duplicated dependency warning for gemspec dev deps [#5587](https://github.com/rubygems/rubygems/pull/5587)
|
13
|
+
- Give better conflict resolution advice [#5581](https://github.com/rubygems/rubygems/pull/5581)
|
14
|
+
- Fix crash when commenting out a mirror in configuration [#5576](https://github.com/rubygems/rubygems/pull/5576)
|
15
|
+
- Fix crash when installing gems with symlinks [#5570](https://github.com/rubygems/rubygems/pull/5570)
|
16
|
+
- Ignore `Errno::EROFS` errors when creating `bundler.lock` [#5580](https://github.com/rubygems/rubygems/pull/5580)
|
17
|
+
- Ignore `Errno::EPERM` errors when creating `bundler.lock` [#5579](https://github.com/rubygems/rubygems/pull/5579)
|
18
|
+
- Fix crash when printing resolution conflicts on metadata requirements [#5562](https://github.com/rubygems/rubygems/pull/5562)
|
19
|
+
|
1
20
|
# 2.3.14 (May 18, 2022)
|
2
21
|
|
3
22
|
## 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 = "2022-
|
8
|
-
@git_commit_sha = "
|
7
|
+
@built_at = "2022-06-01".freeze
|
8
|
+
@git_commit_sha = "e7e41afd92".freeze
|
9
9
|
@release = true
|
10
10
|
# end ivars
|
11
11
|
|
data/bundler/lib/bundler/dsl.rb
CHANGED
@@ -124,19 +124,17 @@ module Bundler
|
|
124
124
|
raise GemfileError, "You cannot specify the same gem twice with different version requirements.\n" \
|
125
125
|
"You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
|
126
126
|
"#{update_prompt}"
|
127
|
+
elsif current.source != dep.source
|
128
|
+
return if dep.type == :development
|
129
|
+
raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
|
130
|
+
"You specified that #{dep.name} (#{dep.requirement}) should come from " \
|
131
|
+
"#{current.source || "an unspecified source"} and #{dep.source}\n"
|
127
132
|
else
|
128
133
|
Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \
|
129
134
|
"You should probably keep only one of them.\n" \
|
130
135
|
"Remove any duplicate entries and specify the gem only once.\n" \
|
131
136
|
"While it's not a problem now, it could cause errors if you change the version of one of them later."
|
132
137
|
end
|
133
|
-
|
134
|
-
if current.source != dep.source
|
135
|
-
return if dep.type == :development
|
136
|
-
raise GemfileError, "You cannot specify the same gem twice coming from different sources.\n" \
|
137
|
-
"You specified that #{dep.name} (#{dep.requirement}) should come from " \
|
138
|
-
"#{current.source || "an unspecified source"} and #{dep.source}\n"
|
139
|
-
end
|
140
138
|
end
|
141
139
|
end
|
142
140
|
|
@@ -79,10 +79,6 @@ module Bundler
|
|
79
79
|
case @permission_type
|
80
80
|
when :create
|
81
81
|
"executable permissions for all parent directories and write permissions for `#{parent_folder}`"
|
82
|
-
when :delete
|
83
|
-
permissions = "executable permissions for all parent directories and write permissions for `#{parent_folder}`"
|
84
|
-
permissions += ", and the same thing for all subdirectories inside #{@path}" if File.directory?(@path)
|
85
|
-
permissions
|
86
82
|
else
|
87
83
|
"#{@permission_type} permissions for that path"
|
88
84
|
end
|
@@ -172,4 +168,16 @@ module Bundler
|
|
172
168
|
|
173
169
|
status_code(32)
|
174
170
|
end
|
171
|
+
|
172
|
+
class DirectoryRemovalError < BundlerError
|
173
|
+
def initialize(orig_exception, msg)
|
174
|
+
full_message = "#{msg}.\n" \
|
175
|
+
"The underlying error was #{orig_exception.class}: #{orig_exception.message}, with backtrace:\n" \
|
176
|
+
" #{orig_exception.backtrace.join("\n ")}\n\n" \
|
177
|
+
"Bundler Error Backtrace:"
|
178
|
+
super(full_message)
|
179
|
+
end
|
180
|
+
|
181
|
+
status_code(36)
|
182
|
+
end
|
175
183
|
end
|
@@ -65,8 +65,7 @@ module Bundler
|
|
65
65
|
--- ERROR REPORT TEMPLATE -------------------------------------------------------
|
66
66
|
|
67
67
|
```
|
68
|
-
#{e
|
69
|
-
#{e.backtrace && e.backtrace.join("\n ").chomp}
|
68
|
+
#{exception_message(e)}
|
70
69
|
```
|
71
70
|
|
72
71
|
#{Bundler::Env.report}
|
@@ -85,6 +84,21 @@ module Bundler
|
|
85
84
|
EOS
|
86
85
|
end
|
87
86
|
|
87
|
+
def exception_message(error)
|
88
|
+
message = serialized_exception_for(error)
|
89
|
+
cause = error.cause
|
90
|
+
return message unless cause
|
91
|
+
|
92
|
+
message + serialized_exception_for(cause)
|
93
|
+
end
|
94
|
+
|
95
|
+
def serialized_exception_for(e)
|
96
|
+
<<-EOS.gsub(/^ {8}/, "")
|
97
|
+
#{e.class}: #{e.message}
|
98
|
+
#{e.backtrace && e.backtrace.join("\n ").chomp}
|
99
|
+
EOS
|
100
|
+
end
|
101
|
+
|
88
102
|
def issues_url(exception)
|
89
103
|
message = exception.message.lines.first.tr(":", " ").chomp
|
90
104
|
message = message.split("-").first if exception.is_a?(Errno)
|
@@ -72,6 +72,10 @@ module Bundler
|
|
72
72
|
|
73
73
|
deps.each {|dep| Bundler.ui.confirm "#{SharedHelpers.pretty_dependency(dep, false)} was removed." }
|
74
74
|
end
|
75
|
+
|
76
|
+
# Invalidate the cached Bundler.definition.
|
77
|
+
# This prevents e.g. `bundle remove ...` from using outdated information.
|
78
|
+
Bundler.reset_paths!
|
75
79
|
end
|
76
80
|
|
77
81
|
private
|
@@ -38,12 +38,7 @@ def gemfile(install = false, options = {}, &gemfile)
|
|
38
38
|
raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
|
39
39
|
|
40
40
|
begin
|
41
|
-
|
42
|
-
bundler_module = class << Bundler; self; end
|
43
|
-
bundler_module.send(:remove_method, :root)
|
44
|
-
def Bundler.root
|
45
|
-
Bundler::SharedHelpers.pwd.expand_path
|
46
|
-
end
|
41
|
+
Bundler.instance_variable_set(:@bundle_path, Pathname.new(Gem.dir))
|
47
42
|
old_gemfile = ENV["BUNDLE_GEMFILE"]
|
48
43
|
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
|
49
44
|
|
@@ -71,11 +66,6 @@ def gemfile(install = false, options = {}, &gemfile)
|
|
71
66
|
runtime.setup.require
|
72
67
|
end
|
73
68
|
ensure
|
74
|
-
if bundler_module
|
75
|
-
bundler_module.send(:remove_method, :root)
|
76
|
-
bundler_module.send(:define_method, :root, old_root)
|
77
|
-
end
|
78
|
-
|
79
69
|
if old_gemfile
|
80
70
|
ENV["BUNDLE_GEMFILE"] = old_gemfile
|
81
71
|
else
|
@@ -66,7 +66,7 @@ module Bundler
|
|
66
66
|
# require paths and save them in a `setup.rb` file. See `bundle standalone --help` for more
|
67
67
|
# information.
|
68
68
|
def run(options)
|
69
|
-
create_bundle_path
|
69
|
+
Bundler.create_bundle_path
|
70
70
|
|
71
71
|
ProcessLock.lock do
|
72
72
|
if Bundler.frozen_bundle?
|
@@ -262,15 +262,6 @@ module Bundler
|
|
262
262
|
end
|
263
263
|
end
|
264
264
|
|
265
|
-
def create_bundle_path
|
266
|
-
SharedHelpers.filesystem_access(Bundler.bundle_path.to_s) do |p|
|
267
|
-
Bundler.mkdir_p(p)
|
268
|
-
end unless Bundler.bundle_path.exist?
|
269
|
-
rescue Errno::EEXIST
|
270
|
-
raise PathError, "Could not install to path `#{Bundler.bundle_path}` " \
|
271
|
-
"because a file already exists at that path. Either remove or rename the file so the directory can be created."
|
272
|
-
end
|
273
|
-
|
274
265
|
# returns whether or not a re-resolve was needed
|
275
266
|
def resolve_if_needed(options)
|
276
267
|
if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
|
@@ -12,7 +12,7 @@ module Bundler
|
|
12
12
|
yield
|
13
13
|
f.flock(File::LOCK_UN)
|
14
14
|
end
|
15
|
-
rescue Errno::EACCES, Errno::ENOLCK, Errno::ENOTSUP
|
15
|
+
rescue Errno::EACCES, Errno::ENOLCK, Errno::ENOTSUP, Errno::EPERM, Errno::EROFS
|
16
16
|
# In the case the user does not have access to
|
17
17
|
# create the lock file or is using NFS where
|
18
18
|
# locks are not available we skip locking.
|
@@ -19,13 +19,15 @@ module Bundler
|
|
19
19
|
# collection of gemspecs is returned. Otherwise, nil is returned.
|
20
20
|
def self.resolve(requirements, source_requirements = {}, base = [], gem_version_promoter = GemVersionPromoter.new, additional_base_requirements = [], platforms = nil)
|
21
21
|
base = SpecSet.new(base) unless base.is_a?(SpecSet)
|
22
|
-
|
22
|
+
metadata_requirements, regular_requirements = requirements.partition {|dep| dep.name.end_with?("\0") }
|
23
|
+
resolver = new(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms, metadata_requirements)
|
23
24
|
result = resolver.start(requirements)
|
24
|
-
SpecSet.new(SpecSet.new(result).for(
|
25
|
+
SpecSet.new(SpecSet.new(result).for(regular_requirements))
|
25
26
|
end
|
26
27
|
|
27
|
-
def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms)
|
28
|
+
def initialize(source_requirements, base, gem_version_promoter, additional_base_requirements, platforms, metadata_requirements)
|
28
29
|
@source_requirements = source_requirements
|
30
|
+
@metadata_requirements = metadata_requirements
|
29
31
|
@base = base
|
30
32
|
@resolver = Molinillo::Resolver.new(self, self)
|
31
33
|
@search_for = {}
|
@@ -344,8 +346,6 @@ module Bundler
|
|
344
346
|
trees.sort_by! {|t| t.reverse.map(&:name) }
|
345
347
|
end
|
346
348
|
|
347
|
-
metadata_requirements = {}
|
348
|
-
|
349
349
|
o << trees.map do |tree|
|
350
350
|
t = "".dup
|
351
351
|
depth = 2
|
@@ -354,7 +354,6 @@ module Bundler
|
|
354
354
|
base_tree_name = base_tree.name
|
355
355
|
|
356
356
|
if base_tree_name.end_with?("\0")
|
357
|
-
metadata_requirements[base_tree_name] = base_tree
|
358
357
|
t = nil
|
359
358
|
else
|
360
359
|
tree.each do |req|
|
@@ -393,10 +392,10 @@ module Bundler
|
|
393
392
|
end
|
394
393
|
end
|
395
394
|
elsif name.end_with?("\0")
|
396
|
-
o << %(\n Current #{name} version:\n #{SharedHelpers.pretty_dependency(metadata_requirements
|
395
|
+
o << %(\n Current #{name} version:\n #{SharedHelpers.pretty_dependency(@metadata_requirements.find {|req| req.name == name })}\n\n)
|
397
396
|
elsif conflict.locked_requirement
|
398
397
|
o << "\n"
|
399
|
-
o << %(
|
398
|
+
o << %(Deleting your #{name_for_locking_dependency_source} file and running `bundle install` will rebuild your snapshot from scratch, using only\n)
|
400
399
|
o << %(the gems in your Gemfile, which may resolve the conflict.\n)
|
401
400
|
elsif !conflict.existing
|
402
401
|
o << "\n"
|
@@ -93,14 +93,9 @@ module Bundler
|
|
93
93
|
private
|
94
94
|
|
95
95
|
def strict_rm_rf(dir)
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
# inside `fileutils` but for now I`m checking whether the folder was
|
100
|
-
# removed after it completes, and raising otherwise.
|
101
|
-
FileUtils.rm_rf dir
|
102
|
-
|
103
|
-
raise PermissionError.new(dir, :delete) if File.directory?(dir)
|
96
|
+
Bundler.rm_rf dir
|
97
|
+
rescue Errno::ENOTEMPTY => e
|
98
|
+
raise DirectoryRemovalError.new(e.cause, "Could not delete previous installation of `#{dir}`")
|
104
99
|
end
|
105
100
|
|
106
101
|
def validate_bundler_checksum(checksum)
|
@@ -487,7 +487,7 @@ module Bundler
|
|
487
487
|
/ix.freeze
|
488
488
|
|
489
489
|
def self.key_for(key)
|
490
|
-
key = normalize_uri(key).to_s if key.is_a?(String) &&
|
490
|
+
key = normalize_uri(key).to_s if key.is_a?(String) && key.start_with?("http", "mirror.http")
|
491
491
|
key = key.to_s.gsub(".", "__").gsub("-", "___").upcase
|
492
492
|
"BUNDLE_#{key}"
|
493
493
|
end
|
@@ -64,9 +64,11 @@ module Bundler
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def full_gem_path
|
67
|
-
|
68
|
-
|
69
|
-
|
67
|
+
stub.full_gem_path
|
68
|
+
end
|
69
|
+
|
70
|
+
def full_gem_path=(path)
|
71
|
+
stub.full_gem_path = path
|
70
72
|
end
|
71
73
|
|
72
74
|
def full_require_paths
|
data/bundler/lib/bundler.rb
CHANGED
@@ -97,6 +97,17 @@ module Bundler
|
|
97
97
|
@bundle_path ||= Pathname.new(configured_bundle_path.path).expand_path(root)
|
98
98
|
end
|
99
99
|
|
100
|
+
def create_bundle_path
|
101
|
+
SharedHelpers.filesystem_access(bundle_path.to_s) do |p|
|
102
|
+
mkdir_p(p)
|
103
|
+
end unless bundle_path.exist?
|
104
|
+
|
105
|
+
@bundle_path = bundle_path.realpath
|
106
|
+
rescue Errno::EEXIST
|
107
|
+
raise PathError, "Could not install to path `#{bundle_path}` " \
|
108
|
+
"because a file already exists at that path. Either remove or rename the file so the directory can be created."
|
109
|
+
end
|
110
|
+
|
100
111
|
def configured_bundle_path
|
101
112
|
@configured_bundle_path ||= settings.path.tap(&:validate!)
|
102
113
|
end
|
@@ -148,7 +148,12 @@ class Gem::CommandManager
|
|
148
148
|
def run(args, build_args=nil)
|
149
149
|
process_args(args, build_args)
|
150
150
|
rescue StandardError, Timeout::Error => ex
|
151
|
-
|
151
|
+
if ex.respond_to?(:detailed_message)
|
152
|
+
msg = ex.detailed_message(highlight: false).sub(/\A(.*?)(?: \(.+?\))/) { $1 }
|
153
|
+
else
|
154
|
+
msg = ex.message
|
155
|
+
end
|
156
|
+
alert_error clean_text("While executing gem ... (#{ex.class})\n #{msg}")
|
152
157
|
ui.backtrace ex
|
153
158
|
|
154
159
|
terminate_interaction(1)
|
@@ -173,10 +173,11 @@ command to remove old versions.
|
|
173
173
|
highest_remote_gem.first
|
174
174
|
end
|
175
175
|
|
176
|
-
def install_rubygems(
|
176
|
+
def install_rubygems(spec) # :nodoc:
|
177
177
|
args = update_rubygems_arguments
|
178
|
+
version = spec.version
|
178
179
|
|
179
|
-
update_dir = File.join
|
180
|
+
update_dir = File.join spec.base_dir, 'gems', "rubygems-update-#{version}"
|
180
181
|
|
181
182
|
Dir.chdir update_dir do
|
182
183
|
say "Installing RubyGems #{version}" unless options[:silent]
|
@@ -290,9 +291,7 @@ command to remove old versions.
|
|
290
291
|
installed_gems = update_gem('rubygems-update', version) if installed_gems.empty? || installed_gems.first.version != version
|
291
292
|
return if installed_gems.empty?
|
292
293
|
|
293
|
-
|
294
|
-
|
295
|
-
install_rubygems version
|
294
|
+
install_rubygems installed_gems.first
|
296
295
|
end
|
297
296
|
|
298
297
|
def update_rubygems_arguments # :nodoc:
|
@@ -1270,7 +1270,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1270
1270
|
def self._load(str)
|
1271
1271
|
Gem.load_yaml
|
1272
1272
|
|
1273
|
-
array =
|
1273
|
+
array = begin
|
1274
|
+
Marshal.load str
|
1275
|
+
rescue ArgumentError => e
|
1276
|
+
raise unless e.message.include?("YAML")
|
1277
|
+
|
1278
|
+
Object.const_set "YAML", Psych
|
1279
|
+
Marshal.load str
|
1280
|
+
end
|
1274
1281
|
|
1275
1282
|
spec = Gem::Specification.new
|
1276
1283
|
spec.instance_variable_set :@specification_version, array[1]
|
@@ -1289,11 +1296,6 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1289
1296
|
raise TypeError, "invalid Gem::Specification format #{array.inspect}"
|
1290
1297
|
end
|
1291
1298
|
|
1292
|
-
# Cleanup any Psych::PrivateType. They only show up for an old bug
|
1293
|
-
# where nil => null, so just convert them to nil based on the type.
|
1294
|
-
|
1295
|
-
array.map! {|e| e.kind_of?(Psych::PrivateType) ? nil : e }
|
1296
|
-
|
1297
1299
|
spec.instance_variable_set :@rubygems_version, array[0]
|
1298
1300
|
# spec version
|
1299
1301
|
spec.instance_variable_set :@name, array[2]
|
data/lib/rubygems.rb
CHANGED
data/rubygems-update.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "rubygems-update"
|
5
|
-
s.version = "3.3.
|
5
|
+
s.version = "3.3.15"
|
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
|
|
Binary file
|
@@ -80,7 +80,13 @@ class TestGemCommandManager < Gem::TestCase
|
|
80
80
|
message << "\nDid you mean? \"push\""
|
81
81
|
end
|
82
82
|
|
83
|
-
|
83
|
+
if e.respond_to?(:detailed_message)
|
84
|
+
actual_message = e.detailed_message(highlight: false).sub(/\A(.*?)(?: \(.+?\))/) { $1 }
|
85
|
+
else
|
86
|
+
actual_message = e.message
|
87
|
+
end
|
88
|
+
|
89
|
+
assert_equal message, actual_message
|
84
90
|
end
|
85
91
|
|
86
92
|
def test_run_interrupt
|
@@ -191,6 +191,37 @@ class TestGemCommandsUpdateCommand < Gem::TestCase
|
|
191
191
|
assert_empty out
|
192
192
|
end
|
193
193
|
|
194
|
+
def test_execute_system_update_installed_in_non_default_gem_path
|
195
|
+
rubygems_update_spec = quick_gem "rubygems-update", 9 do |s|
|
196
|
+
write_file File.join(@tempdir, 'setup.rb')
|
197
|
+
|
198
|
+
s.files += %w[setup.rb]
|
199
|
+
end
|
200
|
+
|
201
|
+
util_setup_spec_fetcher rubygems_update_spec
|
202
|
+
|
203
|
+
rubygems_update_package = Gem::Package.build rubygems_update_spec
|
204
|
+
|
205
|
+
gemhome2 = "#{@gemhome}2"
|
206
|
+
|
207
|
+
Gem::Installer.at(rubygems_update_package, :install_dir => gemhome2).install
|
208
|
+
|
209
|
+
Gem.use_paths @gemhome, [gemhome2, @gemhome]
|
210
|
+
|
211
|
+
@cmd.options[:args] = []
|
212
|
+
@cmd.options[:system] = true
|
213
|
+
|
214
|
+
use_ui @ui do
|
215
|
+
@cmd.execute
|
216
|
+
end
|
217
|
+
|
218
|
+
out = @ui.output.split "\n"
|
219
|
+
assert_equal "Installing RubyGems 9", out.shift
|
220
|
+
assert_equal "RubyGems system software updated", out.shift
|
221
|
+
|
222
|
+
assert_empty out
|
223
|
+
end
|
224
|
+
|
194
225
|
def test_execute_system_specific
|
195
226
|
spec_fetcher do |fetcher|
|
196
227
|
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.
|
4
|
+
version: 3.3.15
|
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-06-01 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
|
@@ -817,7 +817,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
817
817
|
- !ruby/object:Gem::Version
|
818
818
|
version: '0'
|
819
819
|
requirements: []
|
820
|
-
rubygems_version: 3.3.
|
820
|
+
rubygems_version: 3.3.15
|
821
821
|
signing_key:
|
822
822
|
specification_version: 4
|
823
823
|
summary: RubyGems is a package management framework for Ruby.
|