rubygems-update 3.2.26 → 3.2.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +60 -0
- data/Manifest.txt +12 -3
- data/bundler/CHANGELOG.md +50 -1
- data/bundler/README.md +1 -1
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/check.rb +1 -1
- data/bundler/lib/bundler/cli/gem.rb +19 -2
- data/bundler/lib/bundler/cli/info.rb +11 -4
- data/bundler/lib/bundler/cli/issue.rb +4 -3
- data/bundler/lib/bundler/cli/remove.rb +1 -2
- data/bundler/lib/bundler/cli.rb +1 -0
- data/bundler/lib/bundler/compact_index_client.rb +2 -2
- data/bundler/lib/bundler/definition.rb +16 -6
- data/bundler/lib/bundler/digest.rb +71 -0
- data/bundler/lib/bundler/errors.rb +18 -2
- data/bundler/lib/bundler/fetcher.rb +2 -1
- data/bundler/lib/bundler/friendly_errors.rb +5 -30
- data/bundler/lib/bundler/gem_helper.rb +6 -17
- data/bundler/lib/bundler/installer.rb +0 -1
- data/bundler/lib/bundler/plugin/installer.rb +2 -0
- data/bundler/lib/bundler/plugin.rb +23 -6
- data/bundler/lib/bundler/rubygems_ext.rb +4 -0
- data/bundler/lib/bundler/rubygems_gem_installer.rb +20 -4
- data/bundler/lib/bundler/rubygems_integration.rb +28 -9
- data/bundler/lib/bundler/runtime.rb +1 -1
- data/bundler/lib/bundler/settings.rb +9 -1
- data/bundler/lib/bundler/source/git.rb +22 -4
- data/bundler/lib/bundler/source/rubygems.rb +43 -72
- data/bundler/lib/bundler/source.rb +2 -0
- data/bundler/lib/bundler/source_list.rb +4 -0
- data/bundler/lib/bundler/spec_set.rb +1 -1
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -1
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/bundler/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
- data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/molinillo/LICENSE +9 -0
- data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/bundler/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/bundler/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler/worker.rb +2 -2
- data/bundler/lib/bundler.rb +13 -18
- data/lib/rubygems/command_manager.rb +3 -3
- data/lib/rubygems/commands/build_command.rb +3 -3
- data/lib/rubygems/commands/cert_command.rb +15 -8
- data/lib/rubygems/commands/check_command.rb +4 -4
- data/lib/rubygems/commands/cleanup_command.rb +3 -3
- data/lib/rubygems/commands/contents_command.rb +2 -2
- data/lib/rubygems/commands/dependency_command.rb +3 -3
- data/lib/rubygems/commands/environment_command.rb +1 -1
- data/lib/rubygems/commands/fetch_command.rb +3 -3
- data/lib/rubygems/commands/generate_index_command.rb +2 -2
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/info_command.rb +2 -2
- data/lib/rubygems/commands/install_command.rb +12 -11
- data/lib/rubygems/commands/list_command.rb +2 -2
- data/lib/rubygems/commands/lock_command.rb +1 -1
- data/lib/rubygems/commands/mirror_command.rb +1 -1
- data/lib/rubygems/commands/open_command.rb +2 -2
- data/lib/rubygems/commands/outdated_command.rb +4 -4
- data/lib/rubygems/commands/owner_command.rb +4 -4
- data/lib/rubygems/commands/pristine_command.rb +5 -5
- data/lib/rubygems/commands/push_command.rb +4 -4
- data/lib/rubygems/commands/query_command.rb +3 -3
- data/lib/rubygems/commands/rdoc_command.rb +3 -3
- data/lib/rubygems/commands/search_command.rb +2 -2
- data/lib/rubygems/commands/server_command.rb +3 -3
- data/lib/rubygems/commands/setup_command.rb +6 -6
- data/lib/rubygems/commands/signin_command.rb +2 -2
- data/lib/rubygems/commands/signout_command.rb +1 -1
- data/lib/rubygems/commands/sources_command.rb +4 -4
- data/lib/rubygems/commands/specification_command.rb +4 -4
- data/lib/rubygems/commands/stale_command.rb +1 -1
- data/lib/rubygems/commands/uninstall_command.rb +3 -3
- data/lib/rubygems/commands/unpack_command.rb +5 -5
- data/lib/rubygems/commands/update_command.rb +9 -9
- data/lib/rubygems/commands/which_command.rb +1 -1
- data/lib/rubygems/commands/yank_command.rb +4 -4
- data/lib/rubygems/config_file.rb +1 -1
- data/lib/rubygems/core_ext/tcpsocket_init.rb +2 -2
- data/lib/rubygems/defaults.rb +1 -1
- data/lib/rubygems/dependency_installer.rb +8 -8
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/doctor.rb +2 -2
- data/lib/rubygems/errors.rb +1 -2
- data/lib/rubygems/exceptions.rb +1 -1
- data/lib/rubygems/gem_runner.rb +3 -3
- data/lib/rubygems/gemcutter_utilities.rb +2 -2
- data/lib/rubygems/indexer.rb +2 -2
- data/lib/rubygems/install_default_message.rb +2 -2
- data/lib/rubygems/install_message.rb +2 -2
- data/lib/rubygems/install_update_options.rb +2 -2
- data/lib/rubygems/installer.rb +8 -8
- data/lib/rubygems/local_remote_options.rb +1 -1
- data/lib/rubygems/mock_gem_ui.rb +1 -1
- data/lib/rubygems/package/tar_reader.rb +1 -1
- data/lib/rubygems/package.rb +36 -46
- data/lib/rubygems/package_task.rb +2 -2
- data/lib/rubygems/platform.rb +2 -1
- data/lib/rubygems/query_utils.rb +4 -4
- data/lib/rubygems/rdoc.rb +1 -1
- data/lib/rubygems/remote_fetcher.rb +16 -22
- data/lib/rubygems/request/connection_pools.rb +1 -1
- data/lib/rubygems/request/http_pool.rb +1 -1
- data/lib/rubygems/request.rb +7 -5
- data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
- data/lib/rubygems/request_set/lockfile.rb +1 -1
- data/lib/rubygems/request_set.rb +5 -5
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver/git_specification.rb +1 -1
- data/lib/rubygems/resolver/installer_set.rb +3 -3
- data/lib/rubygems/resolver/molinillo/LICENSE +9 -0
- data/lib/rubygems/resolver/molinillo.rb +1 -1
- data/lib/rubygems/resolver/set.rb +0 -1
- data/lib/rubygems/resolver/specification.rb +1 -1
- data/lib/rubygems/resolver.rb +31 -31
- data/lib/rubygems/s3_uri_signer.rb +4 -5
- data/lib/rubygems/security/policy.rb +6 -4
- data/lib/rubygems/security/signer.rb +4 -5
- data/lib/rubygems/security.rb +54 -20
- data/lib/rubygems/security_option.rb +2 -2
- data/lib/rubygems/server.rb +2 -2
- data/lib/rubygems/source/git.rb +2 -2
- data/lib/rubygems/source.rb +7 -7
- data/lib/rubygems/spec_fetcher.rb +5 -5
- data/lib/rubygems/specification.rb +12 -12
- data/lib/rubygems/specification_policy.rb +2 -2
- data/lib/rubygems/uninstaller.rb +6 -6
- data/lib/rubygems/uri.rb +111 -0
- data/lib/rubygems/user_interaction.rb +3 -3
- data/lib/rubygems/util/licenses.rb +1 -1
- data/lib/rubygems/util.rb +1 -1
- data/lib/rubygems/validator.rb +2 -2
- data/lib/rubygems/version_option.rb +1 -1
- data/lib/rubygems.rb +16 -16
- data/rubygems-update.gemspec +1 -1
- data/test/rubygems/helper.rb +4 -12
- data/test/rubygems/private_ec_key.pem +9 -0
- data/test/rubygems/test_gem.rb +59 -71
- data/test/rubygems/test_gem_commands_cert_command.rb +63 -4
- data/test/rubygems/test_gem_commands_install_command.rb +25 -0
- data/test/rubygems/test_gem_package.rb +27 -26
- data/test/rubygems/test_gem_platform.rb +1 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +30 -0
- data/test/rubygems/test_gem_request.rb +35 -9
- data/test/rubygems/test_gem_resolver_installer_set.rb +18 -0
- data/test/rubygems/test_gem_security.rb +32 -4
- data/test/rubygems/test_gem_source_fetch_problem.rb +10 -0
- data/test/rubygems/test_gem_specification.rb +228 -232
- data/test/rubygems/test_gem_uri.rb +39 -0
- metadata +18 -9
- data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
- data/lib/rubygems/uri_parser.rb +0 -34
- data/lib/rubygems/uri_parsing.rb +0 -23
data/lib/rubygems/exceptions.rb
CHANGED
data/lib/rubygems/gem_runner.rb
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
# See LICENSE.txt for permissions.
|
6
6
|
#++
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
require_relative '../rubygems'
|
9
|
+
require_relative 'command_manager'
|
10
|
+
require_relative 'deprecate'
|
11
11
|
|
12
12
|
##
|
13
13
|
# Load additional plugins from $LOAD_PATH
|
data/lib/rubygems/indexer.rb
CHANGED
data/lib/rubygems/installer.rb
CHANGED
@@ -5,13 +5,13 @@
|
|
5
5
|
# See LICENSE.txt for permissions.
|
6
6
|
#++
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
require_relative 'command'
|
9
|
+
require_relative 'installer_uninstaller_utils'
|
10
|
+
require_relative 'exceptions'
|
11
|
+
require_relative 'deprecate'
|
12
|
+
require_relative 'package'
|
13
|
+
require_relative 'ext'
|
14
|
+
require_relative 'user_interaction'
|
15
15
|
|
16
16
|
##
|
17
17
|
# The installer installs the files contained in the .gem into the Gem.home.
|
@@ -68,7 +68,7 @@ class Gem::Installer
|
|
68
68
|
|
69
69
|
@path_warning = false
|
70
70
|
|
71
|
-
@install_lock = Mutex.new
|
71
|
+
@install_lock = Thread::Mutex.new
|
72
72
|
|
73
73
|
class << self
|
74
74
|
##
|
data/lib/rubygems/mock_gem_ui.rb
CHANGED
data/lib/rubygems/package.rb
CHANGED
@@ -41,9 +41,9 @@
|
|
41
41
|
# #files are the files in the .gem tar file, not the Ruby files in the gem
|
42
42
|
# #extract_files and #contents automatically call #verify
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
require_relative "../rubygems"
|
45
|
+
require_relative 'security'
|
46
|
+
require_relative 'user_interaction'
|
47
47
|
|
48
48
|
class Gem::Package
|
49
49
|
include Gem::UserInteraction
|
@@ -71,6 +71,13 @@ class Gem::Package
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
class SymlinkError < Error
|
75
|
+
def initialize(name, destination, destination_dir)
|
76
|
+
super "installing symlink '%s' pointing to parent path %s of %s is not allowed" %
|
77
|
+
[name, destination, destination_dir]
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
74
81
|
class NonSeekableIO < Error; end
|
75
82
|
|
76
83
|
class TooLongFileName < Error; end
|
@@ -400,13 +407,21 @@ EOM
|
|
400
407
|
# extracted.
|
401
408
|
|
402
409
|
def extract_tar_gz(io, destination_dir, pattern = "*") # :nodoc:
|
403
|
-
directories = []
|
410
|
+
directories = []
|
404
411
|
open_tar_gz io do |tar|
|
405
412
|
tar.each do |entry|
|
406
413
|
next unless File.fnmatch pattern, entry.full_name, File::FNM_DOTMATCH
|
407
414
|
|
408
415
|
destination = install_location entry.full_name, destination_dir
|
409
416
|
|
417
|
+
if entry.symlink?
|
418
|
+
link_target = entry.header.linkname
|
419
|
+
real_destination = link_target.start_with?("/") ? link_target : File.expand_path(link_target, File.dirname(destination))
|
420
|
+
|
421
|
+
raise Gem::Package::SymlinkError.new(entry.full_name, real_destination, destination_dir) unless
|
422
|
+
normalize_path(real_destination).start_with? normalize_path(destination_dir + '/')
|
423
|
+
end
|
424
|
+
|
410
425
|
FileUtils.rm_rf destination
|
411
426
|
|
412
427
|
mkdir_options = {}
|
@@ -417,9 +432,11 @@ EOM
|
|
417
432
|
else
|
418
433
|
File.dirname destination
|
419
434
|
end
|
420
|
-
directories << mkdir if directories
|
421
435
|
|
422
|
-
|
436
|
+
unless directories.include?(mkdir)
|
437
|
+
FileUtils.mkdir_p mkdir, **mkdir_options
|
438
|
+
directories << mkdir
|
439
|
+
end
|
423
440
|
|
424
441
|
File.open destination, 'wb' do |out|
|
425
442
|
out.write entry.read
|
@@ -432,8 +449,7 @@ EOM
|
|
432
449
|
end
|
433
450
|
end
|
434
451
|
|
435
|
-
if
|
436
|
-
directories.uniq!
|
452
|
+
if dir_mode
|
437
453
|
File.chmod(dir_mode, *directories)
|
438
454
|
end
|
439
455
|
end
|
@@ -466,21 +482,11 @@ EOM
|
|
466
482
|
raise Gem::Package::PathError.new(filename, destination_dir) if
|
467
483
|
filename.start_with? '/'
|
468
484
|
|
469
|
-
destination_dir = File.
|
470
|
-
destination = File.expand_path(
|
485
|
+
destination_dir = File.realpath(destination_dir)
|
486
|
+
destination = File.expand_path(filename, destination_dir)
|
471
487
|
|
472
488
|
raise Gem::Package::PathError.new(destination, destination_dir) unless
|
473
|
-
destination.start_with? destination_dir + '/'
|
474
|
-
|
475
|
-
begin
|
476
|
-
real_destination = File.expand_path(File.realpath(destination))
|
477
|
-
rescue
|
478
|
-
# it's fine if the destination doesn't exist, because rm -rf'ing it can't cause any damage
|
479
|
-
nil
|
480
|
-
else
|
481
|
-
raise Gem::Package::PathError.new(real_destination, destination_dir) unless
|
482
|
-
real_destination.start_with? destination_dir + '/'
|
483
|
-
end
|
489
|
+
normalize_path(destination).start_with? normalize_path(destination_dir + '/')
|
484
490
|
|
485
491
|
destination.tap(&Gem::UNTAINT)
|
486
492
|
destination
|
@@ -494,22 +500,6 @@ EOM
|
|
494
500
|
end
|
495
501
|
end
|
496
502
|
|
497
|
-
def mkdir_p_safe(mkdir, mkdir_options, destination_dir, file_name)
|
498
|
-
destination_dir = File.realpath(File.expand_path(destination_dir))
|
499
|
-
parts = mkdir.split(File::SEPARATOR)
|
500
|
-
parts.reduce do |path, basename|
|
501
|
-
path = File.realpath(path) unless path == ""
|
502
|
-
path = File.expand_path(path + File::SEPARATOR + basename)
|
503
|
-
lstat = File.lstat path rescue nil
|
504
|
-
if !lstat || !lstat.directory?
|
505
|
-
unless normalize_path(path).start_with? normalize_path(destination_dir) and (FileUtils.mkdir path, **mkdir_options rescue false)
|
506
|
-
raise Gem::Package::PathError.new(file_name, destination_dir)
|
507
|
-
end
|
508
|
-
end
|
509
|
-
path
|
510
|
-
end
|
511
|
-
end
|
512
|
-
|
513
503
|
##
|
514
504
|
# Loads a Gem::Specification from the TarEntry +entry+
|
515
505
|
|
@@ -702,12 +692,12 @@ EOM
|
|
702
692
|
end
|
703
693
|
end
|
704
694
|
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
695
|
+
require_relative 'package/digest_io'
|
696
|
+
require_relative 'package/source'
|
697
|
+
require_relative 'package/file_source'
|
698
|
+
require_relative 'package/io_source'
|
699
|
+
require_relative 'package/old'
|
700
|
+
require_relative 'package/tar_header'
|
701
|
+
require_relative 'package/tar_reader'
|
702
|
+
require_relative 'package/tar_reader/entry'
|
703
|
+
require_relative 'package/tar_writer'
|
@@ -20,8 +20,8 @@
|
|
20
20
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
require_relative '../rubygems'
|
24
|
+
require_relative 'package'
|
25
25
|
require 'rake/packagetask'
|
26
26
|
|
27
27
|
##
|
data/lib/rubygems/platform.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
require_relative "deprecate"
|
3
3
|
|
4
4
|
##
|
5
5
|
# Available list of platforms for targeting Gem installations.
|
@@ -100,6 +100,7 @@ class Gem::Platform
|
|
100
100
|
when /^dotnet([\d.]*)/ then [ 'dotnet', $1 ]
|
101
101
|
when /linux-?((?!gnu)\w+)?/ then [ 'linux', $1 ]
|
102
102
|
when /mingw32/ then [ 'mingw32', nil ]
|
103
|
+
when /mingw-?(\w+)?/ then [ 'mingw', $1 ]
|
103
104
|
when /(mswin\d+)(\_(\d+))?/ then
|
104
105
|
os, version = $1, $3
|
105
106
|
@cpu = 'x86' if @cpu.nil? and os =~ /32$/
|
data/lib/rubygems/query_utils.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
require_relative 'local_remote_options'
|
4
|
+
require_relative 'spec_fetcher'
|
5
|
+
require_relative 'version_option'
|
6
|
+
require_relative 'text'
|
7
7
|
|
8
8
|
module Gem::QueryUtils
|
9
9
|
|
data/lib/rubygems/rdoc.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
require_relative '../rubygems'
|
3
|
+
require_relative 'request'
|
4
|
+
require_relative 'request/connection_pools'
|
5
|
+
require_relative 's3_uri_signer'
|
6
|
+
require_relative 'uri_formatter'
|
7
|
+
require_relative 'uri'
|
8
|
+
require_relative 'user_interaction'
|
9
9
|
|
10
10
|
##
|
11
11
|
# RemoteFetcher handles the details of fetching gems and gem information from
|
@@ -13,30 +13,24 @@ require 'rubygems/user_interaction'
|
|
13
13
|
|
14
14
|
class Gem::RemoteFetcher
|
15
15
|
include Gem::UserInteraction
|
16
|
-
include Gem::UriParsing
|
17
16
|
|
18
17
|
##
|
19
18
|
# A FetchError exception wraps up the various possible IO and HTTP failures
|
20
19
|
# that could happen while downloading from the internet.
|
21
20
|
|
22
21
|
class FetchError < Gem::Exception
|
23
|
-
include Gem::UriParsing
|
24
|
-
|
25
22
|
##
|
26
23
|
# The URI which was being accessed when the exception happened.
|
27
24
|
|
28
25
|
attr_accessor :uri, :original_uri
|
29
26
|
|
30
27
|
def initialize(message, uri)
|
31
|
-
|
32
|
-
|
33
|
-
uri = parse_uri(uri)
|
34
|
-
|
35
|
-
@original_uri = uri.dup
|
28
|
+
uri = Gem::Uri.new(uri)
|
36
29
|
|
37
|
-
|
30
|
+
super uri.redact_credentials_from(message)
|
38
31
|
|
39
|
-
@
|
32
|
+
@original_uri = uri.to_s
|
33
|
+
@uri = uri.redacted.to_s
|
40
34
|
end
|
41
35
|
|
42
36
|
def to_s # :nodoc:
|
@@ -78,7 +72,7 @@ class Gem::RemoteFetcher
|
|
78
72
|
# fetching the gem.
|
79
73
|
|
80
74
|
def initialize(proxy=nil, dns=nil, headers={})
|
81
|
-
|
75
|
+
require_relative 'core_ext/tcpsocket_init' if Gem.configuration.ipv4_fallback_enabled
|
82
76
|
require 'net/http'
|
83
77
|
require 'stringio'
|
84
78
|
require 'uri'
|
@@ -87,7 +81,7 @@ class Gem::RemoteFetcher
|
|
87
81
|
|
88
82
|
@proxy = proxy
|
89
83
|
@pools = {}
|
90
|
-
@pool_lock = Mutex.new
|
84
|
+
@pool_lock = Thread::Mutex.new
|
91
85
|
@cert_files = Gem::Request.get_cert_files
|
92
86
|
|
93
87
|
@headers = headers
|
@@ -132,7 +126,7 @@ class Gem::RemoteFetcher
|
|
132
126
|
require "fileutils"
|
133
127
|
FileUtils.mkdir_p cache_dir rescue nil unless File.exist? cache_dir
|
134
128
|
|
135
|
-
source_uri =
|
129
|
+
source_uri = Gem::Uri.new(source_uri)
|
136
130
|
|
137
131
|
scheme = source_uri.scheme
|
138
132
|
|
@@ -227,7 +221,7 @@ class Gem::RemoteFetcher
|
|
227
221
|
unless location = response['Location']
|
228
222
|
raise FetchError.new("redirecting but no redirect location was given", uri)
|
229
223
|
end
|
230
|
-
location =
|
224
|
+
location = Gem::Uri.new location
|
231
225
|
|
232
226
|
if https?(uri) && !https?(location)
|
233
227
|
raise FetchError.new("redirecting to non-https resource: #{location}", uri)
|
@@ -245,7 +239,7 @@ class Gem::RemoteFetcher
|
|
245
239
|
# Downloads +uri+ and returns it as a String.
|
246
240
|
|
247
241
|
def fetch_path(uri, mtime = nil, head = false)
|
248
|
-
uri =
|
242
|
+
uri = Gem::Uri.new uri
|
249
243
|
|
250
244
|
unless uri.scheme
|
251
245
|
raise ArgumentError, "uri scheme is invalid: #{uri.scheme.inspect}"
|
data/lib/rubygems/request.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'net/http'
|
3
|
-
|
3
|
+
require_relative 'user_interaction'
|
4
4
|
|
5
5
|
class Gem::Request
|
6
6
|
extend Gem::UserInteraction
|
@@ -96,8 +96,10 @@ class Gem::Request
|
|
96
96
|
return unless cert
|
97
97
|
case error_number
|
98
98
|
when OpenSSL::X509::V_ERR_CERT_HAS_EXPIRED then
|
99
|
+
require 'time'
|
99
100
|
"Certificate #{cert.subject} expired at #{cert.not_after.iso8601}"
|
100
101
|
when OpenSSL::X509::V_ERR_CERT_NOT_YET_VALID then
|
102
|
+
require 'time'
|
101
103
|
"Certificate #{cert.subject} not valid until #{cert.not_before.iso8601}"
|
102
104
|
when OpenSSL::X509::V_ERR_CERT_REJECTED then
|
103
105
|
"Certificate #{cert.subject} is rejected"
|
@@ -191,7 +193,7 @@ class Gem::Request
|
|
191
193
|
begin
|
192
194
|
@requests[connection.object_id] += 1
|
193
195
|
|
194
|
-
verbose "#{request.method} #{@uri}"
|
196
|
+
verbose "#{request.method} #{Gem::Uri.new(@uri).redacted}"
|
195
197
|
|
196
198
|
file_name = File.basename(@uri.path)
|
197
199
|
# perform download progress reporter only for gems
|
@@ -287,6 +289,6 @@ class Gem::Request
|
|
287
289
|
end
|
288
290
|
end
|
289
291
|
|
290
|
-
|
291
|
-
|
292
|
-
|
292
|
+
require_relative 'request/http_pool'
|
293
|
+
require_relative 'request/https_pool'
|
294
|
+
require_relative 'request/connection_pools'
|
data/lib/rubygems/request_set.rb
CHANGED
@@ -151,7 +151,7 @@ class Gem::RequestSet
|
|
151
151
|
@prerelease = options[:prerelease]
|
152
152
|
|
153
153
|
requests = []
|
154
|
-
download_queue = Queue.new
|
154
|
+
download_queue = Thread::Queue.new
|
155
155
|
|
156
156
|
# Create a thread-safe list of gems to download
|
157
157
|
sorted_requests.each do |req|
|
@@ -303,7 +303,7 @@ class Gem::RequestSet
|
|
303
303
|
end
|
304
304
|
end
|
305
305
|
|
306
|
-
|
306
|
+
require_relative "dependency_installer"
|
307
307
|
inst = Gem::DependencyInstaller.new options
|
308
308
|
inst.installed_gems.replace specs
|
309
309
|
|
@@ -461,6 +461,6 @@ class Gem::RequestSet
|
|
461
461
|
end
|
462
462
|
end
|
463
463
|
|
464
|
-
|
465
|
-
|
466
|
-
|
464
|
+
require_relative 'request_set/gem_dependency_api'
|
465
|
+
require_relative 'request_set/lockfile'
|
466
|
+
require_relative 'request_set/lockfile/tokenizer'
|
data/lib/rubygems/requirement.rb
CHANGED
@@ -77,11 +77,11 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
|
|
77
77
|
newest = found.last
|
78
78
|
|
79
79
|
unless @force
|
80
|
-
found_matching_metadata = found.
|
80
|
+
found_matching_metadata = found.reverse.find do |spec|
|
81
81
|
metadata_satisfied?(spec)
|
82
82
|
end
|
83
83
|
|
84
|
-
if found_matching_metadata.
|
84
|
+
if found_matching_metadata.nil?
|
85
85
|
if newest
|
86
86
|
ensure_required_ruby_version_met(newest.spec)
|
87
87
|
ensure_required_rubygems_version_met(newest.spec)
|
@@ -92,7 +92,7 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
|
|
92
92
|
raise exc
|
93
93
|
end
|
94
94
|
else
|
95
|
-
newest = found_matching_metadata
|
95
|
+
newest = found_matching_metadata
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
This project is licensed under the MIT license.
|
2
|
+
|
3
|
+
Copyright (c) 2014 Samuel E. Giddins segiddins@segiddins.me
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,2 +1,2 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
require_relative 'molinillo/lib/molinillo'
|