rubygems-update 3.6.9 → 3.7.0
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 +853 -790
- data/CONTRIBUTING.md +9 -0
- data/Manifest.txt +4 -21
- data/README.md +1 -1
- data/SECURITY.md +7 -0
- data/bundler/CHANGELOG.md +1093 -1033
- data/bundler/README.md +7 -7
- data/bundler/bundler.gemspec +2 -2
- data/bundler/lib/bundler/build_metadata.rb +10 -11
- data/bundler/lib/bundler/cli/common.rb +1 -1
- data/bundler/lib/bundler/cli/config.rb +2 -2
- data/bundler/lib/bundler/cli/gem.rb +62 -30
- data/bundler/lib/bundler/cli/install.rb +4 -4
- data/bundler/lib/bundler/cli/outdated.rb +1 -1
- data/bundler/lib/bundler/cli/update.rb +2 -2
- data/bundler/lib/bundler/cli.rb +10 -14
- data/bundler/lib/bundler/compact_index_client.rb +1 -5
- data/bundler/lib/bundler/current_ruby.rb +27 -3
- data/bundler/lib/bundler/definition.rb +21 -22
- data/bundler/lib/bundler/dependency.rb +1 -1
- data/bundler/lib/bundler/dsl.rb +33 -23
- data/bundler/lib/bundler/feature_flag.rb +15 -12
- data/bundler/lib/bundler/fetcher/dependency.rb +2 -1
- data/bundler/lib/bundler/fetcher/downloader.rb +33 -7
- data/bundler/lib/bundler/fetcher.rb +49 -19
- data/bundler/lib/bundler/friendly_errors.rb +2 -1
- data/bundler/lib/bundler/index.rb +7 -2
- data/bundler/lib/bundler/installer.rb +5 -4
- data/bundler/lib/bundler/lazy_specification.rb +9 -7
- data/bundler/lib/bundler/lockfile_parser.rb +21 -5
- data/bundler/lib/bundler/man/bundle-add.1 +1 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +172 -126
- data/bundler/lib/bundler/man/bundle-config.1.ronn +91 -91
- data/bundler/lib/bundler/man/bundle-console.1 +1 -1
- data/bundler/lib/bundler/man/bundle-doctor.1 +43 -4
- data/bundler/lib/bundler/man/bundle-doctor.1.ronn +48 -4
- data/bundler/lib/bundler/man/bundle-env.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-fund.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +67 -44
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +8 -4
- data/bundler/lib/bundler/man/bundle-help.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +2 -2
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +1 -1
- data/bundler/lib/bundler/man/bundle-issue.1 +1 -1
- data/bundler/lib/bundler/man/bundle-licenses.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +1 -1
- data/bundler/lib/bundler/man/bundle-version.1 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/match_platform.rb +31 -12
- data/bundler/lib/bundler/materialization.rb +2 -2
- data/bundler/lib/bundler/resolver/package.rb +1 -1
- data/bundler/lib/bundler/resolver.rb +1 -3
- data/bundler/lib/bundler/rubygems_ext.rb +116 -120
- data/bundler/lib/bundler/rubygems_integration.rb +11 -6
- data/bundler/lib/bundler/runtime.rb +1 -1
- data/bundler/lib/bundler/self_manager.rb +32 -42
- data/bundler/lib/bundler/settings/validator.rb +0 -23
- data/bundler/lib/bundler/settings.rb +4 -6
- data/bundler/lib/bundler/shared_helpers.rb +6 -4
- data/bundler/lib/bundler/source/git/git_proxy.rb +3 -3
- data/bundler/lib/bundler/source/path.rb +7 -0
- data/bundler/lib/bundler/source_list.rb +1 -5
- data/bundler/lib/bundler/source_map.rb +1 -1
- data/bundler/lib/bundler/spec_set.rb +7 -3
- data/bundler/lib/bundler/templates/Executable +0 -11
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -5
- data/bundler/lib/bundler/ui/shell.rb +2 -2
- data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +81 -42
- data/bundler/lib/bundler/version.rb +10 -2
- data/bundler/lib/bundler/worker.rb +1 -1
- data/bundler/lib/bundler.rb +14 -12
- data/doc/bundler/UPGRADING.md +137 -127
- data/doc/rubygems/CONTRIBUTING.md +1 -1
- data/lib/rubygems/basic_specification.rb +7 -0
- data/lib/rubygems/commands/pristine_command.rb +9 -12
- data/lib/rubygems/commands/setup_command.rb +2 -2
- data/lib/rubygems/core_ext/kernel_require.rb +5 -2
- data/lib/rubygems/ext/cargo_builder.rb +4 -0
- data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +10 -3
- data/lib/rubygems/gemcutter_utilities.rb +1 -1
- data/lib/rubygems/installer.rb +45 -50
- data/lib/rubygems/platform.rb +142 -39
- data/lib/rubygems/remote_fetcher.rb +3 -3
- data/lib/rubygems/request_set.rb +3 -6
- data/lib/rubygems/resolver/best_set.rb +1 -1
- data/lib/rubygems/resolver/source_set.rb +1 -1
- data/lib/rubygems/resolver.rb +1 -1
- data/lib/rubygems/s3_uri_signer.rb +5 -3
- data/lib/rubygems/source.rb +28 -22
- data/lib/rubygems/specification.rb +2 -2
- data/lib/rubygems/uri_formatter.rb +2 -1
- data/lib/rubygems/util/licenses.rb +21 -0
- data/lib/rubygems/vendor/net-http/lib/net/http.rb +14 -19
- data/lib/rubygems/vendor/resolv/lib/resolv.rb +50 -22
- data/lib/rubygems.rb +65 -7
- data/rubygems-update.gemspec +2 -2
- data/setup.rb +1 -1
- metadata +7 -24
- data/bundler/lib/bundler/gem_helpers.rb +0 -144
- data/bundler/lib/bundler/templates/Executable.bundler +0 -109
- data/bundler/lib/bundler/vendor/fileutils/.document +0 -1
- data/bundler/lib/bundler/vendor/net-http-persistent/.document +0 -1
- data/bundler/lib/bundler/vendor/pub_grub/.document +0 -1
- data/bundler/lib/bundler/vendor/securerandom/.document +0 -1
- data/bundler/lib/bundler/vendor/thor/.document +0 -1
- data/bundler/lib/bundler/vendor/tsort/.document +0 -1
- data/bundler/lib/bundler/vendor/uri/.document +0 -1
- data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/rubygems/vendor/molinillo/.document +0 -1
- data/lib/rubygems/vendor/net-http/.document +0 -1
- data/lib/rubygems/vendor/net-protocol/.document +0 -1
- data/lib/rubygems/vendor/optparse/.document +0 -1
- data/lib/rubygems/vendor/resolv/.document +0 -1
- data/lib/rubygems/vendor/securerandom/.document +0 -1
- data/lib/rubygems/vendor/timeout/.document +0 -1
- data/lib/rubygems/vendor/tsort/.document +0 -1
- data/lib/rubygems/vendor/uri/.document +0 -1
- /data/lib/rubygems/ssl_certs/rubygems.org/{GlobalSignRootCA_R3.pem → GlobalSign.pem} +0 -0
- /data/{bundler/lib/bundler/vendor/connection_pool → lib/rubygems/vendor}/.document +0 -0
data/lib/rubygems/platform.rb
CHANGED
@@ -88,56 +88,45 @@ class Gem::Platform
|
|
88
88
|
when Array then
|
89
89
|
@cpu, @os, @version = arch
|
90
90
|
when String then
|
91
|
-
|
91
|
+
cpu, os = arch.sub(/-+$/, "").split("-", 2)
|
92
92
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
cpu = arch.shift
|
99
|
-
|
100
|
-
@cpu = case cpu
|
101
|
-
when /i\d86/ then "x86"
|
102
|
-
else cpu
|
103
|
-
end
|
104
|
-
|
105
|
-
if arch.length == 2 && arch.last.match?(/^\d+(\.\d+)?$/) # for command-line
|
106
|
-
@os, @version = arch
|
107
|
-
return
|
93
|
+
@cpu = if cpu.match?(/i\d86/)
|
94
|
+
"x86"
|
95
|
+
else
|
96
|
+
cpu
|
108
97
|
end
|
109
98
|
|
110
|
-
os, = arch
|
111
99
|
if os.nil?
|
112
100
|
@cpu = nil
|
113
101
|
os = cpu
|
114
102
|
end # legacy jruby
|
115
103
|
|
116
104
|
@os, @version = case os
|
117
|
-
when /aix(\d+)?/ then
|
118
|
-
when /cygwin/ then
|
119
|
-
when /darwin(\d+)?/ then
|
120
|
-
when
|
121
|
-
when
|
122
|
-
when
|
123
|
-
when
|
124
|
-
when /^
|
125
|
-
when /^
|
126
|
-
when /^dotnet
|
127
|
-
when
|
128
|
-
when /
|
129
|
-
when /
|
130
|
-
when /(
|
105
|
+
when /aix-?(\d+)?/ then ["aix", $1]
|
106
|
+
when /cygwin/ then ["cygwin", nil]
|
107
|
+
when /darwin-?(\d+)?/ then ["darwin", $1]
|
108
|
+
when "macruby" then ["macruby", nil]
|
109
|
+
when /^macruby-?(\d+(?:\.\d+)*)?/ then ["macruby", $1]
|
110
|
+
when /freebsd-?(\d+)?/ then ["freebsd", $1]
|
111
|
+
when "java", "jruby" then ["java", nil]
|
112
|
+
when /^java-?(\d+(?:\.\d+)*)?/ then ["java", $1]
|
113
|
+
when /^dalvik-?(\d+)?$/ then ["dalvik", $1]
|
114
|
+
when /^dotnet$/ then ["dotnet", nil]
|
115
|
+
when /^dotnet-?(\d+(?:\.\d+)*)?/ then ["dotnet", $1]
|
116
|
+
when /linux-?(\w+)?/ then ["linux", $1]
|
117
|
+
when /mingw32/ then ["mingw32", nil]
|
118
|
+
when /mingw-?(\w+)?/ then ["mingw", $1]
|
119
|
+
when /(mswin\d+)(?:[_-](\d+))?/ then
|
131
120
|
os = $1
|
132
|
-
version = $
|
133
|
-
@cpu = "x86" if @cpu.nil? && os
|
121
|
+
version = $2
|
122
|
+
@cpu = "x86" if @cpu.nil? && os.end_with?("32")
|
134
123
|
[os, version]
|
135
|
-
when /netbsdelf/ then
|
136
|
-
when /openbsd(\d+\.\d+)?/ then
|
137
|
-
when /solaris(\d+\.\d+)?/ then
|
138
|
-
when /wasi/ then
|
124
|
+
when /netbsdelf/ then ["netbsdelf", nil]
|
125
|
+
when /openbsd-?(\d+\.\d+)?/ then ["openbsd", $1]
|
126
|
+
when /solaris-?(\d+\.\d+)?/ then ["solaris", $1]
|
127
|
+
when /wasi/ then ["wasi", nil]
|
139
128
|
# test
|
140
|
-
when /^(\w+_platform)(\d+)?/ then
|
129
|
+
when /^(\w+_platform)-?(\d+)?/ then [$1, $2]
|
141
130
|
else ["unknown", nil]
|
142
131
|
end
|
143
132
|
when Gem::Platform then
|
@@ -154,7 +143,7 @@ class Gem::Platform
|
|
154
143
|
end
|
155
144
|
|
156
145
|
def to_s
|
157
|
-
to_a.compact.join "-"
|
146
|
+
to_a.compact.join(@cpu.nil? ? "" : "-")
|
158
147
|
end
|
159
148
|
|
160
149
|
##
|
@@ -266,4 +255,118 @@ class Gem::Platform
|
|
266
255
|
# This will be replaced with Gem::Platform::local.
|
267
256
|
|
268
257
|
CURRENT = "current"
|
258
|
+
|
259
|
+
JAVA = Gem::Platform.new("java") # :nodoc:
|
260
|
+
MSWIN = Gem::Platform.new("mswin32") # :nodoc:
|
261
|
+
MSWIN64 = Gem::Platform.new("mswin64") # :nodoc:
|
262
|
+
MINGW = Gem::Platform.new("x86-mingw32") # :nodoc:
|
263
|
+
X64_MINGW_LEGACY = Gem::Platform.new("x64-mingw32") # :nodoc:
|
264
|
+
X64_MINGW = Gem::Platform.new("x64-mingw-ucrt") # :nodoc:
|
265
|
+
UNIVERSAL_MINGW = Gem::Platform.new("universal-mingw") # :nodoc:
|
266
|
+
WINDOWS = [MSWIN, MSWIN64, UNIVERSAL_MINGW].freeze # :nodoc:
|
267
|
+
X64_LINUX = Gem::Platform.new("x86_64-linux") # :nodoc:
|
268
|
+
X64_LINUX_MUSL = Gem::Platform.new("x86_64-linux-musl") # :nodoc:
|
269
|
+
|
270
|
+
GENERICS = [JAVA, *WINDOWS].freeze # :nodoc:
|
271
|
+
private_constant :GENERICS
|
272
|
+
|
273
|
+
GENERIC_CACHE = GENERICS.each_with_object({}) {|g, h| h[g] = g } # :nodoc:
|
274
|
+
private_constant :GENERIC_CACHE
|
275
|
+
|
276
|
+
class << self
|
277
|
+
##
|
278
|
+
# Returns the generic platform for the given platform.
|
279
|
+
|
280
|
+
def generic(platform)
|
281
|
+
return Gem::Platform::RUBY if platform.nil? || platform == Gem::Platform::RUBY
|
282
|
+
|
283
|
+
GENERIC_CACHE[platform] ||= begin
|
284
|
+
found = GENERICS.find do |match|
|
285
|
+
platform === match
|
286
|
+
end
|
287
|
+
found || Gem::Platform::RUBY
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
##
|
292
|
+
# Returns the platform specificity match for the given spec platform and user platform.
|
293
|
+
|
294
|
+
def platform_specificity_match(spec_platform, user_platform)
|
295
|
+
return -1 if spec_platform == user_platform
|
296
|
+
return 1_000_000 if spec_platform.nil? || spec_platform == Gem::Platform::RUBY || user_platform == Gem::Platform::RUBY
|
297
|
+
|
298
|
+
os_match(spec_platform, user_platform) +
|
299
|
+
cpu_match(spec_platform, user_platform) * 10 +
|
300
|
+
version_match(spec_platform, user_platform) * 100
|
301
|
+
end
|
302
|
+
|
303
|
+
##
|
304
|
+
# Sorts and filters the best platform match for the given matching specs and platform.
|
305
|
+
|
306
|
+
def sort_and_filter_best_platform_match(matching, platform)
|
307
|
+
return matching if matching.one?
|
308
|
+
|
309
|
+
exact = matching.select {|spec| spec.platform == platform }
|
310
|
+
return exact if exact.any?
|
311
|
+
|
312
|
+
sorted_matching = sort_best_platform_match(matching, platform)
|
313
|
+
exemplary_spec = sorted_matching.first
|
314
|
+
|
315
|
+
sorted_matching.take_while {|spec| same_specificity?(platform, spec, exemplary_spec) && same_deps?(spec, exemplary_spec) }
|
316
|
+
end
|
317
|
+
|
318
|
+
##
|
319
|
+
# Sorts the best platform match for the given matching specs and platform.
|
320
|
+
|
321
|
+
def sort_best_platform_match(matching, platform)
|
322
|
+
matching.sort_by.with_index do |spec, i|
|
323
|
+
[
|
324
|
+
platform_specificity_match(spec.platform, platform),
|
325
|
+
i, # for stable sort
|
326
|
+
]
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
330
|
+
private
|
331
|
+
|
332
|
+
def same_specificity?(platform, spec, exemplary_spec)
|
333
|
+
platform_specificity_match(spec.platform, platform) == platform_specificity_match(exemplary_spec.platform, platform)
|
334
|
+
end
|
335
|
+
|
336
|
+
def same_deps?(spec, exemplary_spec)
|
337
|
+
spec.required_ruby_version == exemplary_spec.required_ruby_version &&
|
338
|
+
spec.required_rubygems_version == exemplary_spec.required_rubygems_version &&
|
339
|
+
spec.dependencies.sort == exemplary_spec.dependencies.sort
|
340
|
+
end
|
341
|
+
|
342
|
+
def os_match(spec_platform, user_platform)
|
343
|
+
if spec_platform.os == user_platform.os
|
344
|
+
0
|
345
|
+
else
|
346
|
+
1
|
347
|
+
end
|
348
|
+
end
|
349
|
+
|
350
|
+
def cpu_match(spec_platform, user_platform)
|
351
|
+
if spec_platform.cpu == user_platform.cpu
|
352
|
+
0
|
353
|
+
elsif spec_platform.cpu == "arm" && user_platform.cpu.to_s.start_with?("arm")
|
354
|
+
0
|
355
|
+
elsif spec_platform.cpu.nil? || spec_platform.cpu == "universal"
|
356
|
+
1
|
357
|
+
else
|
358
|
+
2
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
362
|
+
def version_match(spec_platform, user_platform)
|
363
|
+
if spec_platform.version == user_platform.version
|
364
|
+
0
|
365
|
+
elsif spec_platform.version.nil?
|
366
|
+
1
|
367
|
+
else
|
368
|
+
2
|
369
|
+
end
|
370
|
+
end
|
371
|
+
end
|
269
372
|
end
|
@@ -267,7 +267,7 @@ class Gem::RemoteFetcher
|
|
267
267
|
|
268
268
|
def fetch_s3(uri, mtime = nil, head = false)
|
269
269
|
begin
|
270
|
-
public_uri = s3_uri_signer(uri).sign
|
270
|
+
public_uri = s3_uri_signer(uri, head ? "HEAD" : "GET").sign
|
271
271
|
rescue Gem::S3URISigner::ConfigurationError, Gem::S3URISigner::InstanceProfileError => e
|
272
272
|
raise FetchError.new(e.message, "s3://#{uri.host}")
|
273
273
|
end
|
@@ -275,8 +275,8 @@ class Gem::RemoteFetcher
|
|
275
275
|
end
|
276
276
|
|
277
277
|
# we have our own signing code here to avoid a dependency on the aws-sdk gem
|
278
|
-
def s3_uri_signer(uri)
|
279
|
-
Gem::S3URISigner.new(uri)
|
278
|
+
def s3_uri_signer(uri, method)
|
279
|
+
Gem::S3URISigner.new(uri, method)
|
280
280
|
end
|
281
281
|
|
282
282
|
##
|
data/lib/rubygems/request_set.rb
CHANGED
@@ -181,13 +181,10 @@ class Gem::RequestSet
|
|
181
181
|
|
182
182
|
# Install requested gems after they have been downloaded
|
183
183
|
sorted_requests.each do |req|
|
184
|
-
if req.installed?
|
184
|
+
if req.installed? && @always_install.none? {|spec| spec == req.spec.spec }
|
185
185
|
req.spec.spec.build_extensions
|
186
|
-
|
187
|
-
|
188
|
-
yield req, nil if block_given?
|
189
|
-
next
|
190
|
-
end
|
186
|
+
yield req, nil if block_given?
|
187
|
+
next
|
191
188
|
end
|
192
189
|
|
193
190
|
spec =
|
@@ -42,6 +42,6 @@ class Gem::Resolver::SourceSet < Gem::Resolver::Set
|
|
42
42
|
|
43
43
|
def get_set(name)
|
44
44
|
link = @links[name]
|
45
|
-
@sets[link] ||= Gem::Source.new(link).dependency_resolver_set if link
|
45
|
+
@sets[link] ||= Gem::Source.new(link).dependency_resolver_set(@prerelease) if link
|
46
46
|
end
|
47
47
|
end
|
data/lib/rubygems/resolver.rb
CHANGED
@@ -241,7 +241,7 @@ class Gem::Resolver
|
|
241
241
|
|
242
242
|
sources.each do |source|
|
243
243
|
groups[source].
|
244
|
-
sort_by {|spec| [spec.version, spec.platform
|
244
|
+
sort_by {|spec| [spec.version, -Gem::Platform.platform_specificity_match(spec.platform, Gem::Platform.local)] }.
|
245
245
|
map {|spec| ActivationRequest.new spec, dependency }.
|
246
246
|
each {|activation_request| activation_requests << activation_request }
|
247
247
|
end
|
@@ -27,9 +27,11 @@ class Gem::S3URISigner
|
|
27
27
|
end
|
28
28
|
|
29
29
|
attr_accessor :uri
|
30
|
+
attr_accessor :method
|
30
31
|
|
31
|
-
def initialize(uri)
|
32
|
+
def initialize(uri, method)
|
32
33
|
@uri = uri
|
34
|
+
@method = method
|
33
35
|
end
|
34
36
|
|
35
37
|
##
|
@@ -38,7 +40,7 @@ class Gem::S3URISigner
|
|
38
40
|
s3_config = fetch_s3_config
|
39
41
|
|
40
42
|
current_time = Time.now.utc
|
41
|
-
date_time = current_time.strftime("%Y%m%dT%H%
|
43
|
+
date_time = current_time.strftime("%Y%m%dT%H%M%SZ")
|
42
44
|
date = date_time[0,8]
|
43
45
|
|
44
46
|
credential_info = "#{date}/#{s3_config.region}/s3/aws4_request"
|
@@ -73,7 +75,7 @@ class Gem::S3URISigner
|
|
73
75
|
|
74
76
|
def generate_canonical_request(canonical_host, query_params)
|
75
77
|
[
|
76
|
-
|
78
|
+
method.upcase,
|
77
79
|
uri.path,
|
78
80
|
query_params,
|
79
81
|
"host:#{canonical_host}",
|
data/lib/rubygems/source.rb
CHANGED
@@ -67,28 +67,11 @@ class Gem::Source
|
|
67
67
|
|
68
68
|
##
|
69
69
|
# Returns a Set that can fetch specifications from this source.
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
index_uri = uri.dup
|
76
|
-
index_uri.host = "index.rubygems.org"
|
77
|
-
index_uri
|
78
|
-
else
|
79
|
-
uri
|
80
|
-
end
|
81
|
-
|
82
|
-
bundler_api_uri = enforce_trailing_slash(fetch_uri) + "versions"
|
83
|
-
|
84
|
-
begin
|
85
|
-
fetcher = Gem::RemoteFetcher.fetcher
|
86
|
-
response = fetcher.fetch_path bundler_api_uri, nil, true
|
87
|
-
rescue Gem::RemoteFetcher::FetchError
|
88
|
-
Gem::Resolver::IndexSet.new self
|
89
|
-
else
|
90
|
-
Gem::Resolver::APISet.new response.uri + "./info/"
|
91
|
-
end
|
70
|
+
#
|
71
|
+
# The set will optionally fetch prereleases if requested.
|
72
|
+
#
|
73
|
+
def dependency_resolver_set(prerelease = false)
|
74
|
+
new_dependency_resolver_set.tap {|set| set.prerelease = prerelease }
|
92
75
|
end
|
93
76
|
|
94
77
|
def hash # :nodoc:
|
@@ -234,6 +217,29 @@ class Gem::Source
|
|
234
217
|
|
235
218
|
private
|
236
219
|
|
220
|
+
def new_dependency_resolver_set
|
221
|
+
return Gem::Resolver::IndexSet.new self if uri.scheme == "file"
|
222
|
+
|
223
|
+
fetch_uri = if uri.host == "rubygems.org"
|
224
|
+
index_uri = uri.dup
|
225
|
+
index_uri.host = "index.rubygems.org"
|
226
|
+
index_uri
|
227
|
+
else
|
228
|
+
uri
|
229
|
+
end
|
230
|
+
|
231
|
+
bundler_api_uri = enforce_trailing_slash(fetch_uri) + "versions"
|
232
|
+
|
233
|
+
begin
|
234
|
+
fetcher = Gem::RemoteFetcher.fetcher
|
235
|
+
response = fetcher.fetch_path bundler_api_uri, nil, true
|
236
|
+
rescue Gem::RemoteFetcher::FetchError
|
237
|
+
Gem::Resolver::IndexSet.new self
|
238
|
+
else
|
239
|
+
Gem::Resolver::APISet.new response.uri + "./info/"
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
237
243
|
def enforce_trailing_slash(uri)
|
238
244
|
uri.merge(uri.path.gsub(%r{/+$}, "") + "/")
|
239
245
|
end
|
@@ -1002,7 +1002,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1002
1002
|
def self.find_in_unresolved_tree(path)
|
1003
1003
|
unresolved_specs.each do |spec|
|
1004
1004
|
spec.traverse do |_from_spec, _dep, to_spec, trail|
|
1005
|
-
if to_spec.has_conflicts? || to_spec.
|
1005
|
+
if to_spec.has_conflicts? || to_spec.conflicts_when_loaded_with?(trail)
|
1006
1006
|
:next
|
1007
1007
|
else
|
1008
1008
|
return trail.reverse if to_spec.contains_requirable_file? path
|
@@ -1649,7 +1649,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
1649
1649
|
##
|
1650
1650
|
# return true if there will be conflict when spec if loaded together with the list of specs.
|
1651
1651
|
|
1652
|
-
def
|
1652
|
+
def conflicts_when_loaded_with?(list_of_specs) # :nodoc:
|
1653
1653
|
result = list_of_specs.any? do |spec|
|
1654
1654
|
spec.runtime_dependencies.any? {|dep| (dep.name == name) && !satisfies_requirement?(dep) }
|
1655
1655
|
end
|
@@ -59,12 +59,15 @@ class Gem::Licenses
|
|
59
59
|
Artistic-1.0-Perl
|
60
60
|
Artistic-1.0-cl8
|
61
61
|
Artistic-2.0
|
62
|
+
Artistic-dist
|
63
|
+
Aspell-RU
|
62
64
|
BSD-1-Clause
|
63
65
|
BSD-2-Clause
|
64
66
|
BSD-2-Clause-Darwin
|
65
67
|
BSD-2-Clause-Patent
|
66
68
|
BSD-2-Clause-Views
|
67
69
|
BSD-2-Clause-first-lines
|
70
|
+
BSD-2-Clause-pkgconf-disclaimer
|
68
71
|
BSD-3-Clause
|
69
72
|
BSD-3-Clause-Attribution
|
70
73
|
BSD-3-Clause-Clear
|
@@ -205,6 +208,7 @@ class Gem::Licenses
|
|
205
208
|
Cornell-Lossless-JPEG
|
206
209
|
Cronyx
|
207
210
|
Crossword
|
211
|
+
CryptoSwift
|
208
212
|
CrystalStacker
|
209
213
|
Cube
|
210
214
|
D-FSL-1.0
|
@@ -215,6 +219,7 @@ class Gem::Licenses
|
|
215
219
|
DRL-1.0
|
216
220
|
DRL-1.1
|
217
221
|
DSDP
|
222
|
+
DocBook-DTD
|
218
223
|
DocBook-Schema
|
219
224
|
DocBook-Stylesheet
|
220
225
|
DocBook-XML
|
@@ -240,7 +245,10 @@ class Gem::Licenses
|
|
240
245
|
FSFAP-no-warranty-disclaimer
|
241
246
|
FSFUL
|
242
247
|
FSFULLR
|
248
|
+
FSFULLRSD
|
243
249
|
FSFULLRWD
|
250
|
+
FSL-1.1-ALv2
|
251
|
+
FSL-1.1-MIT
|
244
252
|
FTL
|
245
253
|
Fair
|
246
254
|
Ferguson-Twofish
|
@@ -276,11 +284,13 @@ class Gem::Licenses
|
|
276
284
|
GPL-2.0-or-later
|
277
285
|
GPL-3.0-only
|
278
286
|
GPL-3.0-or-later
|
287
|
+
Game-Programming-Gems
|
279
288
|
Giftware
|
280
289
|
Glide
|
281
290
|
Glulxe
|
282
291
|
Graphics-Gems
|
283
292
|
Gutmann
|
293
|
+
HDF5
|
284
294
|
HIDAPI
|
285
295
|
HP-1986
|
286
296
|
HP-1989
|
@@ -426,6 +436,7 @@ class Gem::Licenses
|
|
426
436
|
NPL-1.1
|
427
437
|
NPOSL-3.0
|
428
438
|
NRL
|
439
|
+
NTIA-PD
|
429
440
|
NTP
|
430
441
|
NTP-0
|
431
442
|
Naumen
|
@@ -528,11 +539,13 @@ class Gem::Licenses
|
|
528
539
|
SMLNJ
|
529
540
|
SMPPL
|
530
541
|
SNIA
|
542
|
+
SOFA
|
531
543
|
SPL-1.0
|
532
544
|
SSH-OpenSSH
|
533
545
|
SSH-short
|
534
546
|
SSLeay-standalone
|
535
547
|
SSPL-1.0
|
548
|
+
SUL-1.0
|
536
549
|
SWL
|
537
550
|
Saxpath
|
538
551
|
SchemeReport
|
@@ -578,6 +591,8 @@ class Gem::Licenses
|
|
578
591
|
Unicode-TOU
|
579
592
|
UnixCrypt
|
580
593
|
Unlicense
|
594
|
+
Unlicense-libtelnet
|
595
|
+
Unlicense-libwhirlpool
|
581
596
|
VOSTROM
|
582
597
|
VSL-1.0
|
583
598
|
Vim
|
@@ -631,6 +646,8 @@ class Gem::Licenses
|
|
631
646
|
gtkbook
|
632
647
|
hdparm
|
633
648
|
iMatix
|
649
|
+
jove
|
650
|
+
libpng-1.6.35
|
634
651
|
libpng-2.0
|
635
652
|
libselinux-1.0
|
636
653
|
libtiff
|
@@ -638,10 +655,12 @@ class Gem::Licenses
|
|
638
655
|
lsof
|
639
656
|
magaz
|
640
657
|
mailprio
|
658
|
+
man2html
|
641
659
|
metamail
|
642
660
|
mpi-permissive
|
643
661
|
mpich2
|
644
662
|
mplus
|
663
|
+
ngrep
|
645
664
|
pkgconf
|
646
665
|
pnmstitch
|
647
666
|
psfrag
|
@@ -716,6 +735,7 @@ class Gem::Licenses
|
|
716
735
|
CLISP-exception-2.0
|
717
736
|
Classpath-exception-2.0
|
718
737
|
DigiRule-FOSS-exception
|
738
|
+
Digia-Qt-LGPL-exception-1.1
|
719
739
|
FLTK-exception
|
720
740
|
Fawkes-Runtime-exception
|
721
741
|
Font-exception-2.0
|
@@ -772,6 +792,7 @@ class Gem::Licenses
|
|
772
792
|
mif-exception
|
773
793
|
mxml-exception
|
774
794
|
openvpn-openssl-exception
|
795
|
+
polyparse-exception
|
775
796
|
romic-exception
|
776
797
|
stunnel-exception
|
777
798
|
u-boot-exception-2.0
|
@@ -475,8 +475,7 @@ module Gem::Net #:nodoc:
|
|
475
475
|
#
|
476
476
|
# - {::start}[rdoc-ref:Gem::Net::HTTP.start]:
|
477
477
|
# Begins a new session in a new \Gem::Net::HTTP object.
|
478
|
-
# - {#started?}[rdoc-ref:Gem::Net::HTTP#started?]
|
479
|
-
# (aliased as {#active?}[rdoc-ref:Gem::Net::HTTP#active?]):
|
478
|
+
# - {#started?}[rdoc-ref:Gem::Net::HTTP#started?]:
|
480
479
|
# Returns whether in a session.
|
481
480
|
# - {#finish}[rdoc-ref:Gem::Net::HTTP#finish]:
|
482
481
|
# Ends an active session.
|
@@ -556,18 +555,15 @@ module Gem::Net #:nodoc:
|
|
556
555
|
# Sends a PUT request and returns a response object.
|
557
556
|
# - {#request}[rdoc-ref:Gem::Net::HTTP#request]:
|
558
557
|
# Sends a request and returns a response object.
|
559
|
-
# - {#request_get}[rdoc-ref:Gem::Net::HTTP#request_get]
|
560
|
-
# (aliased as {#get2}[rdoc-ref:Gem::Net::HTTP#get2]):
|
558
|
+
# - {#request_get}[rdoc-ref:Gem::Net::HTTP#request_get]:
|
561
559
|
# Sends a GET request and forms a response object;
|
562
560
|
# if a block given, calls the block with the object,
|
563
561
|
# otherwise returns the object.
|
564
|
-
# - {#request_head}[rdoc-ref:Gem::Net::HTTP#request_head]
|
565
|
-
# (aliased as {#head2}[rdoc-ref:Gem::Net::HTTP#head2]):
|
562
|
+
# - {#request_head}[rdoc-ref:Gem::Net::HTTP#request_head]:
|
566
563
|
# Sends a HEAD request and forms a response object;
|
567
564
|
# if a block given, calls the block with the object,
|
568
565
|
# otherwise returns the object.
|
569
|
-
# - {#request_post}[rdoc-ref:Gem::Net::HTTP#request_post]
|
570
|
-
# (aliased as {#post2}[rdoc-ref:Gem::Net::HTTP#post2]):
|
566
|
+
# - {#request_post}[rdoc-ref:Gem::Net::HTTP#request_post]:
|
571
567
|
# Sends a POST request and forms a response object;
|
572
568
|
# if a block given, calls the block with the object,
|
573
569
|
# otherwise returns the object.
|
@@ -605,8 +601,7 @@ module Gem::Net #:nodoc:
|
|
605
601
|
# Returns whether +self+ is a proxy class.
|
606
602
|
# - {#proxy?}[rdoc-ref:Gem::Net::HTTP#proxy?]:
|
607
603
|
# Returns whether +self+ has a proxy.
|
608
|
-
# - {#proxy_address}[rdoc-ref:Gem::Net::HTTP#proxy_address]
|
609
|
-
# (aliased as {#proxyaddr}[rdoc-ref:Gem::Net::HTTP#proxyaddr]):
|
604
|
+
# - {#proxy_address}[rdoc-ref:Gem::Net::HTTP#proxy_address]:
|
610
605
|
# Returns the proxy address.
|
611
606
|
# - {#proxy_from_env?}[rdoc-ref:Gem::Net::HTTP#proxy_from_env?]:
|
612
607
|
# Returns whether the proxy is taken from an environment variable.
|
@@ -718,8 +713,7 @@ module Gem::Net #:nodoc:
|
|
718
713
|
# === \HTTP Version
|
719
714
|
#
|
720
715
|
# - {::version_1_2?}[rdoc-ref:Gem::Net::HTTP.version_1_2?]
|
721
|
-
# (aliased as {::
|
722
|
-
# and {::version_1_2}[rdoc-ref:Gem::Net::HTTP.version_1_2]):
|
716
|
+
# (aliased as {::version_1_2}[rdoc-ref:Gem::Net::HTTP.version_1_2]):
|
723
717
|
# Returns true; retained for compatibility.
|
724
718
|
#
|
725
719
|
# === Debugging
|
@@ -1552,11 +1546,11 @@ module Gem::Net #:nodoc:
|
|
1552
1546
|
attr_accessor :cert_store
|
1553
1547
|
|
1554
1548
|
# Sets or returns the available SSL ciphers.
|
1555
|
-
# See {OpenSSL::SSL::SSLContext#ciphers=}[
|
1549
|
+
# See {OpenSSL::SSL::SSLContext#ciphers=}[OpenSSL::SSL::SSL::Context#ciphers=].
|
1556
1550
|
attr_accessor :ciphers
|
1557
1551
|
|
1558
1552
|
# Sets or returns the extra X509 certificates to be added to the certificate chain.
|
1559
|
-
# See {OpenSSL::SSL::SSLContext#add_certificate}[
|
1553
|
+
# See {OpenSSL::SSL::SSLContext#add_certificate}[OpenSSL::SSL::SSL::Context#add_certificate].
|
1560
1554
|
attr_accessor :extra_chain_cert
|
1561
1555
|
|
1562
1556
|
# Sets or returns the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object.
|
@@ -1566,15 +1560,15 @@ module Gem::Net #:nodoc:
|
|
1566
1560
|
attr_accessor :ssl_timeout
|
1567
1561
|
|
1568
1562
|
# Sets or returns the SSL version.
|
1569
|
-
# See {OpenSSL::SSL::SSLContext#ssl_version=}[
|
1563
|
+
# See {OpenSSL::SSL::SSLContext#ssl_version=}[OpenSSL::SSL::SSL::Context#ssl_version=].
|
1570
1564
|
attr_accessor :ssl_version
|
1571
1565
|
|
1572
1566
|
# Sets or returns the minimum SSL version.
|
1573
|
-
# See {OpenSSL::SSL::SSLContext#min_version=}[
|
1567
|
+
# See {OpenSSL::SSL::SSLContext#min_version=}[OpenSSL::SSL::SSL::Context#min_version=].
|
1574
1568
|
attr_accessor :min_version
|
1575
1569
|
|
1576
1570
|
# Sets or returns the maximum SSL version.
|
1577
|
-
# See {OpenSSL::SSL::SSLContext#max_version=}[
|
1571
|
+
# See {OpenSSL::SSL::SSLContext#max_version=}[OpenSSL::SSL::SSL::Context#max_version=].
|
1578
1572
|
attr_accessor :max_version
|
1579
1573
|
|
1580
1574
|
# Sets or returns the callback for the server certification verification.
|
@@ -1590,7 +1584,7 @@ module Gem::Net #:nodoc:
|
|
1590
1584
|
|
1591
1585
|
# Sets or returns whether to verify that the server certificate is valid
|
1592
1586
|
# for the hostname.
|
1593
|
-
# See {OpenSSL::SSL::SSLContext#verify_hostname=}[
|
1587
|
+
# See {OpenSSL::SSL::SSLContext#verify_hostname=}[OpenSSL::SSL::SSL::Context#verify_hostname=].
|
1594
1588
|
attr_accessor :verify_hostname
|
1595
1589
|
|
1596
1590
|
# Returns the X509 certificate chain (an array of strings)
|
@@ -1923,7 +1917,8 @@ module Gem::Net #:nodoc:
|
|
1923
1917
|
private
|
1924
1918
|
|
1925
1919
|
def unescape(value)
|
1926
|
-
require 'cgi/
|
1920
|
+
require 'cgi/escape'
|
1921
|
+
require 'cgi/util' unless defined?(CGI::EscapeExt)
|
1927
1922
|
CGI.unescape(value)
|
1928
1923
|
end
|
1929
1924
|
|