rubygems-update 3.4.7 → 3.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +57 -0
- data/Manifest.txt +4 -0
- data/POLICIES.md +5 -5
- data/README.md +17 -4
- data/bundler/CHANGELOG.md +48 -0
- data/bundler/README.md +1 -4
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/endpoint_specification.rb +0 -4
- data/bundler/lib/bundler/environment_preserver.rb +2 -2
- data/bundler/lib/bundler/fetcher/dependency.rb +1 -5
- data/bundler/lib/bundler/fetcher.rb +2 -2
- data/bundler/lib/bundler/incomplete_specification.rb +24 -0
- data/bundler/lib/bundler/index.rb +2 -2
- data/bundler/lib/bundler/injector.rb +1 -1
- data/bundler/lib/bundler/installer/parallel_installer.rb +1 -14
- data/bundler/lib/bundler/lazy_specification.rb +4 -8
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/lockfile_parser.rb +11 -11
- data/bundler/lib/bundler/plugin.rb +1 -1
- data/bundler/lib/bundler/remote_specification.rb +2 -6
- data/bundler/lib/bundler/resolver/base.rb +5 -3
- data/bundler/lib/bundler/resolver.rb +6 -9
- data/bundler/lib/bundler/rubygems_integration.rb +1 -1
- data/bundler/lib/bundler/settings.rb +1 -1
- data/bundler/lib/bundler/setup.rb +4 -1
- data/bundler/lib/bundler/shared_helpers.rb +1 -1
- data/bundler/lib/bundler/source/git/git_proxy.rb +21 -4
- data/bundler/lib/bundler/source/git.rb +2 -1
- data/bundler/lib/bundler/source/path.rb +1 -1
- data/bundler/lib/bundler/source/rubygems.rb +1 -2
- data/bundler/lib/bundler/spec_set.rb +19 -12
- data/bundler/lib/bundler/templates/Executable.bundler +1 -1
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +10 -0
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/bundler/lib/bundler/uri_normalizer.rb +23 -0
- data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +0 -5
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +11 -9
- data/lib/rubygems/bundler_version_finder.rb +1 -1
- data/lib/rubygems/command.rb +10 -6
- data/lib/rubygems/command_manager.rb +1 -0
- data/lib/rubygems/commands/exec_command.rb +248 -0
- data/lib/rubygems/commands/help_command.rb +3 -3
- data/lib/rubygems/commands/pristine_command.rb +9 -0
- data/lib/rubygems/commands/uninstall_command.rb +3 -0
- data/lib/rubygems/core_ext/kernel_require.rb +0 -10
- data/lib/rubygems/defaults.rb +2 -2
- data/lib/rubygems/dependency.rb +1 -1
- data/lib/rubygems/ext/builder.rb +17 -0
- data/lib/rubygems/ext/ext_conf_builder.rb +1 -2
- data/lib/rubygems/ext/rake_builder.rb +1 -1
- data/lib/rubygems/package/tar_header.rb +1 -1
- data/lib/rubygems/package/tar_reader/entry.rb +82 -3
- data/lib/rubygems/package/tar_reader.rb +0 -28
- data/lib/rubygems/platform.rb +2 -2
- data/lib/rubygems/request_set/gem_dependency_api.rb +0 -1
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver/stats.rb +1 -1
- data/lib/rubygems/source/git.rb +1 -1
- data/lib/rubygems/specification.rb +9 -1
- data/lib/rubygems/stub_specification.rb +7 -7
- data/lib/rubygems/text.rb +1 -1
- data/lib/rubygems/util/licenses.rb +2 -2
- data/lib/rubygems/version.rb +2 -2
- data/lib/rubygems.rb +3 -3
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/helper.rb +2 -3
- data/test/rubygems/package/tar_test_case.rb +50 -15
- data/test/rubygems/simple_gem.rb +1 -1
- data/test/rubygems/test_gem.rb +29 -0
- data/test/rubygems/test_gem_bundler_version_finder.rb +2 -2
- data/test/rubygems/test_gem_commands_exec_command.rb +851 -0
- data/test/rubygems/test_gem_commands_install_command.rb +1 -1
- data/test/rubygems/test_gem_commands_pristine_command.rb +48 -0
- data/test/rubygems/test_gem_commands_setup_command.rb +1 -1
- data/test/rubygems/test_gem_commands_uninstall_command.rb +31 -14
- data/test/rubygems/test_gem_ext_builder.rb +3 -5
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +20 -6
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
- data/test/rubygems/test_gem_gem_runner.rb +6 -1
- data/test/rubygems/test_gem_package.rb +0 -25
- data/test/rubygems/test_gem_package_tar_reader.rb +48 -1
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +102 -15
- data/test/rubygems/test_gem_remote_fetcher.rb +1 -1
- data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +10 -10
- data/test/rubygems/test_gem_request_set_lockfile_parser.rb +2 -2
- data/test/rubygems/test_gem_resolver_git_set.rb +9 -9
- data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
- data/test/rubygems/test_gem_source.rb +1 -1
- data/test/rubygems/test_gem_source_git.rb +13 -12
- data/test/rubygems/test_gem_source_installed.rb +1 -1
- data/test/rubygems/test_gem_source_lock.rb +3 -3
- data/test/rubygems/test_gem_source_vendor.rb +1 -1
- data/test/rubygems/test_gem_specification.rb +19 -2
- data/test/rubygems/test_gem_version.rb +2 -2
- data/test/rubygems/test_kernel.rb +0 -8
- metadata +7 -3
@@ -34,6 +34,11 @@ class Gem::Commands::PristineCommand < Gem::Command
|
|
34
34
|
options[:extensions] = value
|
35
35
|
end
|
36
36
|
|
37
|
+
add_option("--only-missing-extensions",
|
38
|
+
"Only restore gems with missing extensions") do |value, options|
|
39
|
+
options[:only_missing_extensions] = value
|
40
|
+
end
|
41
|
+
|
37
42
|
add_option("--only-executables",
|
38
43
|
"Only restore executables") do |value, options|
|
39
44
|
options[:only_executables] = value
|
@@ -107,6 +112,10 @@ extensions will be restored.
|
|
107
112
|
Gem::Specification.select do |spec|
|
108
113
|
spec.extensions && !spec.extensions.empty?
|
109
114
|
end
|
115
|
+
elsif options[:only_missing_extensions]
|
116
|
+
Gem::Specification.select do |spec|
|
117
|
+
spec.missing_extensions?
|
118
|
+
end
|
110
119
|
else
|
111
120
|
get_all_gem_names.sort.map do |gem_name|
|
112
121
|
Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse
|
@@ -125,6 +125,9 @@ that is a dependency of an existing gem. You can use the
|
|
125
125
|
def execute
|
126
126
|
check_version
|
127
127
|
|
128
|
+
# Consider only gem specifications installed at `--install-dir`
|
129
|
+
Gem::Specification.dirs = options[:install_dir] if options[:install_dir]
|
130
|
+
|
128
131
|
if options[:all] && !options[:args].empty?
|
129
132
|
uninstall_specific
|
130
133
|
elsif options[:all]
|
@@ -37,9 +37,6 @@ module Kernel
|
|
37
37
|
return gem_original_require(path) unless Gem.discover_gems_on_require
|
38
38
|
|
39
39
|
begin
|
40
|
-
if RUBYGEMS_ACTIVATION_MONITOR.respond_to?(:mon_owned?)
|
41
|
-
monitor_owned = RUBYGEMS_ACTIVATION_MONITOR.mon_owned?
|
42
|
-
end
|
43
40
|
RUBYGEMS_ACTIVATION_MONITOR.enter
|
44
41
|
|
45
42
|
path = path.to_path if path.respond_to? :to_path
|
@@ -163,13 +160,6 @@ module Kernel
|
|
163
160
|
end
|
164
161
|
|
165
162
|
raise load_error
|
166
|
-
ensure
|
167
|
-
if RUBYGEMS_ACTIVATION_MONITOR.respond_to?(:mon_owned?)
|
168
|
-
if monitor_owned != (ow = RUBYGEMS_ACTIVATION_MONITOR.mon_owned?)
|
169
|
-
STDERR.puts [$$, Thread.current, $!, $!.backtrace].inspect if $!
|
170
|
-
raise "CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before #{monitor_owned} -> after #{ow}"
|
171
|
-
end
|
172
|
-
end
|
173
163
|
end
|
174
164
|
end
|
175
165
|
|
data/lib/rubygems/defaults.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module Gem
|
3
|
-
DEFAULT_HOST = "https://rubygems.org"
|
3
|
+
DEFAULT_HOST = "https://rubygems.org"
|
4
4
|
|
5
5
|
@post_install_hooks ||= []
|
6
6
|
@done_installing_hooks ||= []
|
@@ -158,7 +158,7 @@ module Gem
|
|
158
158
|
# The path to standard location of the user's state directory.
|
159
159
|
|
160
160
|
def self.state_home
|
161
|
-
@
|
161
|
+
@state_home ||= (ENV["XDG_STATE_HOME"] || File.join(Gem.user_home, ".local", "state"))
|
162
162
|
end
|
163
163
|
|
164
164
|
##
|
data/lib/rubygems/dependency.rb
CHANGED
data/lib/rubygems/ext/builder.rb
CHANGED
@@ -55,6 +55,23 @@ class Gem::Ext::Builder
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
def self.ruby
|
59
|
+
require "shellwords"
|
60
|
+
# Gem.ruby is quoted if it contains whitespace
|
61
|
+
cmd = Gem.ruby.shellsplit
|
62
|
+
|
63
|
+
# This load_path is only needed when running rubygems test without a proper installation.
|
64
|
+
# Prepending it in a normal installation will cause problem with order of $LOAD_PATH.
|
65
|
+
# Therefore only add load_path if it is not present in the default $LOAD_PATH.
|
66
|
+
load_path = File.expand_path("../..", __dir__)
|
67
|
+
case load_path
|
68
|
+
when RbConfig::CONFIG["sitelibdir"], RbConfig::CONFIG["vendorlibdir"], RbConfig::CONFIG["rubylibdir"]
|
69
|
+
cmd
|
70
|
+
else
|
71
|
+
cmd << "-I#{load_path}"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
58
75
|
def self.run(command, results, command_name = nil, dir = Dir.pwd, env = {})
|
59
76
|
verbose = Gem.configuration.really_verbose
|
60
77
|
|
@@ -21,8 +21,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|
21
21
|
destdir = ENV["DESTDIR"]
|
22
22
|
|
23
23
|
begin
|
24
|
-
|
25
|
-
cmd = Gem.ruby.shellsplit << "-I" << File.expand_path("../..", __dir__) << File.basename(extension)
|
24
|
+
cmd = ruby << File.basename(extension)
|
26
25
|
cmd.push(*args)
|
27
26
|
|
28
27
|
run(cmd, results, class_name, extension_dir) do |s, r|
|
@@ -18,7 +18,7 @@ class Gem::Ext::RakeBuilder < Gem::Ext::Builder
|
|
18
18
|
rake = rake.shellsplit
|
19
19
|
else
|
20
20
|
begin
|
21
|
-
rake =
|
21
|
+
rake = ruby << "-rrubygems" << Gem.bin_path("rake", "rake")
|
22
22
|
rescue Gem::Exception
|
23
23
|
rake = [Gem.default_exec_format % "rake"]
|
24
24
|
end
|
@@ -8,6 +8,20 @@
|
|
8
8
|
# Class for reading entries out of a tar file
|
9
9
|
|
10
10
|
class Gem::Package::TarReader::Entry
|
11
|
+
##
|
12
|
+
# Creates a new tar entry for +header+ that will be read from +io+
|
13
|
+
# If a block is given, the entry is yielded and then closed.
|
14
|
+
|
15
|
+
def self.open(header, io, &block)
|
16
|
+
entry = new header, io
|
17
|
+
return entry unless block_given?
|
18
|
+
begin
|
19
|
+
yield entry
|
20
|
+
ensure
|
21
|
+
entry.close
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
11
25
|
##
|
12
26
|
# Header for this tar entry
|
13
27
|
|
@@ -21,6 +35,7 @@ class Gem::Package::TarReader::Entry
|
|
21
35
|
@header = header
|
22
36
|
@io = io
|
23
37
|
@orig_pos = @io.pos
|
38
|
+
@end_pos = @orig_pos + @header.size
|
24
39
|
@read = 0
|
25
40
|
end
|
26
41
|
|
@@ -39,7 +54,14 @@ class Gem::Package::TarReader::Entry
|
|
39
54
|
# Closes the tar entry
|
40
55
|
|
41
56
|
def close
|
57
|
+
return if closed?
|
58
|
+
# Seek to the end of the entry if it wasn't fully read
|
59
|
+
seek(0, IO::SEEK_END)
|
60
|
+
# discard trailing zeros
|
61
|
+
skip = (512 - (@header.size % 512)) % 512
|
62
|
+
@io.read(skip)
|
42
63
|
@closed = true
|
64
|
+
nil
|
43
65
|
end
|
44
66
|
|
45
67
|
##
|
@@ -117,6 +139,14 @@ class Gem::Package::TarReader::Entry
|
|
117
139
|
bytes_read
|
118
140
|
end
|
119
141
|
|
142
|
+
##
|
143
|
+
# Seek to the position in the tar entry
|
144
|
+
|
145
|
+
def pos=(new_pos)
|
146
|
+
seek(new_pos, IO::SEEK_SET)
|
147
|
+
new_pos
|
148
|
+
end
|
149
|
+
|
120
150
|
def size
|
121
151
|
@header.size
|
122
152
|
end
|
@@ -157,13 +187,62 @@ class Gem::Package::TarReader::Entry
|
|
157
187
|
outbuf
|
158
188
|
end
|
159
189
|
|
190
|
+
##
|
191
|
+
# Seeks to +offset+ bytes into the tar file entry
|
192
|
+
# +whence+ can be IO::SEEK_SET, IO::SEEK_CUR, or IO::SEEK_END
|
193
|
+
|
194
|
+
def seek(offset, whence = IO::SEEK_SET)
|
195
|
+
check_closed
|
196
|
+
|
197
|
+
new_pos =
|
198
|
+
case whence
|
199
|
+
when IO::SEEK_SET then @orig_pos + offset
|
200
|
+
when IO::SEEK_CUR then @io.pos + offset
|
201
|
+
when IO::SEEK_END then @end_pos + offset
|
202
|
+
else
|
203
|
+
raise ArgumentError, "invalid whence"
|
204
|
+
end
|
205
|
+
|
206
|
+
if new_pos < @orig_pos
|
207
|
+
new_pos = @orig_pos
|
208
|
+
elsif new_pos > @end_pos
|
209
|
+
new_pos = @end_pos
|
210
|
+
end
|
211
|
+
|
212
|
+
pending = new_pos - @io.pos
|
213
|
+
|
214
|
+
if @io.respond_to?(:seek)
|
215
|
+
begin
|
216
|
+
# avoid reading if the @io supports seeking
|
217
|
+
@io.seek new_pos, IO::SEEK_SET
|
218
|
+
pending = 0
|
219
|
+
rescue Errno::EINVAL
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# if seeking isn't supported or failed
|
224
|
+
# negative seek requires that we rewind and read
|
225
|
+
if pending < 0
|
226
|
+
@io.rewind
|
227
|
+
pending = new_pos
|
228
|
+
end
|
229
|
+
|
230
|
+
while pending > 0 do
|
231
|
+
size_read = @io.read([pending, 4096].min).size
|
232
|
+
raise UnexpectedEOF if @io.eof?
|
233
|
+
pending -= size_read
|
234
|
+
end
|
235
|
+
|
236
|
+
@read = @io.pos - @orig_pos
|
237
|
+
|
238
|
+
0
|
239
|
+
end
|
240
|
+
|
160
241
|
##
|
161
242
|
# Rewinds to the beginning of the tar file entry
|
162
243
|
|
163
244
|
def rewind
|
164
245
|
check_closed
|
165
|
-
|
166
|
-
@io.pos = @orig_pos
|
167
|
-
@read = 0
|
246
|
+
seek(0, IO::SEEK_SET)
|
168
247
|
end
|
169
248
|
end
|
@@ -53,39 +53,11 @@ class Gem::Package::TarReader
|
|
53
53
|
def each
|
54
54
|
return enum_for __method__ unless block_given?
|
55
55
|
|
56
|
-
use_seek = @io.respond_to?(:seek)
|
57
|
-
|
58
56
|
until @io.eof? do
|
59
57
|
header = Gem::Package::TarHeader.from @io
|
60
58
|
return if header.empty?
|
61
|
-
|
62
59
|
entry = Gem::Package::TarReader::Entry.new header, @io
|
63
|
-
size = entry.header.size
|
64
|
-
|
65
60
|
yield entry
|
66
|
-
|
67
|
-
skip = (512 - (size % 512)) % 512
|
68
|
-
pending = size - entry.bytes_read
|
69
|
-
|
70
|
-
if use_seek
|
71
|
-
begin
|
72
|
-
# avoid reading if the @io supports seeking
|
73
|
-
@io.seek pending, IO::SEEK_CUR
|
74
|
-
pending = 0
|
75
|
-
rescue Errno::EINVAL
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
# if seeking isn't supported or failed
|
80
|
-
while pending > 0 do
|
81
|
-
bytes_read = @io.read([pending, 4096].min).size
|
82
|
-
raise UnexpectedEOF if @io.eof?
|
83
|
-
pending -= bytes_read
|
84
|
-
end
|
85
|
-
|
86
|
-
@io.read skip # discard trailing zeros
|
87
|
-
|
88
|
-
# make sure nobody can use #read, #getc or #rewind anymore
|
89
61
|
entry.close
|
90
62
|
end
|
91
63
|
end
|
data/lib/rubygems/platform.rb
CHANGED
@@ -235,11 +235,11 @@ class Gem::Platform
|
|
235
235
|
# A pure-Ruby gem that may use Gem::Specification#extensions to build
|
236
236
|
# binary files.
|
237
237
|
|
238
|
-
RUBY = "ruby"
|
238
|
+
RUBY = "ruby"
|
239
239
|
|
240
240
|
##
|
241
241
|
# A platform-specific gem that is built for the packaging Ruby's platform.
|
242
242
|
# This will be replaced with Gem::Platform::local.
|
243
243
|
|
244
|
-
CURRENT = "current"
|
244
|
+
CURRENT = "current"
|
245
245
|
end
|
data/lib/rubygems/requirement.rb
CHANGED
@@ -22,7 +22,7 @@ class Gem::Requirement
|
|
22
22
|
SOURCE_SET_REQUIREMENT = Struct.new(:for_lockfile).new "!" # :nodoc:
|
23
23
|
|
24
24
|
quoted = OPS.keys.map {|k| Regexp.quote k }.join "|"
|
25
|
-
PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{Gem::Version::VERSION_PATTERN})\\s*"
|
25
|
+
PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{Gem::Version::VERSION_PATTERN})\\s*" # :nodoc:
|
26
26
|
|
27
27
|
##
|
28
28
|
# A regular expression that matches a requirement
|
data/lib/rubygems/source/git.rb
CHANGED
@@ -338,7 +338,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
338
338
|
# The simplest way is to specify the standard SPDX ID
|
339
339
|
# https://spdx.org/licenses/ for the license.
|
340
340
|
# Ideally, you should pick one that is OSI (Open Source Initiative)
|
341
|
-
#
|
341
|
+
# https://opensource.org/licenses/ approved.
|
342
342
|
#
|
343
343
|
# The most commonly used OSI-approved licenses are MIT and Apache-2.0.
|
344
344
|
# GitHub also provides a license picker at http://choosealicense.com/.
|
@@ -1021,6 +1021,12 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1021
1021
|
Gem::Dependency.new(name, *requirements).to_spec
|
1022
1022
|
end
|
1023
1023
|
|
1024
|
+
##
|
1025
|
+
# Find the best specification matching a +full_name+.
|
1026
|
+
def self.find_by_full_name(full_name)
|
1027
|
+
stubs.find {|s| s.full_name == full_name }&.to_spec
|
1028
|
+
end
|
1029
|
+
|
1024
1030
|
##
|
1025
1031
|
# Return the best specification that contains the file matching +path+.
|
1026
1032
|
|
@@ -1606,6 +1612,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1606
1612
|
def build_extensions # :nodoc:
|
1607
1613
|
return if extensions.empty?
|
1608
1614
|
return if default_gem?
|
1615
|
+
# we need to fresh build when same name and version of default gems
|
1616
|
+
return if self.class.find_by_full_name(full_name)&.default_gem?
|
1609
1617
|
return if File.exist? gem_build_complete_path
|
1610
1618
|
return if !File.writable?(base_dir)
|
1611
1619
|
return if !File.exist?(File.join(base_dir, "extensions"))
|
@@ -6,10 +6,10 @@
|
|
6
6
|
|
7
7
|
class Gem::StubSpecification < Gem::BasicSpecification
|
8
8
|
# :nodoc:
|
9
|
-
PREFIX = "# stub: "
|
9
|
+
PREFIX = "# stub: "
|
10
10
|
|
11
11
|
# :nodoc:
|
12
|
-
OPEN_MODE = "r:UTF-8:-"
|
12
|
+
OPEN_MODE = "r:UTF-8:-"
|
13
13
|
|
14
14
|
class StubLine # :nodoc: all
|
15
15
|
attr_reader :name, :version, :platform, :require_paths, :extensions,
|
@@ -19,9 +19,9 @@ class Gem::StubSpecification < Gem::BasicSpecification
|
|
19
19
|
|
20
20
|
# These are common require paths.
|
21
21
|
REQUIRE_PATHS = { # :nodoc:
|
22
|
-
"lib" => "lib"
|
23
|
-
"test" => "test"
|
24
|
-
"ext" => "ext"
|
22
|
+
"lib" => "lib",
|
23
|
+
"test" => "test",
|
24
|
+
"ext" => "ext",
|
25
25
|
}.freeze
|
26
26
|
|
27
27
|
# These are common require path lists. This hash is used to optimize
|
@@ -33,7 +33,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
|
|
33
33
|
}.freeze
|
34
34
|
|
35
35
|
def initialize(data, extensions)
|
36
|
-
parts = data[PREFIX.length..-1].split(" "
|
36
|
+
parts = data[PREFIX.length..-1].split(" ", 4)
|
37
37
|
@name = parts[0].freeze
|
38
38
|
@version = if Gem::Version.correct?(parts[1])
|
39
39
|
Gem::Version.new(parts[1])
|
@@ -50,7 +50,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
|
|
50
50
|
end
|
51
51
|
|
52
52
|
path_list = parts.last
|
53
|
-
@require_paths = REQUIRE_PATH_LIST[path_list] || path_list.split("\0"
|
53
|
+
@require_paths = REQUIRE_PATH_LIST[path_list] || path_list.split("\0").map! do |x|
|
54
54
|
REQUIRE_PATHS[x] || x
|
55
55
|
end
|
56
56
|
end
|
data/lib/rubygems/text.rb
CHANGED
@@ -9,7 +9,7 @@ module Gem::Text
|
|
9
9
|
# Remove any non-printable characters and make the text suitable for
|
10
10
|
# printing.
|
11
11
|
def clean_text(text)
|
12
|
-
text.gsub(/[\000-\b\v-\f\016-\037\177]/, "."
|
12
|
+
text.gsub(/[\000-\b\v-\f\016-\037\177]/, ".")
|
13
13
|
end
|
14
14
|
|
15
15
|
def truncate_text(text, description, max_length = 100_000)
|
@@ -4,8 +4,8 @@ require_relative "../text"
|
|
4
4
|
class Gem::Licenses
|
5
5
|
extend Gem::Text
|
6
6
|
|
7
|
-
NONSTANDARD = "Nonstandard"
|
8
|
-
LICENSE_REF = "LicenseRef-.+"
|
7
|
+
NONSTANDARD = "Nonstandard"
|
8
|
+
LICENSE_REF = "LicenseRef-.+"
|
9
9
|
|
10
10
|
# Software Package Data Exchange (SPDX) standard open-source software
|
11
11
|
# license identifiers
|
data/lib/rubygems/version.rb
CHANGED
@@ -155,7 +155,7 @@ require_relative "deprecate"
|
|
155
155
|
class Gem::Version
|
156
156
|
include Comparable
|
157
157
|
|
158
|
-
VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?'
|
158
|
+
VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc:
|
159
159
|
ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/.freeze # :nodoc:
|
160
160
|
|
161
161
|
##
|
@@ -272,7 +272,7 @@ class Gem::Version
|
|
272
272
|
# string for backwards (RubyGems 1.3.5 and earlier) compatibility.
|
273
273
|
|
274
274
|
def marshal_dump
|
275
|
-
[version]
|
275
|
+
[@version]
|
276
276
|
end
|
277
277
|
|
278
278
|
##
|
data/lib/rubygems.rb
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
require "rbconfig"
|
9
9
|
|
10
10
|
module Gem
|
11
|
-
VERSION = "3.4.
|
11
|
+
VERSION = "3.4.9"
|
12
12
|
end
|
13
13
|
|
14
14
|
# Must be first since it unloads the prelude from 1.9.2
|
@@ -824,7 +824,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
824
824
|
def self.env_requirement(gem_name)
|
825
825
|
@env_requirements_by_name ||= {}
|
826
826
|
@env_requirements_by_name[gem_name] ||= begin
|
827
|
-
req = ENV["GEM_REQUIREMENT_#{gem_name.upcase}"] || ">= 0"
|
827
|
+
req = ENV["GEM_REQUIREMENT_#{gem_name.upcase}"] || ">= 0"
|
828
828
|
Gem::Requirement.create(req)
|
829
829
|
end
|
830
830
|
end
|
@@ -1301,7 +1301,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1301
1301
|
##
|
1302
1302
|
# Location of Marshal quick gemspecs on remote repositories
|
1303
1303
|
|
1304
|
-
MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/"
|
1304
|
+
MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/"
|
1305
1305
|
|
1306
1306
|
autoload :ConfigFile, File.expand_path("rubygems/config_file", __dir__)
|
1307
1307
|
autoload :Dependency, File.expand_path("rubygems/dependency", __dir__)
|
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.4.
|
5
|
+
s.version = "3.4.9"
|
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
|
|
data/test/rubygems/helper.rb
CHANGED
@@ -563,14 +563,13 @@ class Gem::TestCase < Test::Unit::TestCase
|
|
563
563
|
Dir.chdir directory do
|
564
564
|
unless File.exist? ".git"
|
565
565
|
system @git, "init", "--quiet"
|
566
|
-
system @git, "checkout", "-b", "master", "--quiet"
|
567
566
|
system @git, "config", "user.name", "RubyGems Tests"
|
568
567
|
system @git, "config", "user.email", "rubygems@example"
|
569
568
|
end
|
570
569
|
|
571
570
|
system @git, "add", gemspec
|
572
571
|
system @git, "commit", "-a", "-m", "a non-empty commit message", "--quiet"
|
573
|
-
head = Gem::Util.popen(@git, "rev-parse", "
|
572
|
+
head = Gem::Util.popen(@git, "rev-parse", "HEAD").strip
|
574
573
|
end
|
575
574
|
|
576
575
|
return name, git_spec.version, directory, head
|
@@ -1555,7 +1554,7 @@ Also, a list:
|
|
1555
1554
|
# :stopdoc:
|
1556
1555
|
# only available in RubyGems tests
|
1557
1556
|
|
1558
|
-
PRIVATE_KEY_PASSPHRASE = "Foo bar"
|
1557
|
+
PRIVATE_KEY_PASSPHRASE = "Foo bar"
|
1559
1558
|
|
1560
1559
|
begin
|
1561
1560
|
PRIVATE_KEY = load_key "private"
|
@@ -67,7 +67,7 @@ class Gem::Package::TarTestCase < Gem::TestCase
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def calc_checksum(header)
|
70
|
-
sum = header.
|
70
|
+
sum = header.sum(0)
|
71
71
|
SP(Z(to_oct(sum, 6)))
|
72
72
|
end
|
73
73
|
|
@@ -90,31 +90,36 @@ class Gem::Package::TarTestCase < Gem::TestCase
|
|
90
90
|
ASCIIZ("wheel", 32), # char gname[32]; ASCIIZ
|
91
91
|
Z(to_oct(0, 7)), # char devmajor[8]; 0 padded, octal, null
|
92
92
|
Z(to_oct(0, 7)), # char devminor[8]; 0 padded, octal, null
|
93
|
-
ASCIIZ(dname, 155),
|
93
|
+
ASCIIZ(dname, 155), # char prefix[155]; ASCII + (Z unless filled)
|
94
94
|
]
|
95
95
|
|
96
96
|
h = arr.join
|
97
|
-
ret = h
|
97
|
+
ret = ASCIIZ(h, 512)
|
98
98
|
assert_equal(512, ret.size)
|
99
99
|
ret
|
100
100
|
end
|
101
101
|
|
102
|
-
def
|
103
|
-
h = header(
|
102
|
+
def header_with_checksum(type, fname, dname, length, mode, mtime, linkname = "")
|
103
|
+
h = header(type, fname, dname, length, mode, mtime, nil, linkname)
|
104
104
|
checksum = calc_checksum(h)
|
105
|
-
header(
|
105
|
+
header(type, fname, dname, length, mode, mtime, checksum, linkname)
|
106
|
+
end
|
107
|
+
|
108
|
+
def tar_dir_header(name, prefix, mode, mtime)
|
109
|
+
header_with_checksum("5", name, prefix, 0, mode, mtime)
|
106
110
|
end
|
107
111
|
|
108
112
|
def tar_file_header(fname, dname, mode, length, mtime)
|
109
|
-
|
110
|
-
checksum = calc_checksum(h)
|
111
|
-
header("0", fname, dname, length, mode, mtime, checksum)
|
113
|
+
header_with_checksum("0", fname, dname, length, mode, mtime)
|
112
114
|
end
|
113
115
|
|
114
|
-
def tar_symlink_header(fname,
|
115
|
-
|
116
|
-
|
117
|
-
|
116
|
+
def tar_symlink_header(fname, dname, mode, mtime, linkname)
|
117
|
+
header_with_checksum("2", fname, dname, 0, mode, mtime, linkname)
|
118
|
+
end
|
119
|
+
|
120
|
+
def tar_file_contents(content)
|
121
|
+
pad = (512 - (content.size % 512)) % 512
|
122
|
+
content + "\0" * pad
|
118
123
|
end
|
119
124
|
|
120
125
|
def to_oct(n, pad_size)
|
@@ -122,11 +127,15 @@ class Gem::Package::TarTestCase < Gem::TestCase
|
|
122
127
|
end
|
123
128
|
|
124
129
|
def util_entry(tar)
|
125
|
-
io = TempIO.new
|
130
|
+
io = tar.respond_to?(:read) ? tar : TempIO.new(tar)
|
126
131
|
|
127
132
|
header = Gem::Package::TarHeader.from io
|
128
133
|
|
129
|
-
Gem::Package::TarReader::Entry.
|
134
|
+
Gem::Package::TarReader::Entry.open header, io
|
135
|
+
end
|
136
|
+
|
137
|
+
def close_util_entry(entry)
|
138
|
+
entry.instance_variable_get(:@io).close!
|
130
139
|
end
|
131
140
|
|
132
141
|
def util_dir_entry
|
@@ -136,4 +145,30 @@ class Gem::Package::TarTestCase < Gem::TestCase
|
|
136
145
|
def util_symlink_entry
|
137
146
|
util_entry tar_symlink_header("foo", "bar", 0, Time.now, "link")
|
138
147
|
end
|
148
|
+
|
149
|
+
def util_tar(&block)
|
150
|
+
tar_io = StringIO.new
|
151
|
+
Gem::Package::TarWriter.new(tar_io, &block)
|
152
|
+
tar_io.rewind
|
153
|
+
tar_io
|
154
|
+
end
|
155
|
+
|
156
|
+
def util_tar_gz(&block)
|
157
|
+
tar_io = util_tar(&block)
|
158
|
+
StringIO.new util_gzip(tar_io.string)
|
159
|
+
end
|
160
|
+
|
161
|
+
def util_gem_data_tar(spec = nil, &block)
|
162
|
+
data_tgz = util_tar_gz(&block)
|
163
|
+
util_tar do |tar|
|
164
|
+
if spec
|
165
|
+
tar.add_file "metadata.gz", 0444 do |io|
|
166
|
+
io.write util_gzip(spec.to_yaml)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
tar.add_file "data.tar.gz", 0644 do |io|
|
170
|
+
io.write data_tgz.string
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
139
174
|
end
|
data/test/rubygems/simple_gem.rb
CHANGED