rubygems-update 3.4.19 → 3.4.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/bundler/CHANGELOG.md +29 -0
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/info.rb +1 -1
- data/bundler/lib/bundler/cli/update.rb +1 -0
- data/bundler/lib/bundler/fetcher/base.rb +2 -2
- data/bundler/lib/bundler/fetcher/compact_index.rb +1 -5
- data/bundler/lib/bundler/fetcher/dependency.rb +1 -1
- data/bundler/lib/bundler/fetcher.rb +31 -30
- data/bundler/lib/bundler/index.rb +62 -31
- data/bundler/lib/bundler/installer/standalone.rb +8 -1
- data/bundler/lib/bundler/lockfile_parser.rb +3 -15
- data/bundler/lib/bundler/man/gemfile.5 +11 -0
- data/bundler/lib/bundler/man/gemfile.5.ronn +5 -0
- data/bundler/lib/bundler/plugin.rb +1 -1
- data/bundler/lib/bundler/resolver.rb +18 -3
- data/bundler/lib/bundler/retry.rb +1 -1
- data/bundler/lib/bundler/ruby_dsl.rb +23 -2
- data/bundler/lib/bundler/self_manager.rb +2 -0
- data/bundler/lib/bundler/settings.rb +37 -13
- data/bundler/lib/bundler/source/git/git_proxy.rb +14 -2
- data/bundler/lib/bundler/source/rubygems.rb +22 -25
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +1 -1
- data/bundler/lib/bundler/version.rb +1 -1
- data/lib/rubygems/available_set.rb +1 -1
- data/lib/rubygems/basic_specification.rb +2 -2
- data/lib/rubygems/command.rb +16 -19
- data/lib/rubygems/commands/cert_command.rb +1 -1
- data/lib/rubygems/commands/dependency_command.rb +3 -4
- data/lib/rubygems/commands/owner_command.rb +8 -10
- data/lib/rubygems/commands/uninstall_command.rb +6 -7
- data/lib/rubygems/commands/unpack_command.rb +4 -6
- data/lib/rubygems/config_file.rb +1 -1
- data/lib/rubygems/core_ext/kernel_gem.rb +1 -1
- data/lib/rubygems/core_ext/kernel_warn.rb +4 -5
- data/lib/rubygems/dependency_installer.rb +8 -12
- data/lib/rubygems/deprecate.rb +2 -2
- data/lib/rubygems/gemcutter_utilities.rb +2 -2
- data/lib/rubygems/installer.rb +9 -11
- data/lib/rubygems/name_tuple.rb +1 -1
- data/lib/rubygems/package/tar_reader/entry.rb +18 -20
- data/lib/rubygems/package/tar_reader.rb +0 -5
- data/lib/rubygems/package.rb +10 -4
- data/lib/rubygems/query_utils.rb +1 -1
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/resolver/activation_request.rb +2 -4
- data/lib/rubygems/resolver/installed_specification.rb +1 -1
- data/lib/rubygems/resolver/local_specification.rb +1 -1
- data/lib/rubygems/s3_uri_signer.rb +1 -1
- data/lib/rubygems/security/trust_dir.rb +4 -6
- data/lib/rubygems/security.rb +1 -1
- data/lib/rubygems/source/local.rb +34 -37
- data/lib/rubygems/source.rb +2 -2
- data/lib/rubygems/source_list.rb +2 -2
- data/lib/rubygems/spec_fetcher.rb +29 -33
- data/lib/rubygems/specification.rb +34 -26
- data/lib/rubygems/specification_policy.rb +33 -32
- data/lib/rubygems/stub_specification.rb +13 -10
- data/lib/rubygems/uninstaller.rb +1 -1
- data/lib/rubygems/user_interaction.rb +2 -2
- data/lib/rubygems/util/licenses.rb +115 -0
- data/lib/rubygems/validator.rb +5 -7
- data/lib/rubygems.rb +5 -7
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/helper.rb +17 -19
- data/test/rubygems/test_gem.rb +4 -4
- data/test/rubygems/test_gem_commands_build_command.rb +2 -1
- data/test/rubygems/test_gem_commands_stale_command.rb +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.lock +28 -12
- data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.toml +1 -1
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +16 -14
- data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
- data/test/rubygems/test_gem_indexer.rb +1 -1
- data/test/rubygems/test_gem_package.rb +117 -2
- data/test/rubygems/test_gem_package_tar_header.rb +7 -7
- data/test/rubygems/test_gem_package_tar_reader_entry.rb +53 -1
- data/test/rubygems/test_gem_package_tar_writer.rb +13 -13
- data/test/rubygems/test_gem_remote_fetcher.rb +21 -25
- data/test/rubygems/test_gem_requirement.rb +1 -1
- data/test/rubygems/test_gem_specification.rb +42 -6
- data/test/rubygems/test_gem_update_suggestion.rb +14 -20
- data/test/rubygems/test_require.rb +4 -6
- data/test/rubygems/utilities.rb +2 -2
- metadata +3 -3
@@ -100,9 +100,7 @@ class Gem::Package::TarReader::Entry
|
|
100
100
|
# Read one byte from the tar entry
|
101
101
|
|
102
102
|
def getc
|
103
|
-
|
104
|
-
|
105
|
-
return nil if @read >= @header.size
|
103
|
+
return nil if eof?
|
106
104
|
|
107
105
|
ret = @io.getc
|
108
106
|
@read += 1 if ret
|
@@ -155,30 +153,28 @@ class Gem::Package::TarReader::Entry
|
|
155
153
|
alias length size
|
156
154
|
|
157
155
|
##
|
158
|
-
# Reads +
|
159
|
-
# nil
|
160
|
-
|
161
|
-
def read(len = nil)
|
162
|
-
check_closed
|
163
|
-
|
164
|
-
len ||= @header.size - @read
|
156
|
+
# Reads +maxlen+ bytes from the tar file entry, or the rest of the entry if nil
|
165
157
|
|
166
|
-
|
158
|
+
def read(maxlen = nil)
|
159
|
+
if eof?
|
160
|
+
return maxlen.to_i.zero? ? "" : nil
|
161
|
+
end
|
167
162
|
|
168
|
-
max_read = [
|
163
|
+
max_read = [maxlen, @header.size - @read].compact.min
|
169
164
|
|
170
165
|
ret = @io.read max_read
|
166
|
+
if ret.nil?
|
167
|
+
return maxlen ? nil : "" # IO.read returns nil on EOF with len argument
|
168
|
+
end
|
171
169
|
@read += ret.size
|
172
170
|
|
173
171
|
ret
|
174
172
|
end
|
175
173
|
|
176
|
-
def readpartial(maxlen
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
raise EOFError if maxlen > 0 && @read >= @header.size
|
174
|
+
def readpartial(maxlen, outbuf = "".b)
|
175
|
+
if eof? && maxlen > 0
|
176
|
+
raise EOFError, "end of file reached"
|
177
|
+
end
|
182
178
|
|
183
179
|
max_read = [maxlen, @header.size - @read].min
|
184
180
|
|
@@ -212,6 +208,8 @@ class Gem::Package::TarReader::Entry
|
|
212
208
|
|
213
209
|
pending = new_pos - @io.pos
|
214
210
|
|
211
|
+
return 0 if pending == 0
|
212
|
+
|
215
213
|
if @io.respond_to?(:seek)
|
216
214
|
begin
|
217
215
|
# avoid reading if the @io supports seeking
|
@@ -229,8 +227,8 @@ class Gem::Package::TarReader::Entry
|
|
229
227
|
end
|
230
228
|
|
231
229
|
while pending > 0 do
|
232
|
-
size_read = @io.read([pending, 4096].min)
|
233
|
-
raise
|
230
|
+
size_read = @io.read([pending, 4096].min)&.size
|
231
|
+
raise(EOFError, "end of file reached") if size_read.nil?
|
234
232
|
pending -= size_read
|
235
233
|
end
|
236
234
|
|
data/lib/rubygems/package.rb
CHANGED
@@ -268,7 +268,7 @@ class Gem::Package
|
|
268
268
|
|
269
269
|
tar.add_file_simple file, stat.mode, stat.size do |dst_io|
|
270
270
|
File.open file, "rb" do |src_io|
|
271
|
-
dst_io.write src_io.read
|
271
|
+
dst_io.write src_io.read 16_384 until src_io.eof?
|
272
272
|
end
|
273
273
|
end
|
274
274
|
end
|
@@ -347,6 +347,8 @@ EOM
|
|
347
347
|
return @contents
|
348
348
|
end
|
349
349
|
end
|
350
|
+
rescue Zlib::GzipFile::Error, EOFError, Gem::Package::TarInvalidError => e
|
351
|
+
raise Gem::Package::FormatError.new e.message, @gem
|
350
352
|
end
|
351
353
|
|
352
354
|
##
|
@@ -363,7 +365,7 @@ EOM
|
|
363
365
|
algorithms.each do |algorithm|
|
364
366
|
digester = Gem::Security.create_digest(algorithm)
|
365
367
|
|
366
|
-
digester << entry.
|
368
|
+
digester << entry.readpartial(16_384) until entry.eof?
|
367
369
|
|
368
370
|
entry.rewind
|
369
371
|
|
@@ -395,6 +397,8 @@ EOM
|
|
395
397
|
return # ignore further entries
|
396
398
|
end
|
397
399
|
end
|
400
|
+
rescue Zlib::GzipFile::Error, EOFError, Gem::Package::TarInvalidError => e
|
401
|
+
raise Gem::Package::FormatError.new e.message, @gem
|
398
402
|
end
|
399
403
|
|
400
404
|
##
|
@@ -409,6 +413,8 @@ EOM
|
|
409
413
|
# extracted.
|
410
414
|
|
411
415
|
def extract_tar_gz(io, destination_dir, pattern = "*") # :nodoc:
|
416
|
+
destination_dir = File.realpath(destination_dir)
|
417
|
+
|
412
418
|
directories = []
|
413
419
|
symlinks = []
|
414
420
|
|
@@ -626,7 +632,7 @@ EOM
|
|
626
632
|
raise
|
627
633
|
rescue Errno::ENOENT => e
|
628
634
|
raise Gem::Package::FormatError.new e.message
|
629
|
-
rescue Gem::Package::TarInvalidError => e
|
635
|
+
rescue Zlib::GzipFile::Error, EOFError, Gem::Package::TarInvalidError => e
|
630
636
|
raise Gem::Package::FormatError.new e.message, @gem
|
631
637
|
end
|
632
638
|
|
@@ -702,7 +708,7 @@ EOM
|
|
702
708
|
|
703
709
|
def verify_gz(entry) # :nodoc:
|
704
710
|
Zlib::GzipReader.wrap entry do |gzio|
|
705
|
-
gzio.read
|
711
|
+
gzio.read 16_384 until gzio.eof? # gzip checksum verification
|
706
712
|
end
|
707
713
|
rescue Zlib::GzipFile::Error => e
|
708
714
|
raise Gem::Package::FormatError.new(e.message, entry.full_name)
|
data/lib/rubygems/query_utils.rb
CHANGED
@@ -357,7 +357,7 @@ class Gem::RequestSet::GemDependencyAPI
|
|
357
357
|
# Use the given tag for git:, gist: and github: dependencies.
|
358
358
|
|
359
359
|
def gem(name, *requirements)
|
360
|
-
options = requirements.pop if requirements.last.
|
360
|
+
options = requirements.pop if requirements.last.is_a?(Hash)
|
361
361
|
options ||= {}
|
362
362
|
|
363
363
|
options[:git] = @current_repository if @current_repository
|
@@ -59,10 +59,8 @@ class Gem::Resolver::ActivationRequest
|
|
59
59
|
if @spec.respond_to? :sources
|
60
60
|
exception = nil
|
61
61
|
path = @spec.sources.find do |source|
|
62
|
-
|
63
|
-
|
64
|
-
rescue exception
|
65
|
-
end
|
62
|
+
source.download full_spec, path
|
63
|
+
rescue exception
|
66
64
|
end
|
67
65
|
return path if path
|
68
66
|
raise exception if exception
|
@@ -25,7 +25,7 @@ class Gem::Resolver::InstalledSpecification < Gem::Resolver::SpecSpecification
|
|
25
25
|
def installable_platform?
|
26
26
|
# BACKCOMPAT If the file is coming out of a specified file, then we
|
27
27
|
# ignore the platform. This code can be removed in RG 3.0.
|
28
|
-
return true if @source.
|
28
|
+
return true if @source.is_a? Gem::Source::SpecificFile
|
29
29
|
|
30
30
|
super
|
31
31
|
end
|
@@ -8,7 +8,7 @@ class Gem::Resolver::LocalSpecification < Gem::Resolver::SpecSpecification
|
|
8
8
|
# Returns +true+ if this gem is installable for the current platform.
|
9
9
|
|
10
10
|
def installable_platform?
|
11
|
-
return true if @source.
|
11
|
+
return true if @source.is_a? Gem::Source::SpecificFile
|
12
12
|
|
13
13
|
super
|
14
14
|
end
|
@@ -34,7 +34,7 @@ class Gem::S3URISigner
|
|
34
34
|
|
35
35
|
##
|
36
36
|
# Signs S3 URI using query-params according to the reference: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
|
37
|
-
def sign(expiration =
|
37
|
+
def sign(expiration = 86_400)
|
38
38
|
s3_config = fetch_s3_config
|
39
39
|
|
40
40
|
current_time = Time.now.utc
|
@@ -45,13 +45,11 @@ class Gem::Security::TrustDir
|
|
45
45
|
glob = File.join @dir, "*.pem"
|
46
46
|
|
47
47
|
Dir[glob].each do |certificate_file|
|
48
|
-
|
49
|
-
certificate = load_certificate certificate_file
|
48
|
+
certificate = load_certificate certificate_file
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
50
|
+
yield certificate, certificate_file
|
51
|
+
rescue OpenSSL::X509::CertificateError
|
52
|
+
next # HACK warn
|
55
53
|
end
|
56
54
|
end
|
57
55
|
|
data/lib/rubygems/security.rb
CHANGED
@@ -41,36 +41,34 @@ class Gem::Source::Local < Gem::Source
|
|
41
41
|
@specs = {}
|
42
42
|
|
43
43
|
Dir["*.gem"].each do |file|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
unless pkg.spec.version.prerelease?
|
55
|
-
names << pkg.spec.name_tuple
|
56
|
-
end
|
57
|
-
when :prerelease
|
58
|
-
if pkg.spec.version.prerelease?
|
59
|
-
names << pkg.spec.name_tuple
|
60
|
-
end
|
61
|
-
when :latest
|
62
|
-
tup = pkg.spec.name_tuple
|
63
|
-
|
64
|
-
cur = names.find {|x| x.name == tup.name }
|
65
|
-
if !cur
|
66
|
-
names << tup
|
67
|
-
elsif cur.version < tup.version
|
68
|
-
names.delete cur
|
69
|
-
names << tup
|
70
|
-
end
|
71
|
-
else
|
44
|
+
pkg = Gem::Package.new(file)
|
45
|
+
rescue SystemCallError, Gem::Package::FormatError
|
46
|
+
# ignore
|
47
|
+
else
|
48
|
+
tup = pkg.spec.name_tuple
|
49
|
+
@specs[tup] = [File.expand_path(file), pkg]
|
50
|
+
|
51
|
+
case type
|
52
|
+
when :released
|
53
|
+
unless pkg.spec.version.prerelease?
|
72
54
|
names << pkg.spec.name_tuple
|
73
55
|
end
|
56
|
+
when :prerelease
|
57
|
+
if pkg.spec.version.prerelease?
|
58
|
+
names << pkg.spec.name_tuple
|
59
|
+
end
|
60
|
+
when :latest
|
61
|
+
tup = pkg.spec.name_tuple
|
62
|
+
|
63
|
+
cur = names.find {|x| x.name == tup.name }
|
64
|
+
if !cur
|
65
|
+
names << tup
|
66
|
+
elsif cur.version < tup.version
|
67
|
+
names.delete cur
|
68
|
+
names << tup
|
69
|
+
end
|
70
|
+
else
|
71
|
+
names << pkg.spec.name_tuple
|
74
72
|
end
|
75
73
|
end
|
76
74
|
|
@@ -85,15 +83,14 @@ class Gem::Source::Local < Gem::Source
|
|
85
83
|
found = []
|
86
84
|
|
87
85
|
@specs.each do |n, data|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
end
|
86
|
+
next unless n.name == gem_name
|
87
|
+
s = data[1].spec
|
88
|
+
|
89
|
+
if version.satisfied_by?(s.version)
|
90
|
+
if prerelease
|
91
|
+
found << s
|
92
|
+
elsif !s.version.prerelease? || version.prerelease?
|
93
|
+
found << s
|
97
94
|
end
|
98
95
|
end
|
99
96
|
end
|
data/lib/rubygems/source.rb
CHANGED
@@ -44,12 +44,12 @@ class Gem::Source
|
|
44
44
|
Gem::Source::Vendor then
|
45
45
|
-1
|
46
46
|
when Gem::Source then
|
47
|
-
|
47
|
+
unless @uri
|
48
48
|
return 0 unless other.uri
|
49
49
|
return 1
|
50
50
|
end
|
51
51
|
|
52
|
-
return -1
|
52
|
+
return -1 unless other.uri
|
53
53
|
|
54
54
|
# Returning 1 here ensures that when sorting a list of sources, the
|
55
55
|
# original ordering of sources supplied by the user is preserved.
|
data/lib/rubygems/source_list.rb
CHANGED
@@ -126,7 +126,7 @@ class Gem::SourceList
|
|
126
126
|
# Gem::Source or a source URI.
|
127
127
|
|
128
128
|
def include?(other)
|
129
|
-
if other.
|
129
|
+
if other.is_a? Gem::Source
|
130
130
|
@sources.include? other
|
131
131
|
else
|
132
132
|
@sources.find {|x| x.uri.to_s == other.to_s }
|
@@ -137,7 +137,7 @@ class Gem::SourceList
|
|
137
137
|
# Deletes +source+ from the source list which may be a Gem::Source or a URI.
|
138
138
|
|
139
139
|
def delete(source)
|
140
|
-
if source.
|
140
|
+
if source.is_a? Gem::Source
|
141
141
|
@sources.delete source
|
142
142
|
else
|
143
143
|
@sources.delete_if {|x| x.uri.to_s == source.to_s }
|
@@ -155,13 +155,11 @@ class Gem::SpecFetcher
|
|
155
155
|
|
156
156
|
specs = []
|
157
157
|
tuples.each do |tup, source|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
specs << [spec, source]
|
164
|
-
end
|
158
|
+
spec = source.fetch_spec(tup)
|
159
|
+
rescue Gem::RemoteFetcher::FetchError => e
|
160
|
+
errors << Gem::SourceFetchProblem.new(source, e)
|
161
|
+
else
|
162
|
+
specs << [spec, source]
|
165
163
|
end
|
166
164
|
|
167
165
|
return [specs, errors]
|
@@ -215,34 +213,32 @@ class Gem::SpecFetcher
|
|
215
213
|
list = {}
|
216
214
|
|
217
215
|
@sources.each_source do |source|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
tuples_for(source, :prerelease)
|
238
|
-
else
|
239
|
-
raise Gem::Exception, "Unknown type - :#{type}"
|
240
|
-
end
|
241
|
-
rescue Gem::RemoteFetcher::FetchError => e
|
242
|
-
errors << Gem::SourceFetchProblem.new(source, e)
|
216
|
+
names = case type
|
217
|
+
when :latest
|
218
|
+
tuples_for source, :latest
|
219
|
+
when :released
|
220
|
+
tuples_for source, :released
|
221
|
+
when :complete
|
222
|
+
names =
|
223
|
+
tuples_for(source, :prerelease, true) +
|
224
|
+
tuples_for(source, :released)
|
225
|
+
|
226
|
+
names.sort
|
227
|
+
when :abs_latest
|
228
|
+
names =
|
229
|
+
tuples_for(source, :prerelease, true) +
|
230
|
+
tuples_for(source, :latest)
|
231
|
+
|
232
|
+
names.sort
|
233
|
+
when :prerelease
|
234
|
+
tuples_for(source, :prerelease)
|
243
235
|
else
|
244
|
-
|
236
|
+
raise Gem::Exception, "Unknown type - :#{type}"
|
245
237
|
end
|
238
|
+
rescue Gem::RemoteFetcher::FetchError => e
|
239
|
+
errors << Gem::SourceFetchProblem.new(source, e)
|
240
|
+
else
|
241
|
+
list[source] = names
|
246
242
|
end
|
247
243
|
|
248
244
|
[list, errors]
|
@@ -1301,10 +1301,20 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1301
1301
|
Gem.load_yaml
|
1302
1302
|
|
1303
1303
|
yaml_set = false
|
1304
|
+
retry_count = 0
|
1304
1305
|
|
1305
1306
|
array = begin
|
1306
1307
|
Marshal.load str
|
1307
1308
|
rescue ArgumentError => e
|
1309
|
+
# Avoid an infinite retry loop when the argument error has nothing to do
|
1310
|
+
# with the classes not being defined.
|
1311
|
+
# 1 retry each allowed in case all 3 of
|
1312
|
+
# - YAML
|
1313
|
+
# - YAML::Syck::DefaultKey
|
1314
|
+
# - YAML::PrivateType
|
1315
|
+
# need to be defined
|
1316
|
+
raise if retry_count >= 3
|
1317
|
+
|
1308
1318
|
#
|
1309
1319
|
# Some very old marshaled specs included references to `YAML::PrivateType`
|
1310
1320
|
# and `YAML::Syck::DefaultKey` constants due to bugs in the old emitter
|
@@ -1322,11 +1332,12 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1322
1332
|
if message.include?("YAML::Syck::")
|
1323
1333
|
YAML.const_set "Syck", YAML unless YAML.const_defined?(:Syck)
|
1324
1334
|
|
1325
|
-
YAML::Syck.const_set "DefaultKey", Class.new if message.include?("YAML::Syck::DefaultKey")
|
1326
|
-
elsif message.include?("YAML::PrivateType")
|
1335
|
+
YAML::Syck.const_set "DefaultKey", Class.new if message.include?("YAML::Syck::DefaultKey") && !YAML::Syck.const_defined?(:DefaultKey)
|
1336
|
+
elsif message.include?("YAML::PrivateType") && !YAML.const_defined?(:PrivateType)
|
1327
1337
|
YAML.const_set "PrivateType", Class.new
|
1328
1338
|
end
|
1329
1339
|
|
1340
|
+
retry_count += 1
|
1330
1341
|
retry
|
1331
1342
|
ensure
|
1332
1343
|
Object.__send__(:remove_const, "YAML") if yaml_set
|
@@ -1623,8 +1634,8 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1623
1634
|
# we need to fresh build when same name and version of default gems
|
1624
1635
|
return if self.class.find_by_full_name(full_name)&.default_gem?
|
1625
1636
|
return if File.exist? gem_build_complete_path
|
1626
|
-
return
|
1627
|
-
return
|
1637
|
+
return unless File.writable?(base_dir)
|
1638
|
+
return unless File.exist?(File.join(base_dir, "extensions"))
|
1628
1639
|
|
1629
1640
|
begin
|
1630
1641
|
# We need to require things in $LOAD_PATH without looking for the
|
@@ -1811,13 +1822,12 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1811
1822
|
Gem::Specification.each do |spec|
|
1812
1823
|
deps = check_dev ? spec.dependencies : spec.runtime_dependencies
|
1813
1824
|
deps.each do |dep|
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
end
|
1819
|
-
out << [spec, dep, sats]
|
1825
|
+
next unless self.satisfies_requirement?(dep)
|
1826
|
+
sats = []
|
1827
|
+
find_all_satisfiers(dep) do |sat|
|
1828
|
+
sats << sat
|
1820
1829
|
end
|
1830
|
+
out << [spec, dep, sats]
|
1821
1831
|
end
|
1822
1832
|
end
|
1823
1833
|
out
|
@@ -2256,21 +2266,20 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2256
2266
|
attributes.each do |attr_name|
|
2257
2267
|
current_value = self.send attr_name
|
2258
2268
|
current_value = current_value.sort if %i[files test_files].include? attr_name
|
2259
|
-
|
2260
|
-
|
2269
|
+
next unless current_value != default_value(attr_name) ||
|
2270
|
+
self.class.required_attribute?(attr_name)
|
2261
2271
|
|
2262
|
-
|
2272
|
+
q.text "s.#{attr_name} = "
|
2263
2273
|
|
2264
|
-
|
2265
|
-
|
2266
|
-
|
2267
|
-
q.text "Time.utc(#{current_value.year}, #{current_value.month}, #{current_value.day})"
|
2268
|
-
else
|
2269
|
-
q.pp current_value
|
2270
|
-
end
|
2274
|
+
if attr_name == :date
|
2275
|
+
current_value = current_value.utc
|
2271
2276
|
|
2272
|
-
q.
|
2277
|
+
q.text "Time.utc(#{current_value.year}, #{current_value.month}, #{current_value.day})"
|
2278
|
+
else
|
2279
|
+
q.pp current_value
|
2273
2280
|
end
|
2281
|
+
|
2282
|
+
q.breakable
|
2274
2283
|
end
|
2275
2284
|
end
|
2276
2285
|
end
|
@@ -2612,11 +2621,10 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2612
2621
|
ensure
|
2613
2622
|
trail.pop
|
2614
2623
|
end
|
2615
|
-
|
2616
|
-
|
2617
|
-
|
2618
|
-
|
2619
|
-
end
|
2624
|
+
next if result == :next
|
2625
|
+
spec_name = dep_spec.name
|
2626
|
+
dep_spec.traverse(trail, visited, &block) unless
|
2627
|
+
trail.any? {|s| s.name == spec_name }
|
2620
2628
|
end
|
2621
2629
|
end
|
2622
2630
|
ensure
|