rubygems-update 3.5.22 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +91 -0
- data/Manifest.txt +23 -16
- data/README.md +14 -9
- data/bundler/CHANGELOG.md +83 -0
- data/bundler/bundler.gemspec +2 -2
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/add.rb +2 -0
- data/bundler/lib/bundler/cli/check.rb +2 -2
- data/bundler/lib/bundler/cli/console.rb +0 -4
- data/bundler/lib/bundler/cli/doctor.rb +4 -4
- data/bundler/lib/bundler/cli/exec.rb +1 -0
- data/bundler/lib/bundler/cli/gem.rb +1 -1
- data/bundler/lib/bundler/cli/info.rb +2 -2
- data/bundler/lib/bundler/cli/inject.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +4 -0
- data/bundler/lib/bundler/cli/lock.rb +20 -1
- data/bundler/lib/bundler/cli/pristine.rb +1 -1
- data/bundler/lib/bundler/cli/show.rb +2 -2
- data/bundler/lib/bundler/cli.rb +23 -53
- data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -5
- data/bundler/lib/bundler/compact_index_client/updater.rb +0 -11
- data/bundler/lib/bundler/definition.rb +143 -76
- data/bundler/lib/bundler/dependency.rb +1 -1
- data/bundler/lib/bundler/dsl.rb +33 -28
- data/bundler/lib/bundler/endpoint_specification.rb +10 -1
- data/bundler/lib/bundler/errors.rb +10 -0
- data/bundler/lib/bundler/feature_flag.rb +1 -0
- data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
- data/bundler/lib/bundler/fetcher.rb +10 -3
- data/bundler/lib/bundler/gem_helpers.rb +21 -5
- data/bundler/lib/bundler/injector.rb +2 -2
- data/bundler/lib/bundler/inline.rb +12 -8
- data/bundler/lib/bundler/installer/standalone.rb +2 -2
- data/bundler/lib/bundler/installer.rb +4 -38
- data/bundler/lib/bundler/lazy_specification.rb +74 -26
- data/bundler/lib/bundler/lockfile_generator.rb +1 -1
- data/bundler/lib/bundler/lockfile_parser.rb +9 -1
- data/bundler/lib/bundler/man/bundle-add.1 +17 -11
- data/bundler/lib/bundler/man/bundle-add.1.ronn +16 -10
- data/bundler/lib/bundler/man/bundle-binstubs.1 +7 -4
- data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
- data/bundler/lib/bundler/man/bundle-cache.1 +30 -2
- data/bundler/lib/bundler/man/bundle-cache.1.ronn +31 -2
- data/bundler/lib/bundler/man/bundle-check.1 +3 -3
- data/bundler/lib/bundler/man/bundle-check.1.ronn +4 -2
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +3 -5
- data/bundler/lib/bundler/man/bundle-config.1.ronn +2 -7
- data/bundler/lib/bundler/man/bundle-console.1 +2 -4
- data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -7
- data/bundler/lib/bundler/man/bundle-doctor.1 +2 -2
- data/bundler/lib/bundler/man/bundle-doctor.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-env.1 +9 -0
- data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-exec.1 +5 -2
- data/bundler/lib/bundler/man/bundle-exec.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
- data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
- data/bundler/lib/bundler/man/bundle-gem.1 +17 -5
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +27 -6
- data/bundler/lib/bundler/man/bundle-help.1 +1 -1
- data/bundler/lib/bundler/man/bundle-info.1 +5 -2
- data/bundler/lib/bundler/man/bundle-info.1.ronn +6 -2
- data/bundler/lib/bundler/man/bundle-init.1 +3 -3
- data/bundler/lib/bundler/man/bundle-init.1.ronn +3 -2
- data/bundler/lib/bundler/man/bundle-inject.1 +10 -2
- data/bundler/lib/bundler/man/bundle-inject.1.ronn +9 -1
- data/bundler/lib/bundler/man/bundle-install.1 +15 -12
- data/bundler/lib/bundler/man/bundle-install.1.ronn +22 -18
- data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
- data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
- data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
- data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +21 -6
- data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
- data/bundler/lib/bundler/man/bundle-open.1 +2 -2
- data/bundler/lib/bundler/man/bundle-open.1.ronn +2 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +8 -5
- data/bundler/lib/bundler/man/bundle-outdated.1.ronn +8 -4
- 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-pristine.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +5 -2
- data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
- data/bundler/lib/bundler/man/bundle-update.1 +13 -7
- data/bundler/lib/bundler/man/bundle-update.1.ronn +14 -6
- data/bundler/lib/bundler/man/bundle-version.1 +1 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +4 -4
- data/bundler/lib/bundler/man/bundle-viz.1.ronn +7 -3
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +1 -1
- data/bundler/lib/bundler/man/index.txt +4 -0
- data/bundler/lib/bundler/materialization.rb +59 -0
- data/bundler/lib/bundler/plugin/events.rb +24 -0
- data/bundler/lib/bundler/plugin/installer.rb +1 -1
- data/bundler/lib/bundler/plugin.rb +20 -1
- data/bundler/lib/bundler/process_lock.rb +10 -14
- data/bundler/lib/bundler/remote_specification.rb +6 -1
- data/bundler/lib/bundler/resolver/base.rb +6 -6
- data/bundler/lib/bundler/resolver/candidate.rb +2 -2
- data/bundler/lib/bundler/resolver/spec_group.rb +4 -3
- data/bundler/lib/bundler/resolver.rb +5 -5
- data/bundler/lib/bundler/rubygems_ext.rb +30 -27
- data/bundler/lib/bundler/rubygems_gem_installer.rb +3 -2
- data/bundler/lib/bundler/rubygems_integration.rb +23 -40
- data/bundler/lib/bundler/runtime.rb +27 -7
- data/bundler/lib/bundler/self_manager.rb +2 -3
- data/bundler/lib/bundler/settings.rb +6 -1
- data/bundler/lib/bundler/shared_helpers.rb +29 -17
- data/bundler/lib/bundler/source/git/git_proxy.rb +0 -6
- data/bundler/lib/bundler/source/git.rb +56 -31
- data/bundler/lib/bundler/source/metadata.rb +2 -3
- data/bundler/lib/bundler/source/path.rb +2 -2
- data/bundler/lib/bundler/source_list.rb +1 -1
- data/bundler/lib/bundler/spec_set.rb +81 -56
- data/bundler/lib/bundler/stub_specification.rb +8 -0
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +0 -3
- data/bundler/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +15 -15
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -4
- data/bundler/lib/bundler/uri_credentials_filter.rb +1 -1
- data/bundler/lib/bundler/vendor/fileutils/COPYING +56 -0
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
- data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
- data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +5 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +11 -0
- data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +37 -16
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +9 -9
- data/bundler/lib/bundler/vendored_securerandom.rb +0 -2
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +38 -14
- data/{CONTRIBUTING.md → doc/rubygems/CONTRIBUTING.md} +9 -9
- data/{POLICIES.md → doc/rubygems/POLICIES.md} +11 -11
- data/lib/rubygems/basic_specification.rb +5 -4
- data/lib/rubygems/commands/cleanup_command.rb +2 -2
- data/lib/rubygems/commands/contents_command.rb +4 -4
- data/lib/rubygems/commands/exec_command.rb +3 -0
- data/lib/rubygems/commands/pristine_command.rb +2 -2
- data/lib/rubygems/commands/push_command.rb +29 -5
- data/lib/rubygems/commands/rdoc_command.rb +2 -2
- data/lib/rubygems/commands/rebuild_command.rb +0 -2
- data/lib/rubygems/commands/setup_command.rb +7 -16
- data/lib/rubygems/commands/unpack_command.rb +0 -6
- data/lib/rubygems/commands/update_command.rb +2 -8
- data/lib/rubygems/config_file.rb +12 -0
- data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
- data/lib/rubygems/defaults.rb +1 -1
- data/lib/rubygems/exceptions.rb +0 -6
- data/lib/rubygems/ext/builder.rb +6 -4
- data/lib/rubygems/ext/cargo_builder.rb +7 -4
- data/lib/rubygems/ext/cmake_builder.rb +7 -2
- data/lib/rubygems/ext/configure_builder.rb +7 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +9 -5
- data/lib/rubygems/ext/rake_builder.rb +6 -1
- data/lib/rubygems/gem_runner.rb +9 -0
- data/lib/rubygems/gemcutter_utilities.rb +8 -2
- data/lib/rubygems/install_update_options.rb +5 -0
- data/lib/rubygems/installer.rb +8 -9
- data/lib/rubygems/package/tar_header.rb +11 -0
- data/lib/rubygems/package/tar_reader/entry.rb +1 -5
- data/lib/rubygems/platform.rb +4 -3
- data/lib/rubygems/psych_tree.rb +4 -0
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/requirement.rb +0 -4
- data/lib/rubygems/resolver/composed_set.rb +3 -3
- data/lib/rubygems/resolver/git_set.rb +0 -1
- data/lib/rubygems/resolver/index_set.rb +2 -2
- data/lib/rubygems/resolver.rb +3 -3
- data/lib/rubygems/source/git.rb +13 -10
- data/lib/rubygems/spec_fetcher.rb +46 -7
- data/lib/rubygems/specification.rb +38 -32
- data/lib/rubygems/target_rbconfig.rb +50 -0
- data/lib/rubygems/uri.rb +1 -1
- data/lib/rubygems/util/licenses.rb +10 -1
- data/lib/rubygems/vendor/net-http/COPYING +56 -0
- data/lib/rubygems/vendor/net-http/lib/net/http/header.rb +1 -1
- data/lib/rubygems/vendor/net-http/lib/net/http/requests.rb +5 -0
- data/lib/rubygems/vendor/net-http/lib/net/http.rb +120 -36
- data/lib/rubygems/vendor/optparse/lib/optparse/ac.rb +16 -0
- data/lib/rubygems/vendor/optparse/lib/optparse/kwargs.rb +8 -3
- data/lib/rubygems/vendor/optparse/lib/optparse/version.rb +9 -0
- data/lib/rubygems/vendor/optparse/lib/optparse.rb +147 -51
- data/lib/rubygems/vendor/resolv/COPYING +56 -0
- data/lib/rubygems/vendor/resolv/lib/resolv.rb +50 -37
- data/lib/rubygems/vendor/securerandom/COPYING +56 -0
- data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +5 -5
- data/lib/rubygems/vendor/timeout/COPYING +56 -0
- data/lib/rubygems/vendor/timeout/lib/timeout.rb +5 -8
- data/lib/rubygems/vendor/uri/COPYING +56 -0
- data/lib/rubygems/vendor/uri/lib/uri/common.rb +37 -16
- data/lib/rubygems/vendor/uri/lib/uri/file.rb +3 -3
- data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +1 -1
- data/lib/rubygems/vendor/uri/lib/uri/generic.rb +16 -26
- data/lib/rubygems/vendor/uri/lib/uri/http.rb +2 -2
- data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
- data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
- data/lib/rubygems/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/rubygems/vendor/uri/lib/uri.rb +9 -9
- data/lib/rubygems/vendored_securerandom.rb +0 -1
- data/lib/rubygems/version.rb +0 -4
- data/lib/rubygems.rb +30 -20
- data/rubygems-update.gemspec +5 -5
- data/setup.rb +1 -1
- metadata +36 -27
- data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
- data/bundler/lib/bundler/vendor/securerandom/LICENSE.txt +0 -22
- data/bundler/lib/bundler/vendor/securerandom/lib/random/formatter.rb +0 -373
- data/bundler/lib/bundler/vendor/uri/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/net-http/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/net-http/lib/net/http/backward.rb +0 -40
- data/lib/rubygems/vendor/resolv/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/securerandom/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/securerandom/lib/random/formatter.rb +0 -373
- data/lib/rubygems/vendor/timeout/LICENSE.txt +0 -22
- data/lib/rubygems/vendor/uri/LICENSE.txt +0 -22
- /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
- /data/{bundler → doc/bundler}/UPGRADING.md +0 -0
- /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
@@ -3,11 +3,7 @@
|
|
3
3
|
require 'socket'
|
4
4
|
require_relative '../../timeout/lib/timeout'
|
5
5
|
require 'io/wait'
|
6
|
-
|
7
|
-
begin
|
8
|
-
require_relative '../../../vendored_securerandom'
|
9
|
-
rescue LoadError
|
10
|
-
end
|
6
|
+
require_relative '../../../vendored_securerandom'
|
11
7
|
|
12
8
|
# Gem::Resolv is a thread-aware DNS resolver library written in Ruby. Gem::Resolv can
|
13
9
|
# handle multiple DNS requests concurrently without blocking the entire Ruby
|
@@ -37,7 +33,7 @@ end
|
|
37
33
|
|
38
34
|
class Gem::Resolv
|
39
35
|
|
40
|
-
VERSION = "0.
|
36
|
+
VERSION = "0.6.0"
|
41
37
|
|
42
38
|
##
|
43
39
|
# Looks up the first IP address for +name+.
|
@@ -83,9 +79,22 @@ class Gem::Resolv
|
|
83
79
|
|
84
80
|
##
|
85
81
|
# Creates a new Gem::Resolv using +resolvers+.
|
82
|
+
#
|
83
|
+
# If +resolvers+ is not given, a hash, or +nil+, uses a Hosts resolver and
|
84
|
+
# and a DNS resolver. If +resolvers+ is a hash, uses the hash as
|
85
|
+
# configuration for the DNS resolver.
|
86
86
|
|
87
|
-
def initialize(resolvers=nil, use_ipv6: nil)
|
88
|
-
|
87
|
+
def initialize(resolvers=(arg_not_set = true; nil), use_ipv6: (keyword_not_set = true; nil))
|
88
|
+
if !keyword_not_set && !arg_not_set
|
89
|
+
warn "Support for separate use_ipv6 keyword is deprecated, as it is ignored if an argument is provided. Do not provide a positional argument if using the use_ipv6 keyword argument.", uplevel: 1
|
90
|
+
end
|
91
|
+
|
92
|
+
@resolvers = case resolvers
|
93
|
+
when Hash, nil
|
94
|
+
[Hosts.new, DNS.new(DNS::Config.default_config_hash.merge(resolvers || {}))]
|
95
|
+
else
|
96
|
+
resolvers
|
97
|
+
end
|
89
98
|
end
|
90
99
|
|
91
100
|
##
|
@@ -396,13 +405,15 @@ class Gem::Resolv
|
|
396
405
|
# be a Gem::Resolv::IPv4 or Gem::Resolv::IPv6
|
397
406
|
|
398
407
|
def each_address(name)
|
399
|
-
each_resource(name, Resource::IN::A) {|resource| yield resource.address}
|
400
408
|
if use_ipv6?
|
401
409
|
each_resource(name, Resource::IN::AAAA) {|resource| yield resource.address}
|
402
410
|
end
|
411
|
+
each_resource(name, Resource::IN::A) {|resource| yield resource.address}
|
403
412
|
end
|
404
413
|
|
405
414
|
def use_ipv6? # :nodoc:
|
415
|
+
@config.lazy_initialize unless @config.instance_variable_get(:@initialized)
|
416
|
+
|
406
417
|
use_ipv6 = @config.use_ipv6?
|
407
418
|
unless use_ipv6.nil?
|
408
419
|
return use_ipv6
|
@@ -513,35 +524,40 @@ class Gem::Resolv
|
|
513
524
|
|
514
525
|
def fetch_resource(name, typeclass)
|
515
526
|
lazy_initialize
|
516
|
-
|
517
|
-
|
527
|
+
truncated = {}
|
528
|
+
requesters = {}
|
529
|
+
udp_requester = begin
|
530
|
+
make_udp_requester
|
518
531
|
rescue Errno::EACCES
|
519
532
|
# fall back to TCP
|
520
533
|
end
|
521
534
|
senders = {}
|
535
|
+
|
522
536
|
begin
|
523
|
-
@config.resolv(name)
|
524
|
-
requester ||= make_tcp_requester(nameserver, port)
|
537
|
+
@config.resolv(name) do |candidate, tout, nameserver, port|
|
525
538
|
msg = Message.new
|
526
539
|
msg.rd = 1
|
527
540
|
msg.add_question(candidate, typeclass)
|
528
|
-
|
541
|
+
|
542
|
+
requester = requesters.fetch([nameserver, port]) do
|
543
|
+
if !truncated[candidate] && udp_requester
|
544
|
+
udp_requester
|
545
|
+
else
|
546
|
+
requesters[[nameserver, port]] = make_tcp_requester(nameserver, port)
|
547
|
+
end
|
548
|
+
end
|
549
|
+
|
550
|
+
unless sender = senders[[candidate, requester, nameserver, port]]
|
529
551
|
sender = requester.sender(msg, candidate, nameserver, port)
|
530
552
|
next if !sender
|
531
|
-
senders[[candidate, nameserver, port]] = sender
|
553
|
+
senders[[candidate, requester, nameserver, port]] = sender
|
532
554
|
end
|
533
555
|
reply, reply_name = requester.request(sender, tout)
|
534
556
|
case reply.rcode
|
535
557
|
when RCode::NoError
|
536
558
|
if reply.tc == 1 and not Requester::TCP === requester
|
537
|
-
requester.close
|
538
559
|
# Retry via TCP:
|
539
|
-
|
540
|
-
senders = {}
|
541
|
-
# This will use TCP for all remaining candidates (assuming the
|
542
|
-
# current candidate does not already respond successfully via
|
543
|
-
# TCP). This makes sense because we already know the full
|
544
|
-
# response will not fit in an untruncated UDP packet.
|
560
|
+
truncated[candidate] = true
|
545
561
|
redo
|
546
562
|
else
|
547
563
|
yield(reply, reply_name)
|
@@ -552,9 +568,10 @@ class Gem::Resolv
|
|
552
568
|
else
|
553
569
|
raise Config::OtherResolvError.new(reply_name.to_s)
|
554
570
|
end
|
555
|
-
|
571
|
+
end
|
556
572
|
ensure
|
557
|
-
|
573
|
+
udp_requester&.close
|
574
|
+
requesters.each_value { |requester| requester&.close }
|
558
575
|
end
|
559
576
|
end
|
560
577
|
|
@@ -569,6 +586,11 @@ class Gem::Resolv
|
|
569
586
|
|
570
587
|
def make_tcp_requester(host, port) # :nodoc:
|
571
588
|
return Requester::TCP.new(host, port)
|
589
|
+
rescue Errno::ECONNREFUSED
|
590
|
+
# Treat a refused TCP connection attempt to a nameserver like a timeout,
|
591
|
+
# as Gem::Resolv::DNS::Config#resolv considers ResolvTimeout exceptions as a
|
592
|
+
# hint to try the next nameserver:
|
593
|
+
raise ResolvTimeout
|
572
594
|
end
|
573
595
|
|
574
596
|
def extract_resources(msg, name, typeclass) # :nodoc:
|
@@ -602,16 +624,10 @@ class Gem::Resolv
|
|
602
624
|
}
|
603
625
|
end
|
604
626
|
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
rescue NotImplementedError
|
610
|
-
rand(arg)
|
611
|
-
end
|
612
|
-
end
|
613
|
-
else
|
614
|
-
def self.random(arg) # :nodoc:
|
627
|
+
def self.random(arg) # :nodoc:
|
628
|
+
begin
|
629
|
+
Gem::SecureRandom.random_number(arg)
|
630
|
+
rescue NotImplementedError
|
615
631
|
rand(arg)
|
616
632
|
end
|
617
633
|
end
|
@@ -1800,7 +1816,6 @@ class Gem::Resolv
|
|
1800
1816
|
end
|
1801
1817
|
end
|
1802
1818
|
|
1803
|
-
|
1804
1819
|
##
|
1805
1820
|
# Base class for SvcParam. [RFC9460]
|
1806
1821
|
|
@@ -2499,7 +2514,6 @@ class Gem::Resolv
|
|
2499
2514
|
|
2500
2515
|
attr_reader :altitude
|
2501
2516
|
|
2502
|
-
|
2503
2517
|
def encode_rdata(msg) # :nodoc:
|
2504
2518
|
msg.put_bytes(@version)
|
2505
2519
|
msg.put_bytes(@ssize.scalar)
|
@@ -3439,4 +3453,3 @@ class Gem::Resolv
|
|
3439
3453
|
AddressRegex = /(?:#{IPv4::Regex})|(?:#{IPv6::Regex})/
|
3440
3454
|
|
3441
3455
|
end
|
3442
|
-
|
@@ -0,0 +1,56 @@
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a. place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b. use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c. give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d. make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a. distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b. accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c. give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d. make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: us-ascii -*-
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require 'random/formatter'
|
5
5
|
|
6
6
|
# == Secure random number generator interface.
|
7
7
|
#
|
@@ -18,7 +18,7 @@ require_relative 'random/formatter'
|
|
18
18
|
# * /dev/urandom
|
19
19
|
# * Win32
|
20
20
|
#
|
21
|
-
# Gem::SecureRandom is extended by the
|
21
|
+
# Gem::SecureRandom is extended by the Random::Formatter module which
|
22
22
|
# defines the following methods:
|
23
23
|
#
|
24
24
|
# * alphanumeric
|
@@ -41,7 +41,7 @@ require_relative 'random/formatter'
|
|
41
41
|
module Gem::SecureRandom
|
42
42
|
|
43
43
|
# The version
|
44
|
-
VERSION = "0.
|
44
|
+
VERSION = "0.4.0"
|
45
45
|
|
46
46
|
class << self
|
47
47
|
# Returns a random binary string containing +size+ bytes.
|
@@ -88,9 +88,9 @@ module Gem::SecureRandom
|
|
88
88
|
|
89
89
|
# :startdoc:
|
90
90
|
|
91
|
-
# Generate random data bytes for
|
91
|
+
# Generate random data bytes for Random::Formatter
|
92
92
|
public :gen_random
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
-
Gem::SecureRandom.extend(
|
96
|
+
Gem::SecureRandom.extend(Random::Formatter)
|
@@ -0,0 +1,56 @@
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a. place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b. use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c. give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d. make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a. distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b. accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c. give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d. make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# == Synopsis
|
5
5
|
#
|
6
6
|
# require 'rubygems/vendor/timeout/lib/timeout'
|
7
|
-
# status = Gem::Timeout
|
7
|
+
# status = Gem::Timeout.timeout(5) {
|
8
8
|
# # Something that should be interrupted if it takes more than 5 seconds...
|
9
9
|
# }
|
10
10
|
#
|
@@ -13,28 +13,25 @@
|
|
13
13
|
# Gem::Timeout provides a way to auto-terminate a potentially long-running
|
14
14
|
# operation if it hasn't finished in a fixed amount of time.
|
15
15
|
#
|
16
|
-
# Previous versions didn't use a module for namespacing, however
|
17
|
-
# #timeout is provided for backwards compatibility. You
|
18
|
-
# should prefer Gem::Timeout.timeout instead.
|
19
|
-
#
|
20
16
|
# == Copyright
|
21
17
|
#
|
22
18
|
# Copyright:: (C) 2000 Network Applied Communication Laboratory, Inc.
|
23
19
|
# Copyright:: (C) 2000 Information-technology Promotion Agency, Japan
|
24
20
|
|
25
21
|
module Gem::Timeout
|
26
|
-
|
22
|
+
# The version
|
23
|
+
VERSION = "0.4.2"
|
27
24
|
|
28
25
|
# Internal error raised to when a timeout is triggered.
|
29
26
|
class ExitException < Exception
|
30
|
-
def exception(*)
|
27
|
+
def exception(*) # :nodoc:
|
31
28
|
self
|
32
29
|
end
|
33
30
|
end
|
34
31
|
|
35
32
|
# Raised by Gem::Timeout.timeout when the block times out.
|
36
33
|
class Error < RuntimeError
|
37
|
-
def self.handle_timeout(message)
|
34
|
+
def self.handle_timeout(message) # :nodoc:
|
38
35
|
exc = ExitException.new(message)
|
39
36
|
|
40
37
|
begin
|
@@ -0,0 +1,56 @@
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a. place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b. use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c. give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d. make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a. distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b. accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c. give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d. make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|
@@ -13,26 +13,47 @@ require_relative "rfc2396_parser"
|
|
13
13
|
require_relative "rfc3986_parser"
|
14
14
|
|
15
15
|
module Gem::URI
|
16
|
-
|
16
|
+
RFC2396_PARSER = RFC2396_Parser.new
|
17
|
+
Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
|
17
18
|
|
18
|
-
REGEXP = RFC2396_REGEXP
|
19
|
-
Parser = RFC2396_Parser
|
20
19
|
RFC3986_PARSER = RFC3986_Parser.new
|
21
20
|
Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
|
22
|
-
RFC2396_PARSER = RFC2396_Parser.new
|
23
|
-
Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
|
24
21
|
|
25
|
-
|
26
|
-
DEFAULT_PARSER
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
DEFAULT_PARSER = RFC3986_PARSER
|
23
|
+
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
|
24
|
+
|
25
|
+
def self.parser=(parser = RFC3986_PARSER)
|
26
|
+
remove_const(:Parser) if defined?(::Gem::URI::Parser)
|
27
|
+
const_set("Parser", parser.class)
|
28
|
+
|
29
|
+
remove_const(:REGEXP) if defined?(::Gem::URI::REGEXP)
|
30
|
+
remove_const(:PATTERN) if defined?(::Gem::URI::PATTERN)
|
31
|
+
if Parser == RFC2396_Parser
|
32
|
+
const_set("REGEXP", Gem::URI::RFC2396_REGEXP)
|
33
|
+
const_set("PATTERN", Gem::URI::RFC2396_REGEXP::PATTERN)
|
34
|
+
end
|
35
|
+
|
36
|
+
Parser.new.regexp.each_pair do |sym, str|
|
37
|
+
remove_const(sym) if const_defined?(sym, false)
|
38
|
+
const_set(sym, str)
|
30
39
|
end
|
31
40
|
end
|
32
|
-
|
33
|
-
|
41
|
+
self.parser = RFC3986_PARSER
|
42
|
+
|
43
|
+
def self.const_missing(const)
|
44
|
+
if const == :REGEXP
|
45
|
+
warn "Gem::URI::REGEXP is obsolete. Use Gem::URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
|
46
|
+
Gem::URI::RFC2396_REGEXP
|
47
|
+
elsif value = RFC2396_PARSER.regexp[const]
|
48
|
+
warn "Gem::URI::#{const} is obsolete. Use RFC2396_PARSER.regexp[#{const.inspect}] explicitly.", uplevel: 1 if $VERBOSE
|
49
|
+
value
|
50
|
+
elsif value = RFC2396_Parser.const_get(const)
|
51
|
+
warn "Gem::URI::#{const} is obsolete. Use RFC2396_Parser::#{const} explicitly.", uplevel: 1 if $VERBOSE
|
52
|
+
value
|
53
|
+
else
|
54
|
+
super
|
55
|
+
end
|
34
56
|
end
|
35
|
-
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
|
36
57
|
|
37
58
|
module Util # :nodoc:
|
38
59
|
def make_components_hash(klass, array_hash)
|
@@ -170,7 +191,7 @@ module Gem::URI
|
|
170
191
|
# ["fragment", "top"]]
|
171
192
|
#
|
172
193
|
def self.split(uri)
|
173
|
-
|
194
|
+
DEFAULT_PARSER.split(uri)
|
174
195
|
end
|
175
196
|
|
176
197
|
# Returns a new \Gem::URI object constructed from the given string +uri+:
|
@@ -184,7 +205,7 @@ module Gem::URI
|
|
184
205
|
# if it may contain invalid Gem::URI characters.
|
185
206
|
#
|
186
207
|
def self.parse(uri)
|
187
|
-
|
208
|
+
DEFAULT_PARSER.parse(uri)
|
188
209
|
end
|
189
210
|
|
190
211
|
# Merges the given Gem::URI strings +str+
|
@@ -211,7 +232,7 @@ module Gem::URI
|
|
211
232
|
# # => #<Gem::URI::HTTP http://example.com/foo/bar>
|
212
233
|
#
|
213
234
|
def self.join(*str)
|
214
|
-
|
235
|
+
DEFAULT_PARSER.join(*str)
|
215
236
|
end
|
216
237
|
|
217
238
|
#
|
@@ -70,17 +70,17 @@ module Gem::URI
|
|
70
70
|
|
71
71
|
# raise InvalidURIError
|
72
72
|
def check_userinfo(user)
|
73
|
-
raise Gem::URI::InvalidURIError, "
|
73
|
+
raise Gem::URI::InvalidURIError, "cannot set userinfo for file Gem::URI"
|
74
74
|
end
|
75
75
|
|
76
76
|
# raise InvalidURIError
|
77
77
|
def check_user(user)
|
78
|
-
raise Gem::URI::InvalidURIError, "
|
78
|
+
raise Gem::URI::InvalidURIError, "cannot set user for file Gem::URI"
|
79
79
|
end
|
80
80
|
|
81
81
|
# raise InvalidURIError
|
82
82
|
def check_password(user)
|
83
|
-
raise Gem::URI::InvalidURIError, "
|
83
|
+
raise Gem::URI::InvalidURIError, "cannot set password for file Gem::URI"
|
84
84
|
end
|
85
85
|
|
86
86
|
# do nothing
|
@@ -17,7 +17,7 @@ module Gem::URI
|
|
17
17
|
# This class will be redesigned because of difference of implementations;
|
18
18
|
# the structure of its path. draft-hoffman-ftp-uri-04 is a draft but it
|
19
19
|
# is a good summary about the de facto spec.
|
20
|
-
#
|
20
|
+
# https://datatracker.ietf.org/doc/html/draft-hoffman-ftp-uri-04
|
21
21
|
#
|
22
22
|
class FTP < Generic
|
23
23
|
# A Default port of 21 for Gem::URI::FTP.
|
@@ -82,7 +82,7 @@ module Gem::URI
|
|
82
82
|
if args.kind_of?(Array)
|
83
83
|
return self.build(args.collect{|x|
|
84
84
|
if x.is_a?(String)
|
85
|
-
|
85
|
+
Gem::URI::RFC2396_PARSER.escape(x)
|
86
86
|
else
|
87
87
|
x
|
88
88
|
end
|
@@ -91,7 +91,7 @@ module Gem::URI
|
|
91
91
|
tmp = {}
|
92
92
|
args.each do |key, value|
|
93
93
|
tmp[key] = if value
|
94
|
-
|
94
|
+
Gem::URI::RFC2396_PARSER.escape(value)
|
95
95
|
else
|
96
96
|
value
|
97
97
|
end
|
@@ -393,7 +393,7 @@ module Gem::URI
|
|
393
393
|
def check_user(v)
|
394
394
|
if @opaque
|
395
395
|
raise InvalidURIError,
|
396
|
-
"
|
396
|
+
"cannot set user with opaque"
|
397
397
|
end
|
398
398
|
|
399
399
|
return v unless v
|
@@ -417,7 +417,7 @@ module Gem::URI
|
|
417
417
|
def check_password(v, user = @user)
|
418
418
|
if @opaque
|
419
419
|
raise InvalidURIError,
|
420
|
-
"
|
420
|
+
"cannot set password with opaque"
|
421
421
|
end
|
422
422
|
return v unless v
|
423
423
|
|
@@ -596,7 +596,7 @@ module Gem::URI
|
|
596
596
|
|
597
597
|
if @opaque
|
598
598
|
raise InvalidURIError,
|
599
|
-
"
|
599
|
+
"cannot set host with registry or opaque"
|
600
600
|
elsif parser.regexp[:HOST] !~ v
|
601
601
|
raise InvalidComponentError,
|
602
602
|
"bad component(expected host component): #{v}"
|
@@ -685,7 +685,7 @@ module Gem::URI
|
|
685
685
|
|
686
686
|
if @opaque
|
687
687
|
raise InvalidURIError,
|
688
|
-
"
|
688
|
+
"cannot set port with registry or opaque"
|
689
689
|
elsif !v.kind_of?(Integer) && parser.regexp[:PORT] !~ v
|
690
690
|
raise InvalidComponentError,
|
691
691
|
"bad component(expected port component): #{v.inspect}"
|
@@ -733,17 +733,17 @@ module Gem::URI
|
|
733
733
|
end
|
734
734
|
|
735
735
|
def check_registry(v) # :nodoc:
|
736
|
-
raise InvalidURIError, "
|
736
|
+
raise InvalidURIError, "cannot set registry"
|
737
737
|
end
|
738
738
|
private :check_registry
|
739
739
|
|
740
740
|
def set_registry(v) #:nodoc:
|
741
|
-
raise InvalidURIError, "
|
741
|
+
raise InvalidURIError, "cannot set registry"
|
742
742
|
end
|
743
743
|
protected :set_registry
|
744
744
|
|
745
745
|
def registry=(v)
|
746
|
-
raise InvalidURIError, "
|
746
|
+
raise InvalidURIError, "cannot set registry"
|
747
747
|
end
|
748
748
|
|
749
749
|
#
|
@@ -866,7 +866,7 @@ module Gem::URI
|
|
866
866
|
# hier_part = ( net_path | abs_path ) [ "?" query ]
|
867
867
|
if @host || @port || @user || @path # userinfo = @user + ':' + @password
|
868
868
|
raise InvalidURIError,
|
869
|
-
"
|
869
|
+
"cannot set opaque with host, port, userinfo or path"
|
870
870
|
elsif v && parser.regexp[:OPAQUE] !~ v
|
871
871
|
raise InvalidComponentError,
|
872
872
|
"bad component(expected opaque component): #{v}"
|
@@ -945,7 +945,7 @@ module Gem::URI
|
|
945
945
|
# == Description
|
946
946
|
#
|
947
947
|
# Gem::URI has components listed in order of decreasing significance from left to right,
|
948
|
-
# see RFC3986 https://
|
948
|
+
# see RFC3986 https://www.rfc-editor.org/rfc/rfc3986 1.2.3.
|
949
949
|
#
|
950
950
|
# == Usage
|
951
951
|
#
|
@@ -1235,7 +1235,7 @@ module Gem::URI
|
|
1235
1235
|
return rel, rel
|
1236
1236
|
end
|
1237
1237
|
|
1238
|
-
# you can modify `rel', but
|
1238
|
+
# you can modify `rel', but cannot `oth'.
|
1239
1239
|
return oth, rel
|
1240
1240
|
end
|
1241
1241
|
private :route_from0
|
@@ -1260,7 +1260,7 @@ module Gem::URI
|
|
1260
1260
|
# #=> #<Gem::URI::Generic /main.rbx?page=1>
|
1261
1261
|
#
|
1262
1262
|
def route_from(oth)
|
1263
|
-
# you can modify `rel', but
|
1263
|
+
# you can modify `rel', but cannot `oth'.
|
1264
1264
|
begin
|
1265
1265
|
oth, rel = route_from0(oth)
|
1266
1266
|
rescue
|
@@ -1364,6 +1364,9 @@ module Gem::URI
|
|
1364
1364
|
str << ':'
|
1365
1365
|
str << @port.to_s
|
1366
1366
|
end
|
1367
|
+
if (@host || @port) && !@path.empty? && !@path.start_with?('/')
|
1368
|
+
str << '/'
|
1369
|
+
end
|
1367
1370
|
str << @path
|
1368
1371
|
if @query
|
1369
1372
|
str << '?'
|
@@ -1399,19 +1402,6 @@ module Gem::URI
|
|
1399
1402
|
self.component_ary.eql?(oth.component_ary)
|
1400
1403
|
end
|
1401
1404
|
|
1402
|
-
=begin
|
1403
|
-
|
1404
|
-
--- Gem::URI::Generic#===(oth)
|
1405
|
-
|
1406
|
-
=end
|
1407
|
-
# def ===(oth)
|
1408
|
-
# raise NotImplementedError
|
1409
|
-
# end
|
1410
|
-
|
1411
|
-
=begin
|
1412
|
-
=end
|
1413
|
-
|
1414
|
-
|
1415
1405
|
# Returns an Array of the components defined from the COMPONENT Array.
|
1416
1406
|
def component_ary
|
1417
1407
|
component.collect do |x|
|