rubygems-update 3.3.5 → 3.3.6
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 +4 -4
- data/CHANGELOG.md +18 -0
- data/bundler/CHANGELOG.md +15 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/doctor.rb +9 -1
- data/bundler/lib/bundler/cli/gem.rb +11 -1
- data/bundler/lib/bundler/cli/platform.rb +1 -1
- data/bundler/lib/bundler/definition.rb +2 -1
- data/bundler/lib/bundler/env.rb +1 -1
- data/bundler/lib/bundler/remote_specification.rb +7 -0
- data/bundler/lib/bundler/resolver.rb +5 -4
- data/bundler/lib/bundler/templates/newgem/standard.yml.tt +1 -0
- data/bundler/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +1 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems/basic_specification.rb +8 -8
- data/lib/rubygems/bundler_version_finder.rb +3 -3
- data/lib/rubygems/command.rb +4 -4
- data/lib/rubygems/commands/cleanup_command.rb +6 -6
- data/lib/rubygems/commands/dependency_command.rb +20 -30
- data/lib/rubygems/commands/list_command.rb +1 -1
- data/lib/rubygems/commands/pristine_command.rb +12 -12
- data/lib/rubygems/commands/push_command.rb +8 -8
- data/lib/rubygems/commands/query_command.rb +1 -1
- data/lib/rubygems/commands/rdoc_command.rb +6 -6
- data/lib/rubygems/commands/search_command.rb +1 -1
- data/lib/rubygems/commands/setup_command.rb +8 -8
- data/lib/rubygems/commands/specification_command.rb +4 -4
- data/lib/rubygems/commands/update_command.rb +8 -6
- data/lib/rubygems/config_file.rb +4 -4
- data/lib/rubygems/doctor.rb +5 -5
- data/lib/rubygems/gem_runner.rb +5 -5
- data/lib/rubygems/install_update_options.rb +4 -4
- data/lib/rubygems/installer.rb +51 -12
- data/lib/rubygems/package.rb +10 -10
- data/lib/rubygems/platform.rb +42 -42
- data/lib/rubygems/query_utils.rb +16 -18
- data/lib/rubygems/remote_fetcher.rb +4 -4
- data/lib/rubygems/request_set/lockfile.rb +4 -4
- data/lib/rubygems/source.rb +6 -6
- data/lib/rubygems/source_list.rb +7 -7
- data/lib/rubygems/spec_fetcher.rb +25 -25
- data/lib/rubygems/specification.rb +46 -46
- data/lib/rubygems/specification_policy.rb +16 -16
- data/lib/rubygems/stub_specification.rb +16 -16
- data/lib/rubygems/uninstaller.rb +7 -7
- data/lib/rubygems/user_interaction.rb +12 -12
- data/lib/rubygems/version.rb +9 -7
- data/lib/rubygems.rb +7 -7
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/helper.rb +4 -4
- data/test/rubygems/test_gem.rb +2 -0
- data/test/rubygems/test_gem_command_manager.rb +1 -1
- data/test/rubygems/test_gem_commands_update_command.rb +34 -0
- data/test/rubygems/test_gem_installer.rb +170 -58
- data/test/rubygems/test_gem_stream_ui.rb +1 -1
- data/test/rubygems/test_gem_version.rb +4 -0
- data/test/rubygems/utilities.rb +4 -4
- 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: 498b97d36cfdbe927831044d377e36e6ce8bf07724f1ec5fc1b9dfa39376c7d4
|
|
4
|
+
data.tar.gz: 4afa885b9263b0154b00e0695849c2b795f7870f625c37a368104333ea56309b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 34f91a116d9e346e3fd26ea549d5d6b2c5f959d00612557d1abf133da8d6566b9a186f5d116f878f49ad629215de9604763f84cd32bc14c8d2b7b200c80ae387
|
|
7
|
+
data.tar.gz: 173c8fdd07607bc57c6ba6bc12a5551f5db03f20fabdb25924069e4e067e7dc8314fb343495487735eb16ad2bc410aebd0c21002fffaab873399a017953f7e89
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# 3.3.6 / 2022-01-26
|
|
2
|
+
|
|
3
|
+
## Enhancements:
|
|
4
|
+
|
|
5
|
+
* Forbid downgrading past the originally shipped version on Ruby 3.1. Pull
|
|
6
|
+
request #5301 by deivid-rodriguez
|
|
7
|
+
* Support `--enable-load-relative` inside binstubs. Pull request #2929 by
|
|
8
|
+
deivid-rodriguez
|
|
9
|
+
* Let `Version#<=>` accept a String. Pull request #5275 by amatsuda
|
|
10
|
+
* Installs bundler 2.3.6 as a default gem.
|
|
11
|
+
|
|
12
|
+
## Bug fixes:
|
|
13
|
+
|
|
14
|
+
* Avoid `flock` on non Windows systems, since it causing issues on NFS
|
|
15
|
+
file systems. Pull request #5278 by deivid-rodriguez
|
|
16
|
+
* Fix `gem update --system` for already installed version of
|
|
17
|
+
`rubygems-update`. Pull request #5285 by loadkpi
|
|
18
|
+
|
|
1
19
|
# 3.3.5 / 2022-01-12
|
|
2
20
|
|
|
3
21
|
## Enhancements:
|
data/bundler/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# 2.3.6 (January 26, 2022)
|
|
2
|
+
|
|
3
|
+
## Enhancements:
|
|
4
|
+
|
|
5
|
+
- Use `Gem::Platform.local` instead of `RUBY_PLATFORM` when displaying local platform [#5306](https://github.com/rubygems/rubygems/pull/5306)
|
|
6
|
+
- Lock standard.yml to the required ruby version [#5284](https://github.com/rubygems/rubygems/pull/5284)
|
|
7
|
+
- Use `Fiddle` in `bundle doctor` to check for dynamic library presence [#5173](https://github.com/rubygems/rubygems/pull/5173)
|
|
8
|
+
|
|
9
|
+
## Bug fixes:
|
|
10
|
+
|
|
11
|
+
- Fix edge case where gems were incorrectly removed from the lockfile [#5302](https://github.com/rubygems/rubygems/pull/5302)
|
|
12
|
+
- Fix `force_ruby_platform` ignored when lockfile includes current specific platform [#5304](https://github.com/rubygems/rubygems/pull/5304)
|
|
13
|
+
- Create minitest file to underscored path in "bundle gem" command with dashed gem name [#5273](https://github.com/rubygems/rubygems/pull/5273)
|
|
14
|
+
- Fix regression with old marshaled specs having null `required_rubygems_version` [#5291](https://github.com/rubygems/rubygems/pull/5291)
|
|
15
|
+
|
|
1
16
|
# 2.3.5 (January 12, 2022)
|
|
2
17
|
|
|
3
18
|
## 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 = "2022-01-
|
|
8
|
-
@git_commit_sha = "
|
|
7
|
+
@built_at = "2022-01-26".freeze
|
|
8
|
+
@git_commit_sha = "056f64c33a".freeze
|
|
9
9
|
@release = true
|
|
10
10
|
# end ivars
|
|
11
11
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require "rbconfig"
|
|
4
4
|
require "shellwords"
|
|
5
|
+
require "fiddle"
|
|
5
6
|
|
|
6
7
|
module Bundler
|
|
7
8
|
class CLI::Doctor
|
|
@@ -71,7 +72,14 @@ module Bundler
|
|
|
71
72
|
|
|
72
73
|
definition.specs.each do |spec|
|
|
73
74
|
bundles_for_gem(spec).each do |bundle|
|
|
74
|
-
bad_paths = dylibs(bundle).select
|
|
75
|
+
bad_paths = dylibs(bundle).select do |f|
|
|
76
|
+
begin
|
|
77
|
+
Fiddle.dlopen(f)
|
|
78
|
+
false
|
|
79
|
+
rescue Fiddle::DLError
|
|
80
|
+
true
|
|
81
|
+
end
|
|
82
|
+
end
|
|
75
83
|
if bad_paths.any?
|
|
76
84
|
broken_links[spec] ||= []
|
|
77
85
|
broken_links[spec].concat(bad_paths)
|
|
@@ -38,6 +38,7 @@ module Bundler
|
|
|
38
38
|
namespaced_path = name.tr("-", "/")
|
|
39
39
|
constant_name = name.gsub(/-[_-]*(?![_-]|$)/) { "::" }.gsub(/([_-]+|(::)|^)(.|$)/) { $2.to_s + $3.upcase }
|
|
40
40
|
constant_array = constant_name.split("::")
|
|
41
|
+
minitest_constant_name = constant_array.clone.tap {|a| a[-1] = "Test#{a[-1]}" }.join("::") # Foo::Bar => Foo::TestBar
|
|
41
42
|
|
|
42
43
|
use_git = Bundler.git_present? && options[:git]
|
|
43
44
|
|
|
@@ -69,6 +70,7 @@ module Bundler
|
|
|
69
70
|
:git => use_git,
|
|
70
71
|
:github_username => github_username.empty? ? "[USERNAME]" : github_username,
|
|
71
72
|
:required_ruby_version => required_ruby_version,
|
|
73
|
+
:minitest_constant_name => minitest_constant_name,
|
|
72
74
|
}
|
|
73
75
|
ensure_safe_gem_name(name, constant_array)
|
|
74
76
|
|
|
@@ -104,9 +106,17 @@ module Bundler
|
|
|
104
106
|
)
|
|
105
107
|
config[:test_task] = :spec
|
|
106
108
|
when "minitest"
|
|
109
|
+
# Generate path for minitest target file (FileList["test/**/test_*.rb"])
|
|
110
|
+
# foo => test/test_foo.rb
|
|
111
|
+
# foo-bar => test/foo/test_bar.rb
|
|
112
|
+
# foo_bar => test/test_foo_bar.rb
|
|
113
|
+
paths = namespaced_path.rpartition("/")
|
|
114
|
+
paths[2] = "test_#{paths[2]}"
|
|
115
|
+
minitest_namespaced_path = paths.join("")
|
|
116
|
+
|
|
107
117
|
templates.merge!(
|
|
108
118
|
"test/minitest/test_helper.rb.tt" => "test/test_helper.rb",
|
|
109
|
-
"test/minitest/test_newgem.rb.tt" => "test
|
|
119
|
+
"test/minitest/test_newgem.rb.tt" => "test/#{minitest_namespaced_path}.rb"
|
|
110
120
|
)
|
|
111
121
|
config[:test_task] = :test
|
|
112
122
|
when "test-unit"
|
|
@@ -23,7 +23,7 @@ module Bundler
|
|
|
23
23
|
output << "No ruby version specified"
|
|
24
24
|
end
|
|
25
25
|
else
|
|
26
|
-
output << "Your platform is: #{
|
|
26
|
+
output << "Your platform is: #{Gem::Platform.local}"
|
|
27
27
|
output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}"
|
|
28
28
|
|
|
29
29
|
if ruby_version
|
|
@@ -265,7 +265,7 @@ module Bundler
|
|
|
265
265
|
else
|
|
266
266
|
# Run a resolve against the locally available gems
|
|
267
267
|
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
|
|
268
|
-
expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies,
|
|
268
|
+
expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
|
|
269
269
|
Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
|
|
270
270
|
end
|
|
271
271
|
end
|
|
@@ -495,6 +495,7 @@ module Bundler
|
|
|
495
495
|
|
|
496
496
|
def current_ruby_platform_locked?
|
|
497
497
|
return false unless generic_local_platform == Gem::Platform::RUBY
|
|
498
|
+
return false if Bundler.settings[:force_ruby_platform] && !@platforms.include?(Gem::Platform::RUBY)
|
|
498
499
|
|
|
499
500
|
current_platform_locked?
|
|
500
501
|
end
|
data/bundler/lib/bundler/env.rb
CHANGED
|
@@ -71,7 +71,7 @@ module Bundler
|
|
|
71
71
|
def self.ruby_version
|
|
72
72
|
str = String.new(RUBY_VERSION)
|
|
73
73
|
str << "p#{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
|
|
74
|
-
str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{
|
|
74
|
+
str << " (#{RUBY_RELEASE_DATE} revision #{RUBY_REVISION}) [#{Gem::Platform.local}]"
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def self.git_version
|
|
@@ -27,6 +27,13 @@ module Bundler
|
|
|
27
27
|
@platform = _remote_specification.platform
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
# A fallback is included because the original version of the specification
|
|
31
|
+
# API didn't include that field, so some marshalled specs in the index have it
|
|
32
|
+
# set to +nil+.
|
|
33
|
+
def required_rubygems_version
|
|
34
|
+
@required_rubygems_version ||= _remote_specification.required_rubygems_version || Gem::Requirement.default
|
|
35
|
+
end
|
|
36
|
+
|
|
30
37
|
def full_name
|
|
31
38
|
if platform == Gem::Platform::RUBY || platform.nil?
|
|
32
39
|
"#{@name}-#{@version}"
|
|
@@ -249,10 +249,11 @@ module Bundler
|
|
|
249
249
|
end
|
|
250
250
|
|
|
251
251
|
def verify_gemfile_dependencies_are_found!(requirements)
|
|
252
|
-
requirements.
|
|
252
|
+
requirements.map! do |requirement|
|
|
253
253
|
name = requirement.name
|
|
254
|
-
next if name == "bundler"
|
|
255
|
-
next unless search_for(requirement).empty?
|
|
254
|
+
next requirement if name == "bundler"
|
|
255
|
+
next requirement unless search_for(requirement).empty?
|
|
256
|
+
next unless requirement.current_platform?
|
|
256
257
|
|
|
257
258
|
if (base = @base[name]) && !base.empty?
|
|
258
259
|
version = base.first.version
|
|
@@ -266,7 +267,7 @@ module Bundler
|
|
|
266
267
|
message = gem_not_found_message(name, requirement, source_for(name))
|
|
267
268
|
end
|
|
268
269
|
raise GemNotFound, message
|
|
269
|
-
end
|
|
270
|
+
end.compact!
|
|
270
271
|
end
|
|
271
272
|
|
|
272
273
|
def gem_not_found_message(name, requirement, source, extra_message = "")
|
|
@@ -289,14 +289,14 @@ class Gem::BasicSpecification
|
|
|
289
289
|
|
|
290
290
|
def lib_dirs_glob
|
|
291
291
|
dirs = if self.raw_require_paths
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
292
|
+
if self.raw_require_paths.size > 1
|
|
293
|
+
"{#{self.raw_require_paths.join(',')}}"
|
|
294
|
+
else
|
|
295
|
+
self.raw_require_paths.first
|
|
296
|
+
end
|
|
297
|
+
else
|
|
298
|
+
"lib" # default value for require_paths for bundler/inline
|
|
299
|
+
end
|
|
300
300
|
|
|
301
301
|
"#{self.full_gem_path}/#{dirs}".dup.tap(&Gem::UNTAINT)
|
|
302
302
|
end
|
|
@@ -65,9 +65,9 @@ module Gem::BundlerVersionFinder
|
|
|
65
65
|
return unless gemfile
|
|
66
66
|
|
|
67
67
|
lockfile = case gemfile
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
when "gems.rb" then "gems.locked"
|
|
69
|
+
else "#{gemfile}.lock"
|
|
70
|
+
end.dup.tap(&Gem::UNTAINT)
|
|
71
71
|
|
|
72
72
|
return unless File.file?(lockfile)
|
|
73
73
|
|
data/lib/rubygems/command.rb
CHANGED
|
@@ -398,10 +398,10 @@ class Gem::Command
|
|
|
398
398
|
version_to_expire = deprecation["rg_version_to_expire"]
|
|
399
399
|
|
|
400
400
|
deprecate_option_msg = if version_to_expire
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
401
|
+
"The \"#{option}\" option has been deprecated and will be removed in Rubygems #{version_to_expire}."
|
|
402
|
+
else
|
|
403
|
+
"The \"#{option}\" option has been deprecated and will be removed in future versions of Rubygems."
|
|
404
|
+
end
|
|
405
405
|
|
|
406
406
|
extra_msg = deprecation["extra_msg"]
|
|
407
407
|
|
|
@@ -117,12 +117,12 @@ If no gems are named all gems in GEM_HOME are cleaned.
|
|
|
117
117
|
|
|
118
118
|
def get_candidate_gems
|
|
119
119
|
@candidate_gems = unless options[:args].empty?
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
options[:args].map do |gem_name|
|
|
121
|
+
Gem::Specification.find_all_by_name gem_name
|
|
122
|
+
end.flatten
|
|
123
|
+
else
|
|
124
|
+
Gem::Specification.to_a
|
|
125
|
+
end
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
def get_gems_to_cleanup
|
|
@@ -53,41 +53,41 @@ use with other commands.
|
|
|
53
53
|
"#{program_name} REGEXP"
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
-
def fetch_remote_specs(
|
|
56
|
+
def fetch_remote_specs(name, requirement, prerelease) # :nodoc:
|
|
57
57
|
fetcher = Gem::SpecFetcher.fetcher
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
specs_type = prerelease ? :complete : :released
|
|
60
60
|
|
|
61
|
-
ss
|
|
61
|
+
ss = if name.nil?
|
|
62
|
+
fetcher.detect(specs_type) { true }
|
|
63
|
+
else
|
|
64
|
+
fetcher.detect(specs_type) do |name_tuple|
|
|
65
|
+
name === name_tuple.name && requirement.satisfied_by?(name_tuple.version)
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
ss.map {|tuple, source| source.fetch_spec(tuple) }
|
|
62
70
|
end
|
|
63
71
|
|
|
64
|
-
def fetch_specs(name_pattern,
|
|
72
|
+
def fetch_specs(name_pattern, requirement, prerelease) # :nodoc:
|
|
65
73
|
specs = []
|
|
66
74
|
|
|
67
75
|
if local?
|
|
68
76
|
specs.concat Gem::Specification.stubs.find_all {|spec|
|
|
69
|
-
name_pattern =~ spec.name
|
|
70
|
-
|
|
77
|
+
name_matches = name_pattern ? name_pattern =~ spec.name : true
|
|
78
|
+
version_matches = requirement.satisfied_by?(spec.version)
|
|
79
|
+
|
|
80
|
+
name_matches and version_matches
|
|
71
81
|
}.map(&:to_spec)
|
|
72
82
|
end
|
|
73
83
|
|
|
74
|
-
specs.concat fetch_remote_specs
|
|
84
|
+
specs.concat fetch_remote_specs name_pattern, requirement, prerelease if remote?
|
|
75
85
|
|
|
76
86
|
ensure_specs specs
|
|
77
87
|
|
|
78
88
|
specs.uniq.sort
|
|
79
89
|
end
|
|
80
90
|
|
|
81
|
-
def gem_dependency(pattern, version, prerelease) # :nodoc:
|
|
82
|
-
dependency = Gem::Deprecate.skip_during do
|
|
83
|
-
Gem::Dependency.new pattern, version
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
dependency.prerelease = prerelease
|
|
87
|
-
|
|
88
|
-
dependency
|
|
89
|
-
end
|
|
90
|
-
|
|
91
91
|
def display_pipe(specs) # :nodoc:
|
|
92
92
|
specs.each do |spec|
|
|
93
93
|
unless spec.dependencies.empty?
|
|
@@ -119,11 +119,9 @@ use with other commands.
|
|
|
119
119
|
ensure_local_only_reverse_dependencies
|
|
120
120
|
|
|
121
121
|
pattern = name_pattern options[:args]
|
|
122
|
+
requirement = Gem::Requirement.new options[:version]
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
gem_dependency pattern, options[:version], options[:prerelease]
|
|
125
|
-
|
|
126
|
-
specs = fetch_specs pattern, dependency
|
|
124
|
+
specs = fetch_specs pattern, requirement, options[:prerelease]
|
|
127
125
|
|
|
128
126
|
reverse = reverse_dependencies specs
|
|
129
127
|
|
|
@@ -162,14 +160,6 @@ use with other commands.
|
|
|
162
160
|
response
|
|
163
161
|
end
|
|
164
162
|
|
|
165
|
-
def remote_specs(dependency) # :nodoc:
|
|
166
|
-
fetcher = Gem::SpecFetcher.fetcher
|
|
167
|
-
|
|
168
|
-
ss, _ = fetcher.spec_for_dependency dependency
|
|
169
|
-
|
|
170
|
-
ss.map {|s,o| s }
|
|
171
|
-
end
|
|
172
|
-
|
|
173
163
|
def reverse_dependencies(specs) # :nodoc:
|
|
174
164
|
reverse = Hash.new {|h, k| h[k] = [] }
|
|
175
165
|
|
|
@@ -205,7 +195,7 @@ use with other commands.
|
|
|
205
195
|
private
|
|
206
196
|
|
|
207
197
|
def name_pattern(args)
|
|
208
|
-
|
|
198
|
+
return if args.empty?
|
|
209
199
|
|
|
210
200
|
if args.length == 1 and args.first =~ /\A(.*)(i)?\z/m
|
|
211
201
|
flags = $2 ? Regexp::IGNORECASE : nil
|
|
@@ -10,7 +10,7 @@ class Gem::Commands::ListCommand < Gem::Command
|
|
|
10
10
|
|
|
11
11
|
def initialize
|
|
12
12
|
super 'list', 'Display local gems whose name matches REGEXP',
|
|
13
|
-
:
|
|
13
|
+
:domain => :local, :details => false, :versions => true,
|
|
14
14
|
:installed => nil, :version => Gem::Requirement.default
|
|
15
15
|
|
|
16
16
|
add_query_options
|
|
@@ -98,20 +98,20 @@ extensions will be restored.
|
|
|
98
98
|
|
|
99
99
|
def execute
|
|
100
100
|
specs = if options[:all]
|
|
101
|
-
|
|
101
|
+
Gem::Specification.map
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
# `--extensions` must be explicitly given to pristine only gems
|
|
104
|
+
# with extensions.
|
|
105
|
+
elsif options[:extensions_set] and
|
|
106
106
|
options[:extensions] and options[:args].empty?
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
Gem::Specification.select do |spec|
|
|
108
|
+
spec.extensions and not spec.extensions.empty?
|
|
109
|
+
end
|
|
110
|
+
else
|
|
111
|
+
get_all_gem_names.sort.map do |gem_name|
|
|
112
|
+
Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse
|
|
113
|
+
end.flatten
|
|
114
|
+
end
|
|
115
115
|
|
|
116
116
|
specs = specs.select{|spec| RUBY_ENGINE == spec.platform || Gem::Platform.local === spec.platform || spec.platform == Gem::Platform::RUBY }
|
|
117
117
|
|
|
@@ -52,14 +52,14 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo
|
|
|
52
52
|
default_gem_server, push_host = get_hosts_for(gem_name)
|
|
53
53
|
|
|
54
54
|
@host = if @user_defined_host
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
options[:host]
|
|
56
|
+
elsif default_gem_server
|
|
57
|
+
default_gem_server
|
|
58
|
+
elsif push_host
|
|
59
|
+
push_host
|
|
60
|
+
else
|
|
61
|
+
options[:host]
|
|
62
|
+
end
|
|
63
63
|
|
|
64
64
|
sign_in @host, scope: get_push_scope
|
|
65
65
|
|
|
@@ -20,7 +20,7 @@ class Gem::Commands::QueryCommand < Gem::Command
|
|
|
20
20
|
def initialize(name = 'query',
|
|
21
21
|
summary = 'Query gem information in local or remote repositories')
|
|
22
22
|
super name, summary,
|
|
23
|
-
:
|
|
23
|
+
:domain => :local, :details => false, :versions => true,
|
|
24
24
|
:installed => nil, :version => Gem::Requirement.default
|
|
25
25
|
|
|
26
26
|
add_option('-n', '--name-matches REGEXP',
|
|
@@ -61,12 +61,12 @@ Use --overwrite to force rebuilding of documentation.
|
|
|
61
61
|
|
|
62
62
|
def execute
|
|
63
63
|
specs = if options[:all]
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
Gem::Specification.to_a
|
|
65
|
+
else
|
|
66
|
+
get_all_gem_names.map do |name|
|
|
67
|
+
Gem::Specification.find_by_name name, options[:version]
|
|
68
|
+
end.flatten.uniq
|
|
69
|
+
end
|
|
70
70
|
|
|
71
71
|
if specs.empty?
|
|
72
72
|
alert_error 'No matching gems found'
|
|
@@ -7,7 +7,7 @@ class Gem::Commands::SearchCommand < Gem::Command
|
|
|
7
7
|
|
|
8
8
|
def initialize
|
|
9
9
|
super 'search', 'Display remote gems whose name matches REGEXP',
|
|
10
|
-
:
|
|
10
|
+
:domain => :remote, :details => false, :versions => true,
|
|
11
11
|
:installed => nil, :version => Gem::Requirement.default
|
|
12
12
|
|
|
13
13
|
add_query_options
|
|
@@ -54,10 +54,10 @@ class Gem::Commands::SetupCommand < Gem::Command
|
|
|
54
54
|
'List the documentation types you wish to',
|
|
55
55
|
'generate. For example: rdoc,ri' do |value, options|
|
|
56
56
|
options[:document] = case value
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
when nil then %w[rdoc ri]
|
|
58
|
+
when false then []
|
|
59
|
+
else value
|
|
60
|
+
end
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
add_option '--[no-]rdoc',
|
|
@@ -666,10 +666,10 @@ abort "#{deprecation_message}"
|
|
|
666
666
|
|
|
667
667
|
def target_bin_path(bin_dir, bin_file)
|
|
668
668
|
bin_file_formatted = if options[:format_executable]
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
669
|
+
Gem.default_exec_format % bin_file
|
|
670
|
+
else
|
|
671
|
+
bin_file
|
|
672
|
+
end
|
|
673
673
|
File.join bin_dir, bin_file_formatted
|
|
674
674
|
end
|
|
675
675
|
|
|
@@ -140,10 +140,10 @@ Specific fields in the specification can be extracted in YAML format:
|
|
|
140
140
|
s = s.send field if field
|
|
141
141
|
|
|
142
142
|
say case options[:format]
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
when :ruby then s.to_ruby
|
|
144
|
+
when :marshal then Marshal.dump s
|
|
145
|
+
else s.to_yaml
|
|
146
|
+
end
|
|
147
147
|
|
|
148
148
|
say "\n"
|
|
149
149
|
end
|
|
@@ -233,10 +233,10 @@ command to remove old versions.
|
|
|
233
233
|
up_ver = gems_to_update.first.version
|
|
234
234
|
|
|
235
235
|
target = if update_latest
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
236
|
+
up_ver
|
|
237
|
+
else
|
|
238
|
+
version
|
|
239
|
+
end
|
|
240
240
|
|
|
241
241
|
return target, requirement
|
|
242
242
|
end
|
|
@@ -287,7 +287,7 @@ command to remove old versions.
|
|
|
287
287
|
check_oldest_rubygems version
|
|
288
288
|
|
|
289
289
|
installed_gems = Gem::Specification.find_all_by_name 'rubygems-update', requirement
|
|
290
|
-
installed_gems = update_gem('rubygems-update', version) if installed_gems.empty?
|
|
290
|
+
installed_gems = update_gem('rubygems-update', version) if installed_gems.empty? || installed_gems.first.version != version
|
|
291
291
|
return if installed_gems.empty?
|
|
292
292
|
|
|
293
293
|
version = installed_gems.first.version
|
|
@@ -336,7 +336,9 @@ command to remove old versions.
|
|
|
336
336
|
#
|
|
337
337
|
def oldest_supported_version
|
|
338
338
|
@oldest_supported_version ||=
|
|
339
|
-
if Gem.ruby_version > Gem::Version.new("3.
|
|
339
|
+
if Gem.ruby_version > Gem::Version.new("3.1.a")
|
|
340
|
+
Gem::Version.new("3.3.3")
|
|
341
|
+
elsif Gem.ruby_version > Gem::Version.new("3.0.a")
|
|
340
342
|
Gem::Version.new("3.2.3")
|
|
341
343
|
elsif Gem.ruby_version > Gem::Version.new("2.7.a")
|
|
342
344
|
Gem::Version.new("3.1.2")
|
data/lib/rubygems/config_file.rb
CHANGED
|
@@ -281,10 +281,10 @@ if you believe they were disclosed to a third party.
|
|
|
281
281
|
check_credentials_permissions
|
|
282
282
|
|
|
283
283
|
@api_keys = if File.exist? credentials_path
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
284
|
+
load_file(credentials_path)
|
|
285
|
+
else
|
|
286
|
+
@hash
|
|
287
|
+
end
|
|
288
288
|
|
|
289
289
|
if @api_keys.key? :rubygems_api_key
|
|
290
290
|
@rubygems_api_key = @api_keys[:rubygems_api_key]
|
data/lib/rubygems/doctor.rb
CHANGED
|
@@ -117,11 +117,11 @@ class Gem::Doctor
|
|
|
117
117
|
type = File.directory?(child) ? 'directory' : 'file'
|
|
118
118
|
|
|
119
119
|
action = if @dry_run
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
'Extra'
|
|
121
|
+
else
|
|
122
|
+
FileUtils.rm_r(child)
|
|
123
|
+
'Removed'
|
|
124
|
+
end
|
|
125
125
|
|
|
126
126
|
say "#{action} #{type} #{sub_directory}/#{File.basename(child)}"
|
|
127
127
|
end
|
data/lib/rubygems/gem_runner.rb
CHANGED
|
@@ -42,11 +42,11 @@ class Gem::GemRunner
|
|
|
42
42
|
cmd.command_names.each do |command_name|
|
|
43
43
|
config_args = Gem.configuration[command_name]
|
|
44
44
|
config_args = case config_args
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
when String
|
|
46
|
+
config_args.split ' '
|
|
47
|
+
else
|
|
48
|
+
Array(config_args)
|
|
49
|
+
end
|
|
50
50
|
Gem::Command.add_specific_extra_args command_name, config_args
|
|
51
51
|
end
|
|
52
52
|
|