rubygems-update 4.0.19 → 4.0.20
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 +16 -0
- data/bundler/CHANGELOG.md +22 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/doctor/diagnose.rb +1 -1
- data/bundler/lib/bundler/cli/exec.rb +15 -1
- data/bundler/lib/bundler/cli/init.rb +4 -0
- data/bundler/lib/bundler/cli/outdated.rb +37 -7
- data/bundler/lib/bundler/dsl.rb +1 -1
- data/bundler/lib/bundler/gem_helper.rb +2 -2
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +7 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +4 -0
- data/bundler/lib/bundler/man/bundle-platform.1.ronn +4 -0
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/man/gemfile.5.ronn +3 -1
- data/bundler/lib/bundler/runtime.rb +11 -11
- data/bundler/lib/bundler/shared_helpers.rb +15 -0
- data/bundler/lib/bundler/source/git/git_proxy.rb +64 -3
- data/bundler/lib/bundler/source/git.rb +4 -4
- data/bundler/lib/bundler/source/path.rb +1 -1
- data/bundler/lib/bundler/source/rubygems.rb +1 -1
- data/bundler/lib/bundler/stub_specification.rb +3 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +15 -5
- data/lib/rubygems/command.rb +1 -1
- data/lib/rubygems/commands/contents_command.rb +14 -6
- data/lib/rubygems/commands/exec_command.rb +1 -1
- data/lib/rubygems/commands/setup_command.rb +11 -38
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/config_file.rb +21 -10
- data/lib/rubygems/ext/builder.rb +3 -1
- data/lib/rubygems/security/signer.rb +1 -3
- data/lib/rubygems/update_suggestion.rb +6 -2
- data/lib/rubygems/util.rb +29 -5
- data/lib/rubygems.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c5b9e451752787719ea243e41b423937313b296fe80fcdb9e2278c47bce0311
|
|
4
|
+
data.tar.gz: 40407c5dda968a596b10a34cfe59e6884ed03a2224c43934aaf1b2dc86c7d0f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a98a6944def23e28a4f45a8be9d1d7fa36b488cf1add3e542ffae3ca9ace3adfde5499ddd36a0e1a15ad0baf363ab05509d4bcfd7d714d4209c6fcba1dc2a6b2
|
|
7
|
+
data.tar.gz: 5f399d26a853785b4ead62f67c12f84f7225af52cb700fb39fd50e8895e481d91c667b51d9b2c8df925f3c46477044d9704039c86a67bcdaeaff80c529f97f64
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.20 / 2026-09-02
|
|
4
|
+
|
|
5
|
+
### Enhancements:
|
|
6
|
+
|
|
7
|
+
* Print a release notes link instead of the whole changelog on `gem update --system`. Pull request [#9794](https://github.com/ruby/rubygems/pull/9794) by hsbt
|
|
8
|
+
* Installs bundler 4.0.20 as a default gem.
|
|
9
|
+
|
|
10
|
+
### Bug fixes:
|
|
11
|
+
|
|
12
|
+
* Only coerce exact true and false gemrc values to booleans. Pull request [#9822](https://github.com/ruby/rubygems/pull/9822) by hsbt
|
|
13
|
+
* Make the gem CLI work under RUBY_BOX=1. Pull request [#9810](https://github.com/ruby/rubygems/pull/9810) by hsbt
|
|
14
|
+
|
|
15
|
+
### Documentation:
|
|
16
|
+
|
|
17
|
+
* Document and test all available gemrc configuration keys. Pull request [#9568](https://github.com/ruby/rubygems/pull/9568) by junaruga
|
|
18
|
+
|
|
3
19
|
## 4.0.19 / 2026-08-20
|
|
4
20
|
|
|
5
21
|
### Enhancements:
|
data/bundler/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.20 / 2026-09-02
|
|
4
|
+
|
|
5
|
+
### Enhancements:
|
|
6
|
+
|
|
7
|
+
* Avoid duplicate relative path prefix in bundle exec. Pull request [#9596](https://github.com/ruby/rubygems/pull/9596) by samuel-williams-shopify
|
|
8
|
+
* Follow renamed default branch in git sources. Pull request [#9813](https://github.com/ruby/rubygems/pull/9813) by hsbt
|
|
9
|
+
* Bundler::Source::Git: avoid re-fetching the repo. Pull request [#9806](https://github.com/ruby/rubygems/pull/9806) by byroot
|
|
10
|
+
* Show the newest out-of-cooldown version in bundle outdated. Pull request [#9803](https://github.com/ruby/rubygems/pull/9803) by hsbt
|
|
11
|
+
|
|
12
|
+
### Bug fixes:
|
|
13
|
+
|
|
14
|
+
* Error out when `bundle init --gemspec` gets no specification. Pull request [#9818](https://github.com/ruby/rubygems/pull/9818) by hsbt
|
|
15
|
+
* Fix relative gemspec paths being expanded twice. Pull request [#9814](https://github.com/ruby/rubygems/pull/9814) by hsbt
|
|
16
|
+
* Fix gemspec evaluation under Ruby::Box. Pull request [#9809](https://github.com/ruby/rubygems/pull/9809) by hsbt
|
|
17
|
+
* Fix release date extraction for the current changelog header format. Pull request [#9767](https://github.com/ruby/rubygems/pull/9767) by meganemura
|
|
18
|
+
* Resolve globbed entries literally in Gem::Util.glob_files_in_dir. Pull request [#9802](https://github.com/ruby/rubygems/pull/9802) by hsbt
|
|
19
|
+
* Preserve native extensions during implicit clean. Pull request [#9800](https://github.com/ruby/rubygems/pull/9800) by sjh9714
|
|
20
|
+
|
|
21
|
+
### Documentation:
|
|
22
|
+
|
|
23
|
+
* Clarify :path expectations and cross-link platform docs in man pages. Pull request [#9724](https://github.com/ruby/rubygems/pull/9724) by hsbt
|
|
24
|
+
|
|
3
25
|
## 4.0.19 / 2026-08-20
|
|
4
26
|
|
|
5
27
|
### 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 =
|
|
8
|
-
@git_commit_sha = "
|
|
7
|
+
@built_at = "2026-09-02".freeze
|
|
8
|
+
@git_commit_sha = "7f2502dc32b".freeze
|
|
9
9
|
# end ivars
|
|
10
10
|
|
|
11
11
|
# A hash representation of the build metadata.
|
|
@@ -23,7 +23,7 @@ module Bundler
|
|
|
23
23
|
bin_path.delete_suffix!(".bat") if Gem.win_platform?
|
|
24
24
|
kernel_load(bin_path, *args)
|
|
25
25
|
else
|
|
26
|
-
bin_path =
|
|
26
|
+
bin_path = explicit_path(bin_path)
|
|
27
27
|
kernel_exec(bin_path, *args)
|
|
28
28
|
end
|
|
29
29
|
else
|
|
@@ -71,6 +71,20 @@ module Bundler
|
|
|
71
71
|
"#{file} #{args.join(" ")}".strip
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
+
def explicit_path(path)
|
|
75
|
+
if File.absolute_path?(path) || explicit_relative_path?(path)
|
|
76
|
+
path
|
|
77
|
+
else
|
|
78
|
+
".#{File::SEPARATOR}#{path}"
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def explicit_relative_path?(path)
|
|
83
|
+
[File::SEPARATOR, File::ALT_SEPARATOR].compact.any? do |separator|
|
|
84
|
+
path.start_with?(".#{separator}", "..#{separator}")
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
74
88
|
def directly_loadable?(file)
|
|
75
89
|
if Gem.win_platform?
|
|
76
90
|
script_wrapper?(file)
|
|
@@ -26,6 +26,10 @@ module Bundler
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
spec = Bundler.load_gemspec_uncached(gemspec)
|
|
29
|
+
unless spec
|
|
30
|
+
Bundler.ui.error "Gem specification #{gemspec} did not produce a specification"
|
|
31
|
+
exit 1
|
|
32
|
+
end
|
|
29
33
|
|
|
30
34
|
File.open(gemfile, "wb") do |file|
|
|
31
35
|
file << "# Generated from #{gemspec}\n"
|
|
@@ -158,11 +158,29 @@ module Bundler
|
|
|
158
158
|
|
|
159
159
|
return active_spec if strict
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
matching_specs(active_spec, current_spec).last
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def matching_specs(active_spec, current_spec)
|
|
165
|
+
@matching_specs ||= {}
|
|
166
|
+
@matching_specs[[active_spec.source, current_spec.name, current_spec.platform]] ||= begin
|
|
167
|
+
active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.installable_on_platform?(current_spec.platform) }.sort_by(&:version)
|
|
168
|
+
if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
|
|
169
|
+
active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
|
|
170
|
+
end
|
|
171
|
+
active_specs
|
|
164
172
|
end
|
|
165
|
-
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# The newest version the cooldown setting would let bundler adopt right
|
|
176
|
+
# now, when the newest overall version is still inside the window. Only a
|
|
177
|
+
# version strictly between the installed one and the newest one is an
|
|
178
|
+
# adoptable update worth showing.
|
|
179
|
+
def newest_out_of_cooldown(active_spec, current_spec)
|
|
180
|
+
newest = matching_specs(active_spec, current_spec).reverse_each.find {|spec| cooldown_days_remaining(spec).nil? }
|
|
181
|
+
return unless newest
|
|
182
|
+
return if newest.version >= active_spec.version || newest.version <= current_spec.version
|
|
183
|
+
newest
|
|
166
184
|
end
|
|
167
185
|
|
|
168
186
|
def print_gems(gems_list)
|
|
@@ -208,7 +226,11 @@ module Bundler
|
|
|
208
226
|
spec_outdated_info += ", released #{release_date}" unless release_date.empty?
|
|
209
227
|
|
|
210
228
|
remaining = cooldown_days_remaining(active_spec)
|
|
211
|
-
|
|
229
|
+
if remaining
|
|
230
|
+
spec_outdated_info += ", in cooldown for #{remaining} more day#{"s" if remaining > 1}"
|
|
231
|
+
adoptable = newest_out_of_cooldown(active_spec, current_spec)
|
|
232
|
+
spec_outdated_info += ", newest out of cooldown #{adoptable.version}" if adoptable
|
|
233
|
+
end
|
|
212
234
|
|
|
213
235
|
spec_outdated_info += ")"
|
|
214
236
|
|
|
@@ -227,7 +249,11 @@ module Bundler
|
|
|
227
249
|
current_version = "#{current_spec.version}#{current_spec.git_version}"
|
|
228
250
|
spec_version = "#{active_spec.version}#{active_spec.git_version}"
|
|
229
251
|
remaining = cooldown_days_remaining(active_spec)
|
|
230
|
-
|
|
252
|
+
if remaining
|
|
253
|
+
adoptable = newest_out_of_cooldown(active_spec, current_spec)
|
|
254
|
+
adoptable_note = adoptable ? ", #{adoptable.version} out of cooldown" : ""
|
|
255
|
+
spec_version += " (cooldown #{remaining}d#{adoptable_note})"
|
|
256
|
+
end
|
|
231
257
|
dependency = dependency.requirement if dependency
|
|
232
258
|
|
|
233
259
|
ret_val = [active_spec.name, current_version, spec_version, dependency.to_s, groups.to_s]
|
|
@@ -236,7 +262,7 @@ module Bundler
|
|
|
236
262
|
ret_val
|
|
237
263
|
end
|
|
238
264
|
|
|
239
|
-
def cooldown_days_remaining(spec, now =
|
|
265
|
+
def cooldown_days_remaining(spec, now = cooldown_now)
|
|
240
266
|
return nil unless spec.respond_to?(:created_at) && spec.created_at
|
|
241
267
|
return nil unless spec.respond_to?(:remote) && spec.remote
|
|
242
268
|
days = spec.remote.effective_cooldown
|
|
@@ -245,6 +271,10 @@ module Bundler
|
|
|
245
271
|
remaining > 0 ? remaining.ceil : nil
|
|
246
272
|
end
|
|
247
273
|
|
|
274
|
+
def cooldown_now
|
|
275
|
+
@cooldown_now ||= Time.now
|
|
276
|
+
end
|
|
277
|
+
|
|
248
278
|
def check_for_deployment_mode!
|
|
249
279
|
return unless Bundler.frozen_bundle?
|
|
250
280
|
suggested_command = if Bundler.settings.locations("frozen").keys.&([:global, :local]).any?
|
data/bundler/lib/bundler/dsl.rb
CHANGED
|
@@ -68,7 +68,7 @@ module Bundler
|
|
|
68
68
|
development_group = opts[:development_group] || :development
|
|
69
69
|
expanded_path = gemfile_root.join(path)
|
|
70
70
|
|
|
71
|
-
gemspecs =
|
|
71
|
+
gemspecs = SharedHelpers.glob_files_in_dir("{,*}.gemspec", expanded_path).filter_map {|g| Bundler.load_gemspec(g) }
|
|
72
72
|
gemspecs.reject! {|s| s.name != name } if name
|
|
73
73
|
specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] }
|
|
74
74
|
|
|
@@ -32,7 +32,7 @@ module Bundler
|
|
|
32
32
|
|
|
33
33
|
def initialize(base = nil, name = nil)
|
|
34
34
|
@base = File.expand_path(base || SharedHelpers.pwd)
|
|
35
|
-
gemspecs = name ? [File.join(@base, "#{name}.gemspec")] :
|
|
35
|
+
gemspecs = name ? [File.join(@base, "#{name}.gemspec")] : SharedHelpers.glob_files_in_dir("{,*}.gemspec", @base)
|
|
36
36
|
raise "Unable to determine name from existing gemspec. Use :name => 'gemname' in #install_tasks to manually set it." unless gemspecs.size == 1
|
|
37
37
|
@spec_path = gemspecs.first
|
|
38
38
|
@gemspec = Bundler.load_gemspec(@spec_path)
|
|
@@ -124,7 +124,7 @@ module Bundler
|
|
|
124
124
|
end
|
|
125
125
|
|
|
126
126
|
def built_gem_path
|
|
127
|
-
|
|
127
|
+
SharedHelpers.glob_files_in_dir("#{name}-*.gem", base).sort_by {|f| File.mtime(f) }.last
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
def git_push(remote = nil)
|
|
@@ -55,7 +55,7 @@ Only list patch newer versions\.
|
|
|
55
55
|
Only list gems specified in your Gemfile, not their dependencies\.
|
|
56
56
|
.TP
|
|
57
57
|
\fB\-\-cooldown=<number>\fR
|
|
58
|
-
Annotate (rather than hide) versions that are still inside the cooldown window of \fInumber\fR days\. The prose output appends "in cooldown for Nd more days" and the table form adds "(cooldown Nd)" to the Latest column\. See \fBcooldown\fR in bundle\-config(1)\.
|
|
58
|
+
Annotate (rather than hide) versions that are still inside the cooldown window of \fInumber\fR days\. The prose output appends "in cooldown for Nd more days" and the table form adds "(cooldown Nd)" to the Latest column\. When a version outside the window is newer than the installed one, the prose output also appends "newest out of cooldown X" and the table form becomes "(cooldown Nd, X out of cooldown)"\. With \fB\-\-filter\-strict\fR (or \fB\-\-patch\fR, \fB\-\-minor\fR, \fB\-\-major\fR, which imply it), "newest" is already the cooldown\-filtered resolved version, so none of these annotations appear\. See \fBcooldown\fR in bundle\-config(1)\.
|
|
59
59
|
.SH "PATCH LEVEL OPTIONS"
|
|
60
60
|
See bundle update(1) \fIbundle\-update\.1\.html\fR for details\.
|
|
61
61
|
.SH "FILTERING OUTPUT"
|
|
@@ -76,7 +76,13 @@ are up to date, Bundler will exit with a status of 0. Otherwise, it will exit 1.
|
|
|
76
76
|
Annotate (rather than hide) versions that are still inside the
|
|
77
77
|
cooldown window of <number> days. The prose output appends "in
|
|
78
78
|
cooldown for Nd more days" and the table form adds "(cooldown Nd)" to
|
|
79
|
-
the Latest column.
|
|
79
|
+
the Latest column. When a version outside the window is newer than the
|
|
80
|
+
installed one, the prose output also appends "newest out of cooldown
|
|
81
|
+
X" and the table form becomes "(cooldown Nd, X out of cooldown)".
|
|
82
|
+
With `--filter-strict` (or `--patch`, `--minor`, `--major`, which
|
|
83
|
+
imply it), "newest" is already the cooldown-filtered resolved version,
|
|
84
|
+
so none of these annotations appear. See `cooldown` in
|
|
85
|
+
bundle-config(1).
|
|
80
86
|
|
|
81
87
|
## PATCH LEVEL OPTIONS
|
|
82
88
|
|
|
@@ -38,6 +38,8 @@ Your current platform satisfies the Ruby version requirement\.
|
|
|
38
38
|
.IP "" 0
|
|
39
39
|
.P
|
|
40
40
|
\fBplatform\fR lists all the platforms in your \fBGemfile\.lock\fR as well as the \fBruby\fR directive if applicable from your Gemfile(5)\. It also lets you know if the \fBruby\fR directive requirement has been met\. If \fBruby\fR directive doesn't match the running Ruby VM, it tells you what part does not\.
|
|
41
|
+
.P
|
|
42
|
+
For a detailed explanation of how bundler handles platforms, see the \fBPLATFORMS\fR section in Gemfile(5)\.
|
|
41
43
|
.SH "OPTIONS"
|
|
42
44
|
.TP
|
|
43
45
|
\fB\-\-ruby\fR
|
|
@@ -45,5 +47,7 @@ It will display the ruby directive information, so you don't have to parse it fr
|
|
|
45
47
|
.SH "SEE ALSO"
|
|
46
48
|
.IP "\(bu" 4
|
|
47
49
|
bundle\-lock(1) \fIbundle\-lock\.1\.html\fR
|
|
50
|
+
.IP "\(bu" 4
|
|
51
|
+
Gemfile(5) \fIgemfile\.5\.html\fR
|
|
48
52
|
.IP "" 0
|
|
49
53
|
|
|
@@ -38,6 +38,9 @@ If you run `bundle platform` on Ruby 3.1.2, it displays the following output:
|
|
|
38
38
|
if the `ruby` directive requirement has been met. If `ruby` directive doesn't
|
|
39
39
|
match the running Ruby VM, it tells you what part does not.
|
|
40
40
|
|
|
41
|
+
For a detailed explanation of how bundler handles platforms, see the
|
|
42
|
+
`PLATFORMS` section in Gemfile(5).
|
|
43
|
+
|
|
41
44
|
## OPTIONS
|
|
42
45
|
|
|
43
46
|
* `--ruby`:
|
|
@@ -47,3 +50,4 @@ match the running Ruby VM, it tells you what part does not.
|
|
|
47
50
|
## SEE ALSO
|
|
48
51
|
|
|
49
52
|
* [bundle-lock(1)](bundle-lock.1.html)
|
|
53
|
+
* [Gemfile(5)](gemfile.5.html)
|
|
@@ -392,7 +392,7 @@ gem "rails", git: "https://rails@bitbucket\.org/rails/rails\.git"
|
|
|
392
392
|
.P
|
|
393
393
|
Since the \fBbitbucket\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
|
|
394
394
|
.SS "PATH"
|
|
395
|
-
You can specify that a gem is located in a particular location on the file system\. Relative paths are resolved relative to the directory containing the \fBGemfile\fR\.
|
|
395
|
+
You can specify that a gem is located in a particular location on the file system\. Relative paths are resolved relative to the directory containing the \fBGemfile\fR\. The path must point to a directory containing the gem's unpacked source code, not to a packaged \fB\.gem\fR file\.
|
|
396
396
|
.P
|
|
397
397
|
Similar to the semantics of the \fB:git\fR option, the \fB:path\fR option requires that the directory in question either contains a \fB\.gemspec\fR for the gem, or that you specify an explicit version that bundler should use\.
|
|
398
398
|
.P
|
|
@@ -451,7 +451,9 @@ Since the `bitbucket` method is a specialization of `git_source`, it accepts a `
|
|
|
451
451
|
|
|
452
452
|
You can specify that a gem is located in a particular location
|
|
453
453
|
on the file system. Relative paths are resolved relative to the
|
|
454
|
-
directory containing the `Gemfile`.
|
|
454
|
+
directory containing the `Gemfile`. The path must point to a
|
|
455
|
+
directory containing the gem's unpacked source code, not to a
|
|
456
|
+
packaged `.gem` file.
|
|
455
457
|
|
|
456
458
|
Similar to the semantics of the `:git` option, the `:path`
|
|
457
459
|
option requires that the directory in question either contains
|
|
@@ -141,7 +141,7 @@ module Bundler
|
|
|
141
141
|
end
|
|
142
142
|
end
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
SharedHelpers.glob_files_in_dir("*/.git", cache_path.to_s).each do |git_dir|
|
|
145
145
|
FileUtils.rm_rf(git_dir)
|
|
146
146
|
FileUtils.touch(File.expand_path("../.bundlecache", git_dir))
|
|
147
147
|
end
|
|
@@ -159,13 +159,13 @@ module Bundler
|
|
|
159
159
|
end
|
|
160
160
|
|
|
161
161
|
def clean(dry_run = false)
|
|
162
|
-
gem_bins =
|
|
163
|
-
git_dirs =
|
|
164
|
-
git_cache_dirs =
|
|
165
|
-
gem_dirs =
|
|
166
|
-
gem_files =
|
|
167
|
-
gemspec_files =
|
|
168
|
-
extension_dirs =
|
|
162
|
+
gem_bins = SharedHelpers.glob_files_in_dir("bin/*", Gem.dir)
|
|
163
|
+
git_dirs = SharedHelpers.glob_files_in_dir("bundler/gems/*", Gem.dir)
|
|
164
|
+
git_cache_dirs = SharedHelpers.glob_files_in_dir("cache/bundler/git/*", Gem.dir)
|
|
165
|
+
gem_dirs = SharedHelpers.glob_files_in_dir("gems/*", Gem.dir)
|
|
166
|
+
gem_files = SharedHelpers.glob_files_in_dir("cache/*.gem", Gem.dir)
|
|
167
|
+
gemspec_files = SharedHelpers.glob_files_in_dir("specifications/*.gemspec", Gem.dir)
|
|
168
|
+
extension_dirs = SharedHelpers.glob_files_in_dir("extensions/*/*/*", Gem.dir) + SharedHelpers.glob_files_in_dir("bundler/gems/extensions/*/*/*", Gem.dir)
|
|
169
169
|
spec_gem_paths = []
|
|
170
170
|
# need to keep git sources around
|
|
171
171
|
spec_git_paths = @definition.spec_git_paths
|
|
@@ -232,7 +232,7 @@ module Bundler
|
|
|
232
232
|
private
|
|
233
233
|
|
|
234
234
|
def prune_gem_cache(resolve, cache_path)
|
|
235
|
-
cached =
|
|
235
|
+
cached = SharedHelpers.glob_files_in_dir("*.gem", cache_path.to_s)
|
|
236
236
|
|
|
237
237
|
cached = cached.delete_if do |path|
|
|
238
238
|
spec = Bundler.rubygems.spec_from_gem path
|
|
@@ -257,7 +257,7 @@ module Bundler
|
|
|
257
257
|
end
|
|
258
258
|
|
|
259
259
|
def prune_git_and_path_cache(resolve, cache_path)
|
|
260
|
-
cached =
|
|
260
|
+
cached = SharedHelpers.glob_files_in_dir("*/.bundlecache", cache_path.to_s)
|
|
261
261
|
|
|
262
262
|
cached = cached.delete_if do |path|
|
|
263
263
|
name = File.basename(File.dirname(path))
|
|
@@ -283,7 +283,7 @@ module Bundler
|
|
|
283
283
|
# Add man/ subdirectories from activated bundles to MANPATH for man(1)
|
|
284
284
|
manuals = $LOAD_PATH.filter_map do |path|
|
|
285
285
|
man_subdir = path.sub(/lib$/, "man")
|
|
286
|
-
man_subdir unless
|
|
286
|
+
man_subdir unless SharedHelpers.glob_files_in_dir("man?/", man_subdir).empty?
|
|
287
287
|
end
|
|
288
288
|
|
|
289
289
|
return if manuals.empty?
|
|
@@ -231,6 +231,21 @@ module Bundler
|
|
|
231
231
|
destination
|
|
232
232
|
end
|
|
233
233
|
|
|
234
|
+
# Globs for entries matching +glob+ inside of +base_path+, returning
|
|
235
|
+
# absolute paths. Glob metacharacters in +base_path+ are not treated as
|
|
236
|
+
# part of the pattern, and matched entries are joined literally, so an
|
|
237
|
+
# entry starting with `~` is not expanded into the home directory.
|
|
238
|
+
#
|
|
239
|
+
# Bundler runs against whatever RubyGems the host provides, so this cannot
|
|
240
|
+
# delegate to Gem::Util.glob_files_in_dir, which only gained the literal
|
|
241
|
+
# join in RubyGems 4.1.
|
|
242
|
+
def glob_files_in_dir(glob, base_path)
|
|
243
|
+
expanded_path = nil
|
|
244
|
+
Dir.glob(glob, base: base_path).map! do |f|
|
|
245
|
+
File.join(expanded_path ||= File.expand_path(base_path), f)
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
234
249
|
private
|
|
235
250
|
|
|
236
251
|
def validate_bundle_path
|
|
@@ -193,7 +193,13 @@ module Bundler
|
|
|
193
193
|
return out if status.success?
|
|
194
194
|
|
|
195
195
|
if err.include?("couldn't find remote ref") || err.include?("not our ref")
|
|
196
|
-
|
|
196
|
+
default_branch = renamed_remote_default_branch if tracking_remote_default_branch?
|
|
197
|
+
if default_branch
|
|
198
|
+
out = follow_remote_default_branch(args, default_branch)
|
|
199
|
+
return out if out
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
raise MissingGitRevisionError.new(command_with_no_credentials, path, commit || explicit_ref || current_branch, credential_filtered_uri)
|
|
197
203
|
else
|
|
198
204
|
if shallow?
|
|
199
205
|
args -= depth_args
|
|
@@ -298,6 +304,61 @@ module Bundler
|
|
|
298
304
|
branch_option || ref.nil?
|
|
299
305
|
end
|
|
300
306
|
|
|
307
|
+
def tracking_remote_default_branch?
|
|
308
|
+
explicit_ref.nil? && commit.nil?
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# Returns nil on any failure, leaving HEAD untouched so the caller reports
|
|
312
|
+
# the original fetch failure. Runs inside the retry block, so it must not
|
|
313
|
+
# touch the caller's command locals.
|
|
314
|
+
def follow_remote_default_branch(args, default_branch)
|
|
315
|
+
reference = "refs/heads/#{default_branch}"
|
|
316
|
+
command = fetch_command(args, "#{reference}:#{reference}")
|
|
317
|
+
check_allowed(command)
|
|
318
|
+
|
|
319
|
+
out, err, status = capture(command, path)
|
|
320
|
+
unless status.success?
|
|
321
|
+
Bundler.ui.debug "Could not fetch #{reference} from #{credential_filtered_uri}: #{err}"
|
|
322
|
+
return
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
previous_branch = current_branch
|
|
326
|
+
begin
|
|
327
|
+
git "symbolic-ref", "HEAD", reference, dir: path
|
|
328
|
+
rescue GitError => e
|
|
329
|
+
Bundler.ui.debug "Could not repoint the cached clone at #{reference}: #{e.message}"
|
|
330
|
+
return
|
|
331
|
+
end
|
|
332
|
+
@current_branch = nil
|
|
333
|
+
Bundler.ui.warn "#{credential_filtered_uri} no longer has #{previous_branch}, " \
|
|
334
|
+
"now following its default branch #{default_branch}"
|
|
335
|
+
out
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
# The cached clone's HEAD branch is gone from the remote, so the remote's
|
|
339
|
+
# own idea of its default branch is the only thing left to follow.
|
|
340
|
+
def renamed_remote_default_branch
|
|
341
|
+
default_branch = remote_default_branch
|
|
342
|
+
return if default_branch.nil? || default_branch == current_branch
|
|
343
|
+
|
|
344
|
+
default_branch
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
def remote_default_branch
|
|
348
|
+
command = ["ls-remote", "--symref", "--", configured_uri, "HEAD"]
|
|
349
|
+
check_allowed(command)
|
|
350
|
+
|
|
351
|
+
out, err, status = capture(command, path)
|
|
352
|
+
unless status.success?
|
|
353
|
+
Bundler.ui.debug "Could not ask #{credential_filtered_uri} for its default branch: #{err}"
|
|
354
|
+
return
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# A remote is free to advertise a ref name that is not valid UTF-8, and
|
|
358
|
+
# matching that as text raises out of the GitError family.
|
|
359
|
+
out.b[%r{^ref:\s+refs/heads/(.+?)\s+HEAD}, 1]
|
|
360
|
+
end
|
|
361
|
+
|
|
301
362
|
def pinned_to_full_sha?
|
|
302
363
|
full_sha_revision?(ref)
|
|
303
364
|
end
|
|
@@ -465,8 +526,8 @@ module Bundler
|
|
|
465
526
|
args
|
|
466
527
|
end
|
|
467
528
|
|
|
468
|
-
def fetch_command(args)
|
|
469
|
-
["fetch", "--force", "--quiet", "--no-tags", *args, "--", configured_uri,
|
|
529
|
+
def fetch_command(args, spec = refspec)
|
|
530
|
+
["fetch", "--force", "--quiet", "--no-tags", *args, "--", configured_uri, spec].compact
|
|
470
531
|
end
|
|
471
532
|
|
|
472
533
|
def clone_command(args)
|
|
@@ -91,9 +91,9 @@ module Bundler
|
|
|
91
91
|
|
|
92
92
|
def to_s
|
|
93
93
|
begin
|
|
94
|
-
at = humanized_ref
|
|
95
|
-
|
|
96
|
-
rev = "at #{at}
|
|
94
|
+
at = humanized_ref
|
|
95
|
+
at = "#{at}@" if at
|
|
96
|
+
rev = "at #{at}#{shortref_for_display(revision)}"
|
|
97
97
|
rescue GitError
|
|
98
98
|
""
|
|
99
99
|
end
|
|
@@ -320,7 +320,7 @@ module Bundler
|
|
|
320
320
|
|
|
321
321
|
def serialize_gemspecs_in(destination)
|
|
322
322
|
destination = destination.expand_path(Bundler.root) if destination.relative?
|
|
323
|
-
|
|
323
|
+
SharedHelpers.glob_files_in_dir(@glob, destination.to_s).each do |spec_path|
|
|
324
324
|
# Evaluate gemspecs and cache the result. Gemspecs
|
|
325
325
|
# in git might require git or other dependencies.
|
|
326
326
|
# The gemspecs we cache should already be evaluated.
|
|
@@ -161,7 +161,7 @@ module Bundler
|
|
|
161
161
|
|
|
162
162
|
if File.directory?(expanded_path)
|
|
163
163
|
# We sort depth-first since `<<` will override the earlier-found specs
|
|
164
|
-
|
|
164
|
+
SharedHelpers.glob_files_in_dir(@glob, expanded_path).sort_by {|p| -p.split(File::SEPARATOR).size }.each do |file|
|
|
165
165
|
next unless spec = load_gemspec(file)
|
|
166
166
|
spec.source = self
|
|
167
167
|
|
|
@@ -406,7 +406,7 @@ module Bundler
|
|
|
406
406
|
@cached_specs ||= begin
|
|
407
407
|
idx = Index.new
|
|
408
408
|
|
|
409
|
-
|
|
409
|
+
SharedHelpers.glob_files_in_dir("*.gem", cache_path.to_s).each do |gemfile|
|
|
410
410
|
s ||= Bundler.rubygems.spec_from_gem(gemfile)
|
|
411
411
|
s.source = self
|
|
412
412
|
idx << s
|
|
@@ -126,7 +126,9 @@ module Bundler
|
|
|
126
126
|
def _remote_specification
|
|
127
127
|
@_remote_specification ||= begin
|
|
128
128
|
rs = stub.to_spec
|
|
129
|
-
|
|
129
|
+
# Gem::StubSpecification#to_spec may return an activated specification
|
|
130
|
+
# with the same name and version from a different gem installation.
|
|
131
|
+
if rs.equal?(self) || rs.loaded_from != loaded_from
|
|
130
132
|
rs = Gem::Specification.load(loaded_from)
|
|
131
133
|
Bundler.rubygems.stub_set_spec(stub, rs)
|
|
132
134
|
end
|
data/bundler/lib/bundler.rb
CHANGED
|
@@ -527,11 +527,11 @@ module Bundler
|
|
|
527
527
|
end
|
|
528
528
|
|
|
529
529
|
def load_gemspec_uncached(file, validate = false)
|
|
530
|
-
path = Pathname.new(file)
|
|
531
|
-
contents = read_file(
|
|
530
|
+
path = Pathname.new(file).expand_path
|
|
531
|
+
contents = read_file(path.to_s)
|
|
532
532
|
spec = eval_gemspec(path, contents)
|
|
533
533
|
return unless spec
|
|
534
|
-
spec.loaded_from = path.
|
|
534
|
+
spec.loaded_from = path.to_s
|
|
535
535
|
Bundler.rubygems.validate(spec) if validate
|
|
536
536
|
spec
|
|
537
537
|
end
|
|
@@ -646,9 +646,19 @@ module Bundler
|
|
|
646
646
|
eval_yaml_gemspec(path, contents)
|
|
647
647
|
else
|
|
648
648
|
# Eval the gemspec from its parent directory, because some gemspecs
|
|
649
|
-
# depend on "./" relative paths.
|
|
649
|
+
# depend on "./" relative paths. The caller expands `path` first, since
|
|
650
|
+
# expanding it here would resolve against the gemspec directory once
|
|
651
|
+
# the chdir is active.
|
|
650
652
|
SharedHelpers.chdir(path.dirname.to_s) do
|
|
651
|
-
|
|
653
|
+
# TOPLEVEL_BINDING always belongs to the main box, so inside a
|
|
654
|
+
# Ruby::Box use a binding from the box Bundler is loaded in, where
|
|
655
|
+
# Gem::Specification carries Bundler's own monkey patches.
|
|
656
|
+
eval_binding = if defined?(Ruby::Box) && Ruby::Box.enabled?
|
|
657
|
+
Ruby::Box.current.eval("binding")
|
|
658
|
+
else
|
|
659
|
+
TOPLEVEL_BINDING.dup
|
|
660
|
+
end
|
|
661
|
+
eval(contents, eval_binding, path.to_s)
|
|
652
662
|
end
|
|
653
663
|
end
|
|
654
664
|
rescue ScriptError, StandardError => e
|
data/lib/rubygems/command.rb
CHANGED
|
@@ -440,7 +440,7 @@ class Gem::Command
|
|
|
440
440
|
def handle_options(args)
|
|
441
441
|
args = add_extra_args(args)
|
|
442
442
|
check_deprecated_options(args)
|
|
443
|
-
@options =
|
|
443
|
+
@options = Gem::Util.deep_dup @defaults
|
|
444
444
|
parser.parse!(args)
|
|
445
445
|
@options[:args] = args
|
|
446
446
|
end
|
|
@@ -91,13 +91,21 @@ prefix or only the files that are requireable.
|
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
def files_in_gem(spec)
|
|
94
|
-
gem_path
|
|
95
|
-
extra = "/{#{spec.require_paths.join ","}}" if options[:lib_only]
|
|
96
|
-
glob = "#{gem_path}#{extra}/**/*"
|
|
97
|
-
prefix_re = %r{#{Regexp.escape(gem_path)}/}
|
|
94
|
+
gem_path = spec.full_gem_path
|
|
98
95
|
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
if options[:lib_only]
|
|
97
|
+
# raw_require_paths rather than require_paths, since the latter prepends
|
|
98
|
+
# the absolute extension_dir, which would escape the glob base
|
|
99
|
+
require_paths = spec.raw_require_paths
|
|
100
|
+
return [] if require_paths.empty?
|
|
101
|
+
|
|
102
|
+
glob = "{#{require_paths.join ","}}/**/*"
|
|
103
|
+
else
|
|
104
|
+
glob = "**/*"
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
Dir.glob(glob, base: gem_path).map do |file|
|
|
108
|
+
[gem_path, file]
|
|
101
109
|
end
|
|
102
110
|
end
|
|
103
111
|
|
|
@@ -79,7 +79,7 @@ to the same gem path as user-installed gems.
|
|
|
79
79
|
def handle_options(args)
|
|
80
80
|
args = add_extra_args(args)
|
|
81
81
|
check_deprecated_options(args)
|
|
82
|
-
@options =
|
|
82
|
+
@options = Gem::Util.deep_dup @defaults
|
|
83
83
|
parser.order!(args) do |v|
|
|
84
84
|
# put the non-option back at the front of the list of arguments
|
|
85
85
|
args.unshift(v)
|
|
@@ -7,9 +7,6 @@ require_relative "../command"
|
|
|
7
7
|
# RubyGems checkout or tarball.
|
|
8
8
|
|
|
9
9
|
class Gem::Commands::SetupCommand < Gem::Command
|
|
10
|
-
HISTORY_HEADER = %r{^##\s*[\d.a-zA-Z]+\s*/\s*\d{4}-\d{2}-\d{2}\s*$}
|
|
11
|
-
VERSION_MATCHER = %r{^##\s*([\d.a-zA-Z]+)\s*/\s*\d{4}-\d{2}-\d{2}\s*$}
|
|
12
|
-
|
|
13
10
|
ENV_PATHS = %w[/usr/bin/env /bin/env].freeze
|
|
14
11
|
|
|
15
12
|
def initialize
|
|
@@ -23,7 +20,7 @@ class Gem::Commands::SetupCommand < Gem::Command
|
|
|
23
20
|
|
|
24
21
|
add_option "--previous-version=VERSION",
|
|
25
22
|
"Previous version of RubyGems",
|
|
26
|
-
"Used for
|
|
23
|
+
"Used for the release notes link" do |version, options|
|
|
27
24
|
options[:previous_version] = version
|
|
28
25
|
end
|
|
29
26
|
|
|
@@ -183,12 +180,6 @@ By default, this RubyGems will install gem as:
|
|
|
183
180
|
say
|
|
184
181
|
end
|
|
185
182
|
|
|
186
|
-
if options[:previous_version].empty?
|
|
187
|
-
options[:previous_version] = Gem::VERSION.sub(/[0-9]+$/, "0")
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
options[:previous_version] = Gem::Version.new(options[:previous_version])
|
|
191
|
-
|
|
192
183
|
show_release_notes
|
|
193
184
|
|
|
194
185
|
say
|
|
@@ -319,7 +310,7 @@ By default, this RubyGems will install gem as:
|
|
|
319
310
|
(!File.exist?(rubygems_doc_dir) ||
|
|
320
311
|
File.writable?(rubygems_doc_dir))
|
|
321
312
|
say "Removing old RubyGems RDoc and ri" if @verbose
|
|
322
|
-
|
|
313
|
+
Gem::Util.glob_files_in_dir("rubygems-[0-9]*", gem_doc_dir).each do |dir|
|
|
323
314
|
rm_rf dir
|
|
324
315
|
end
|
|
325
316
|
|
|
@@ -552,34 +543,16 @@ abort "#{deprecation_message}"
|
|
|
552
543
|
end
|
|
553
544
|
|
|
554
545
|
def show_release_notes
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
release_notes =
|
|
558
|
-
if File.exist? release_notes
|
|
559
|
-
history = File.read release_notes
|
|
560
|
-
|
|
561
|
-
history.force_encoding Encoding::UTF_8
|
|
562
|
-
|
|
563
|
-
text = history.split(HISTORY_HEADER)
|
|
564
|
-
text.shift # correct an off-by-one generated by split
|
|
565
|
-
version_lines = history.scan(HISTORY_HEADER)
|
|
566
|
-
versions = history.scan(VERSION_MATCHER).flatten.map do |x|
|
|
567
|
-
Gem::Version.new(x)
|
|
568
|
-
end
|
|
546
|
+
ref = Gem::VERSION.include?(".dev") ? "master" : "v#{Gem::VERSION}"
|
|
547
|
+
link = "https://github.com/ruby/rubygems/blob/#{ref}/CHANGELOG.md"
|
|
569
548
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
history_string
|
|
578
|
-
else
|
|
579
|
-
"Oh-no! Unable to find release notes!"
|
|
580
|
-
end
|
|
581
|
-
|
|
582
|
-
say release_notes
|
|
549
|
+
previous = options[:previous_version].to_s.strip
|
|
550
|
+
if previous.empty? || !Gem::Version.correct?(previous) ||
|
|
551
|
+
Gem::Version.new(previous) >= Gem::Version.new(Gem::VERSION)
|
|
552
|
+
say "See #{link} for the changes."
|
|
553
|
+
else
|
|
554
|
+
say "See #{link} for the changes since #{previous}."
|
|
555
|
+
end
|
|
583
556
|
end
|
|
584
557
|
|
|
585
558
|
def uninstall_old_gemcutter
|
|
@@ -25,7 +25,7 @@ longer using.
|
|
|
25
25
|
gem_to_atime = {}
|
|
26
26
|
Gem::Specification.each do |spec|
|
|
27
27
|
name = spec.full_name
|
|
28
|
-
|
|
28
|
+
Gem::Util.glob_files_in_dir("**/*.*", spec.full_gem_path).each do |file|
|
|
29
29
|
next if File.directory?(file)
|
|
30
30
|
stat = File.stat(file)
|
|
31
31
|
gem_to_atime[name] ||= stat.atime
|
data/lib/rubygems/config_file.rb
CHANGED
|
@@ -26,9 +26,20 @@ require "rbconfig"
|
|
|
26
26
|
# RubyGems options use symbol keys. Valid options are:
|
|
27
27
|
#
|
|
28
28
|
# +:backtrace+:: See #backtrace
|
|
29
|
-
# +:
|
|
29
|
+
# +:bulk_threshold+:: See #bulk_threshold
|
|
30
30
|
# +:verbose+:: See #verbose
|
|
31
|
+
# +:update_sources+:: See #update_sources
|
|
31
32
|
# +:concurrent_downloads+:: See #concurrent_downloads
|
|
33
|
+
# +:cert_expiration_length_days+:: See #cert_expiration_length_days
|
|
34
|
+
# +:install_extension_in_lib+:: See #install_extension_in_lib
|
|
35
|
+
# +:ipv4_fallback_enabled+:: See #ipv4_fallback_enabled
|
|
36
|
+
# +:gemhome+:: See #home
|
|
37
|
+
# +:gempath+:: See #path
|
|
38
|
+
# +:sources+:: Sets Gem::sources
|
|
39
|
+
# +:disable_default_gem_server+:: See #disable_default_gem_server
|
|
40
|
+
# +:ssl_verify_mode+:: See #ssl_verify_mode
|
|
41
|
+
# +:ssl_ca_cert+:: See #ssl_ca_cert
|
|
42
|
+
# +:ssl_client_cert+:: See #ssl_client_cert
|
|
32
43
|
#
|
|
33
44
|
# gemrc files may exist in various locations and are read and merged in
|
|
34
45
|
# the following order:
|
|
@@ -193,8 +204,8 @@ class Gem::ConfigFile
|
|
|
193
204
|
@install_extension_in_lib = DEFAULT_INSTALL_EXTENSION_IN_LIB
|
|
194
205
|
@ipv4_fallback_enabled = ENV["IPV4_FALLBACK_ENABLED"] == "true" || DEFAULT_IPV4_FALLBACK_ENABLED
|
|
195
206
|
|
|
196
|
-
operating_system_config =
|
|
197
|
-
platform_config =
|
|
207
|
+
operating_system_config = Gem::Util.deep_dup(OPERATING_SYSTEM_DEFAULTS)
|
|
208
|
+
platform_config = Gem::Util.deep_dup(PLATFORM_DEFAULTS)
|
|
198
209
|
system_config = load_file SYSTEM_WIDE_CONFIG_FILE
|
|
199
210
|
user_config = load_file config_file_name
|
|
200
211
|
|
|
@@ -562,13 +573,13 @@ if you believe they were disclosed to a third party.
|
|
|
562
573
|
|
|
563
574
|
def self.deep_transform_config_keys!(config)
|
|
564
575
|
config.transform_keys! do |k|
|
|
565
|
-
if k.match?(/\A:(.*)\
|
|
576
|
+
if k.match?(/\A:(.*)\z/)
|
|
566
577
|
k[1..-1].to_sym
|
|
567
|
-
elsif k.include?("__") || k.
|
|
578
|
+
elsif k.include?("__") || k.end_with?("/")
|
|
568
579
|
if k.is_a?(Symbol)
|
|
569
|
-
k.to_s.gsub(/__/,".").
|
|
580
|
+
k.to_s.gsub(/__/,".").delete_suffix("/").to_sym
|
|
570
581
|
else
|
|
571
|
-
k.dup.gsub(/__/,".").
|
|
582
|
+
k.dup.gsub(/__/,".").delete_suffix("/")
|
|
572
583
|
end
|
|
573
584
|
else
|
|
574
585
|
k
|
|
@@ -577,11 +588,11 @@ if you believe they were disclosed to a third party.
|
|
|
577
588
|
|
|
578
589
|
config.transform_values! do |v|
|
|
579
590
|
if v.is_a?(String)
|
|
580
|
-
if v.match?(/\A:(.*)\
|
|
591
|
+
if v.match?(/\A:(.*)\z/)
|
|
581
592
|
v[1..-1].to_sym
|
|
582
|
-
elsif v.match?(/\A[+-]?\d+\
|
|
593
|
+
elsif v.match?(/\A[+-]?\d+\z/)
|
|
583
594
|
v.to_i
|
|
584
|
-
elsif v.match?(/\
|
|
595
|
+
elsif v.match?(/\A(?:true|false)\z/)
|
|
585
596
|
v == "true"
|
|
586
597
|
elsif v.empty?
|
|
587
598
|
nil
|
data/lib/rubygems/ext/builder.rb
CHANGED
|
@@ -101,7 +101,9 @@ class Gem::Ext::Builder
|
|
|
101
101
|
|
|
102
102
|
require "open3"
|
|
103
103
|
# Set $SOURCE_DATE_EPOCH for the subprocess.
|
|
104
|
-
|
|
104
|
+
# Under Ruby::Box mkmf makes RbConfig.expand recurse until SystemStackError.
|
|
105
|
+
# Drop $RUBY_BOX last so no caller can restore it.
|
|
106
|
+
build_env = { "SOURCE_DATE_EPOCH" => Gem.source_date_epoch_string }.merge(env).merge("RUBY_BOX" => nil)
|
|
105
107
|
# A single-element command would be parsed as a shell command line,
|
|
106
108
|
# splitting an unquoted command path containing spaces. Use the
|
|
107
109
|
# [cmdname, argv0] form to keep exec semantics.
|
|
@@ -109,9 +109,7 @@ class Gem::Security::Signer
|
|
|
109
109
|
subject_alt_name = cert.extensions.find {|e| e.oid == "subjectAltName" }
|
|
110
110
|
|
|
111
111
|
if subject_alt_name
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
$' || subject_alt_name.value
|
|
112
|
+
subject_alt_name.value.delete_prefix("email:")
|
|
115
113
|
else
|
|
116
114
|
cert.subject
|
|
117
115
|
end
|
|
@@ -10,10 +10,14 @@ module Gem::UpdateSuggestion
|
|
|
10
10
|
# Message to promote available RubyGems update with related gem update command.
|
|
11
11
|
|
|
12
12
|
def update_suggestion
|
|
13
|
+
current = Gem.rubygems_version
|
|
14
|
+
latest = Gem.latest_rubygems_version
|
|
15
|
+
|
|
13
16
|
<<-MESSAGE
|
|
14
17
|
|
|
15
|
-
A new release of RubyGems is available: #{
|
|
16
|
-
|
|
18
|
+
A new release of RubyGems is available: #{current} → #{latest}!
|
|
19
|
+
See https://github.com/ruby/rubygems/blob/v#{latest}/CHANGELOG.md for the changes since #{current}.
|
|
20
|
+
Run `gem update --system #{latest}` to update your installation.
|
|
17
21
|
|
|
18
22
|
MESSAGE
|
|
19
23
|
end
|
data/lib/rubygems/util.rb
CHANGED
|
@@ -75,15 +75,39 @@ module Gem::Util
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
##
|
|
78
|
-
# Globs for
|
|
79
|
-
#
|
|
80
|
-
# Dir.glob with an interpolated path, glob metacharacters in
|
|
81
|
-
#
|
|
78
|
+
# Globs for entries matching +glob+ inside of +base_path+, returning
|
|
79
|
+
# absolute paths to the matching files and directories. Unlike a plain
|
|
80
|
+
# Dir.glob with an interpolated path, glob metacharacters in +base_path+
|
|
81
|
+
# are not treated as part of the pattern. Matched entries are joined to
|
|
82
|
+
# +base_path+ literally, so an entry starting with `~` is not expanded
|
|
83
|
+
# into a home directory, and no other normalization is applied to them.
|
|
82
84
|
|
|
83
85
|
def self.glob_files_in_dir(glob, base_path)
|
|
84
86
|
expanded_path = nil
|
|
85
87
|
Dir.glob(glob, base: base_path).map! do |f|
|
|
86
|
-
File.
|
|
88
|
+
# File.join instead of File.expand_path, so that matched entries
|
|
89
|
+
# starting with `~` are not expanded into the home directory
|
|
90
|
+
File.join(expanded_path ||= File.expand_path(base_path), f)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
##
|
|
95
|
+
# Duplicates +obj+ without Marshal, which cannot resolve Gem:: constants from
|
|
96
|
+
# the root box under Ruby::Box (RUBY_BOX=1). Hashes and arrays are copied
|
|
97
|
+
# recursively, anything else with a plain +dup+, so an object's internals stay
|
|
98
|
+
# shared with the original, as are hash keys. Shared references are not
|
|
99
|
+
# preserved, and a cyclic +obj+ raises SystemStackError.
|
|
100
|
+
|
|
101
|
+
def self.deep_dup(obj) # :nodoc:
|
|
102
|
+
case obj
|
|
103
|
+
when Hash then obj.to_h {|k, v| [k, deep_dup(v)] }
|
|
104
|
+
when Array then obj.map {|e| deep_dup(e) }
|
|
105
|
+
else
|
|
106
|
+
begin
|
|
107
|
+
obj.dup
|
|
108
|
+
rescue TypeError
|
|
109
|
+
obj
|
|
110
|
+
end
|
|
87
111
|
end
|
|
88
112
|
end
|
|
89
113
|
|
data/lib/rubygems.rb
CHANGED
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: 4.0.
|
|
4
|
+
version: 4.0.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jim Weirich
|
|
@@ -723,7 +723,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
723
723
|
- !ruby/object:Gem::Version
|
|
724
724
|
version: '0'
|
|
725
725
|
requirements: []
|
|
726
|
-
rubygems_version:
|
|
726
|
+
rubygems_version: 4.0.16
|
|
727
727
|
specification_version: 4
|
|
728
728
|
summary: RubyGems is a package management framework for Ruby. This gem is downloaded
|
|
729
729
|
and installed by `gem update --system`, so that the `gem` CLI can update itself.
|