bundler 4.0.21 → 4.1.0.beta1
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/{lib/bundler/vendor/connection_pool/LICENSE → MIT.txt} +8 -6
- data/bundler.gemspec +23 -6
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/checksum.rb +40 -25
- data/lib/bundler/ci_detector.rb +1 -1
- data/lib/bundler/cli/add.rb +3 -4
- data/lib/bundler/cli/cache.rb +4 -0
- data/lib/bundler/cli/clean.rb +5 -0
- data/lib/bundler/cli/common.rb +37 -1
- data/lib/bundler/cli/config.rb +4 -2
- data/lib/bundler/cli/gem.rb +0 -17
- data/lib/bundler/cli/install.rb +4 -5
- data/lib/bundler/cli/lock.rb +1 -2
- data/lib/bundler/cli/outdated.rb +8 -3
- data/lib/bundler/cli/pristine.rb +2 -1
- data/lib/bundler/cli/update.rb +21 -12
- data/lib/bundler/cli.rb +14 -11
- data/lib/bundler/definition.rb +61 -24
- data/lib/bundler/dependency.rb +4 -0
- data/lib/bundler/dsl.rb +77 -11
- data/lib/bundler/endpoint_specification.rb +51 -14
- data/lib/bundler/env.rb +7 -24
- data/lib/bundler/errors.rb +34 -5
- data/lib/bundler/fetcher/compact_index.rb +14 -5
- data/lib/bundler/fetcher/connection_pools.rb +150 -0
- data/lib/bundler/fetcher/downloader.rb +31 -16
- data/lib/bundler/fetcher.rb +8 -47
- data/lib/bundler/injector.rb +3 -3
- data/lib/bundler/inline.rb +44 -4
- data/lib/bundler/installer/parallel_installer.rb +25 -30
- data/lib/bundler/installer.rb +20 -6
- data/lib/bundler/lazy_specification.rb +44 -17
- data/lib/bundler/lockfile_generator.rb +24 -2
- data/lib/bundler/lockfile_parser.rb +43 -5
- data/lib/bundler/man/bundle-add.1 +7 -4
- data/lib/bundler/man/bundle-add.1.ronn +8 -4
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +2 -2
- data/lib/bundler/man/bundle-cache.1.ronn +2 -2
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +38 -6
- data/lib/bundler/man/bundle-config.1.ronn +143 -10
- data/lib/bundler/man/bundle-console.1 +1 -1
- data/lib/bundler/man/bundle-doctor.1 +1 -1
- data/lib/bundler/man/bundle-env.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +1 -1
- data/lib/bundler/man/bundle-fund.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +1 -1
- data/lib/bundler/man/bundle-help.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-install.1 +2 -2
- data/lib/bundler/man/bundle-install.1.ronn +4 -4
- data/lib/bundler/man/bundle-issue.1 +1 -1
- data/lib/bundler/man/bundle-licenses.1 +1 -1
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-lock.1 +3 -3
- data/lib/bundler/man/bundle-lock.1.ronn +5 -5
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-plugin.1 +1 -1
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-show.1 +1 -1
- data/lib/bundler/man/bundle-update.1 +3 -3
- data/lib/bundler/man/bundle-update.1.ronn +3 -5
- data/lib/bundler/man/bundle-version.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +45 -1
- data/lib/bundler/man/gemfile.5.ronn +53 -0
- data/lib/bundler/match_metadata.rb +20 -0
- data/lib/bundler/match_platform.rb +25 -2
- data/lib/bundler/match_remote_metadata.rb +21 -6
- data/lib/bundler/materialization.rb +2 -1
- data/lib/bundler/override.rb +69 -0
- data/lib/bundler/plugin/dsl.rb +3 -5
- data/lib/bundler/plugin/events.rb +55 -13
- data/lib/bundler/plugin/index.rb +87 -11
- data/lib/bundler/plugin/installer/path.rb +1 -1
- data/lib/bundler/plugin/installer.rb +13 -5
- data/lib/bundler/plugin.rb +58 -30
- data/lib/bundler/remote_specification.rb +6 -3
- data/lib/bundler/resolver/base.rb +2 -1
- data/lib/bundler/resolver/incompatibility.rb +1 -1
- data/lib/bundler/resolver.rb +73 -23
- data/lib/bundler/ruby_version.rb +0 -2
- data/lib/bundler/rubygems_ext.rb +71 -1
- data/lib/bundler/rubygems_gem_installer.rb +41 -2
- data/lib/bundler/rubygems_integration.rb +7 -2
- data/lib/bundler/runtime.rb +69 -2
- data/lib/bundler/self_manager.rb +9 -15
- data/lib/bundler/settings.rb +373 -30
- data/lib/bundler/shared_helpers.rb +2 -1
- data/lib/bundler/source/git/git_proxy.rb +2 -10
- data/lib/bundler/source/git.rb +15 -6
- data/lib/bundler/source/path/installer.rb +1 -1
- data/lib/bundler/source/rubygems/remote.rb +10 -5
- data/lib/bundler/source/rubygems.rb +48 -12
- data/lib/bundler/spec_set.rb +16 -4
- data/lib/bundler/stub_specification.rb +2 -1
- data/lib/bundler/templates/newgem/Gemfile.tt +4 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -3
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -1
- data/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +1 -1
- data/lib/bundler/ui/shell.rb +0 -4
- data/lib/bundler/ui/silent.rb +0 -4
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +35 -2
- data/lib/bundler/vendor/thor/lib/thor/base.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +14 -6
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +2 -0
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +34 -1
- data/lib/bundler/vendored_pub_grub.rb +5 -2
- data/lib/bundler/vendored_securerandom.rb +11 -8
- data/lib/bundler/vendored_uri.rb +14 -14
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +3 -2
- data/lib/bundler.rb +1 -1
- data/lib/rubygems/compact_index_client/cache.rb +122 -0
- data/lib/rubygems/compact_index_client/cache_file.rb +147 -0
- data/lib/rubygems/compact_index_client/http_fetcher.rb +88 -0
- data/lib/rubygems/compact_index_client/parser.rb +90 -0
- data/lib/rubygems/compact_index_client/updater.rb +113 -0
- data/lib/rubygems/compact_index_client.rb +111 -0
- data/lib/rubygems/cooldown_settings.rb +57 -0
- data/lib/rubygems/credential_store/native/linux.rb +97 -0
- data/lib/rubygems/credential_store/native/macos.rb +88 -0
- data/lib/rubygems/credential_store/native/windows.rb +130 -0
- data/lib/rubygems/credential_store.rb +332 -0
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/assignment.rb +1 -1
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +7 -7
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/failure_writer.rb +1 -1
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/incompatibility.rb +4 -4
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/package.rb +1 -1
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/partial_solution.rb +1 -1
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/rubygems.rb +3 -3
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/solve_failure.rb +1 -1
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/static_package_source.rb +3 -3
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/strategy.rb +2 -2
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/term.rb +1 -1
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/version.rb +1 -1
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/version_constraint.rb +3 -3
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/version_range.rb +1 -1
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/version_solver.rb +2 -2
- data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/version_union.rb +1 -1
- data/lib/rubygems/vendor/pub_grub/lib/pub_grub.rb +57 -0
- data/lib/{bundler → rubygems}/vendor/securerandom/lib/securerandom.rb +10 -6
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/common.rb +119 -119
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/file.rb +13 -13
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/ftp.rb +24 -24
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/generic.rb +132 -132
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/http.rb +18 -18
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/https.rb +4 -4
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/ldap.rb +14 -14
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/ldaps.rb +4 -4
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/mailto.rb +21 -21
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/rfc2396_parser.rb +39 -39
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/rfc3986_parser.rb +14 -14
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/ws.rb +12 -12
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri/wss.rb +4 -4
- data/lib/{bundler → rubygems}/vendor/uri/lib/uri.rb +35 -31
- data/lib/rubygems/yaml_serializer.rb +880 -0
- metadata +77 -68
- data/CHANGELOG.md +0 -5784
- data/LICENSE.md +0 -22
- data/README.md +0 -58
- data/lib/bundler/compact_index_client/cache.rb +0 -107
- data/lib/bundler/compact_index_client/cache_file.rb +0 -148
- data/lib/bundler/compact_index_client/parser.rb +0 -87
- data/lib/bundler/compact_index_client/updater.rb +0 -105
- data/lib/bundler/compact_index_client.rb +0 -92
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +0 -227
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +0 -3
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -56
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +0 -230
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +0 -82
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +0 -41
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +0 -65
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +0 -80
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +0 -1153
- data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +0 -31
- data/lib/bundler/vendored_persistent.rb +0 -11
- data/lib/bundler/yaml_serializer.rb +0 -98
- /data/lib/{bundler → rubygems}/vendor/pub_grub/LICENSE.txt +0 -0
- /data/lib/{bundler → rubygems}/vendor/securerandom/COPYING +0 -0
- /data/lib/{bundler → rubygems}/vendor/uri/COPYING +0 -0
|
@@ -4,26 +4,26 @@
|
|
|
4
4
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
|
5
5
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
|
6
6
|
#
|
|
7
|
-
# See
|
|
7
|
+
# See Gem::URI for general documentation
|
|
8
8
|
#
|
|
9
9
|
|
|
10
10
|
require_relative 'generic'
|
|
11
11
|
|
|
12
|
-
module
|
|
12
|
+
module Gem::URI
|
|
13
13
|
|
|
14
14
|
#
|
|
15
15
|
# The syntax of HTTP URIs is defined in RFC1738 section 3.3.
|
|
16
16
|
#
|
|
17
|
-
# Note that the Ruby
|
|
17
|
+
# Note that the Ruby Gem::URI library allows HTTP URLs containing usernames and
|
|
18
18
|
# passwords. This is not legal as per the RFC, but used to be
|
|
19
19
|
# supported in Internet Explorer 5 and 6, before the MS04-004 security
|
|
20
20
|
# update. See <URL:http://support.microsoft.com/kb/834489>.
|
|
21
21
|
#
|
|
22
22
|
class HTTP < Generic
|
|
23
|
-
# A Default port of 80 for
|
|
23
|
+
# A Default port of 80 for Gem::URI::HTTP.
|
|
24
24
|
DEFAULT_PORT = 80
|
|
25
25
|
|
|
26
|
-
# An Array of the available components for
|
|
26
|
+
# An Array of the available components for Gem::URI::HTTP.
|
|
27
27
|
COMPONENT = %i[
|
|
28
28
|
scheme
|
|
29
29
|
userinfo host port
|
|
@@ -35,7 +35,7 @@ module Bundler::URI
|
|
|
35
35
|
#
|
|
36
36
|
# == Description
|
|
37
37
|
#
|
|
38
|
-
# Creates a new
|
|
38
|
+
# Creates a new Gem::URI::HTTP object from components, with syntax checking.
|
|
39
39
|
#
|
|
40
40
|
# The components accepted are userinfo, host, port, path, query, and
|
|
41
41
|
# fragment.
|
|
@@ -48,9 +48,9 @@ module Bundler::URI
|
|
|
48
48
|
#
|
|
49
49
|
# Example:
|
|
50
50
|
#
|
|
51
|
-
# uri =
|
|
51
|
+
# uri = Gem::URI::HTTP.build(host: 'www.example.com', path: '/foo/bar')
|
|
52
52
|
#
|
|
53
|
-
# uri =
|
|
53
|
+
# uri = Gem::URI::HTTP.build([nil, "www.example.com", nil, "/path",
|
|
54
54
|
# "query", 'fragment'])
|
|
55
55
|
#
|
|
56
56
|
# Currently, if passed userinfo components this method generates
|
|
@@ -78,12 +78,12 @@ module Bundler::URI
|
|
|
78
78
|
#
|
|
79
79
|
# Returns the full path for an HTTP request, as required by Net::HTTP::Get.
|
|
80
80
|
#
|
|
81
|
-
# If the
|
|
82
|
-
# Otherwise, the path is simply
|
|
81
|
+
# If the Gem::URI contains a query, the full path is Gem::URI#path + '?' + Gem::URI#query.
|
|
82
|
+
# Otherwise, the path is simply Gem::URI#path.
|
|
83
83
|
#
|
|
84
84
|
# Example:
|
|
85
85
|
#
|
|
86
|
-
# uri =
|
|
86
|
+
# uri = Gem::URI::HTTP.build(path: '/foo/bar', query: 'test=true')
|
|
87
87
|
# uri.request_uri # => "/foo/bar?test=true"
|
|
88
88
|
#
|
|
89
89
|
def request_uri
|
|
@@ -102,9 +102,9 @@ module Bundler::URI
|
|
|
102
102
|
#
|
|
103
103
|
# Example:
|
|
104
104
|
#
|
|
105
|
-
#
|
|
106
|
-
#
|
|
107
|
-
#
|
|
105
|
+
# Gem::URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').authority #=> "www.example.com"
|
|
106
|
+
# Gem::URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').authority #=> "www.example.com:8000"
|
|
107
|
+
# Gem::URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').authority #=> "www.example.com"
|
|
108
108
|
#
|
|
109
109
|
def authority
|
|
110
110
|
if port == default_port
|
|
@@ -123,10 +123,10 @@ module Bundler::URI
|
|
|
123
123
|
#
|
|
124
124
|
# Example:
|
|
125
125
|
#
|
|
126
|
-
#
|
|
127
|
-
#
|
|
128
|
-
#
|
|
129
|
-
#
|
|
126
|
+
# Gem::URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').origin #=> "http://www.example.com"
|
|
127
|
+
# Gem::URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').origin #=> "http://www.example.com:8000"
|
|
128
|
+
# Gem::URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').origin #=> "http://www.example.com"
|
|
129
|
+
# Gem::URI::HTTPS.build(host: 'www.example.com', path: '/foo/bar').origin #=> "https://www.example.com"
|
|
130
130
|
#
|
|
131
131
|
def origin
|
|
132
132
|
"#{scheme}://#{authority}"
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
|
5
5
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
|
6
6
|
#
|
|
7
|
-
# See
|
|
7
|
+
# See Gem::URI for general documentation
|
|
8
8
|
#
|
|
9
9
|
|
|
10
10
|
require_relative 'http'
|
|
11
11
|
|
|
12
|
-
module
|
|
12
|
+
module Gem::URI
|
|
13
13
|
|
|
14
14
|
# The default port for HTTPS URIs is 443, and the scheme is 'https:' rather
|
|
15
15
|
# than 'http:'. Other than that, HTTPS URIs are identical to HTTP URIs;
|
|
16
|
-
# see
|
|
16
|
+
# see Gem::URI::HTTP.
|
|
17
17
|
class HTTPS < HTTP
|
|
18
|
-
# A Default port of 443 for
|
|
18
|
+
# A Default port of 443 for Gem::URI::HTTPS
|
|
19
19
|
DEFAULT_PORT = 443
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -5,27 +5,27 @@
|
|
|
5
5
|
# Takaaki Tateishi <ttate@jaist.ac.jp>
|
|
6
6
|
# Akira Yamada <akira@ruby-lang.org>
|
|
7
7
|
# License::
|
|
8
|
-
#
|
|
8
|
+
# Gem::URI::LDAP is copyrighted free software by Takaaki Tateishi and Akira Yamada.
|
|
9
9
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
|
10
10
|
#
|
|
11
|
-
# See
|
|
11
|
+
# See Gem::URI for general documentation
|
|
12
12
|
#
|
|
13
13
|
|
|
14
14
|
require_relative 'generic'
|
|
15
15
|
|
|
16
|
-
module
|
|
16
|
+
module Gem::URI
|
|
17
17
|
|
|
18
18
|
#
|
|
19
|
-
# LDAP
|
|
19
|
+
# LDAP Gem::URI SCHEMA (described in RFC2255).
|
|
20
20
|
#--
|
|
21
21
|
# ldap://<host>/<dn>[?<attrs>[?<scope>[?<filter>[?<extensions>]]]]
|
|
22
22
|
#++
|
|
23
23
|
class LDAP < Generic
|
|
24
24
|
|
|
25
|
-
# A Default port of 389 for
|
|
25
|
+
# A Default port of 389 for Gem::URI::LDAP.
|
|
26
26
|
DEFAULT_PORT = 389
|
|
27
27
|
|
|
28
|
-
# An Array of the available components for
|
|
28
|
+
# An Array of the available components for Gem::URI::LDAP.
|
|
29
29
|
COMPONENT = [
|
|
30
30
|
:scheme,
|
|
31
31
|
:host, :port,
|
|
@@ -52,7 +52,7 @@ module Bundler::URI
|
|
|
52
52
|
#
|
|
53
53
|
# == Description
|
|
54
54
|
#
|
|
55
|
-
# Creates a new
|
|
55
|
+
# Creates a new Gem::URI::LDAP object from components, with syntax checking.
|
|
56
56
|
#
|
|
57
57
|
# The components accepted are host, port, dn, attributes,
|
|
58
58
|
# scope, filter, and extensions.
|
|
@@ -65,10 +65,10 @@ module Bundler::URI
|
|
|
65
65
|
#
|
|
66
66
|
# Example:
|
|
67
67
|
#
|
|
68
|
-
# uri =
|
|
68
|
+
# uri = Gem::URI::LDAP.build({:host => 'ldap.example.com',
|
|
69
69
|
# :dn => '/dc=example'})
|
|
70
70
|
#
|
|
71
|
-
# uri =
|
|
71
|
+
# uri = Gem::URI::LDAP.build(["ldap.example.com", nil,
|
|
72
72
|
# "/dc=example;dc=com", "query", nil, nil, nil])
|
|
73
73
|
#
|
|
74
74
|
def self.build(args)
|
|
@@ -92,7 +92,7 @@ module Bundler::URI
|
|
|
92
92
|
#
|
|
93
93
|
# == Description
|
|
94
94
|
#
|
|
95
|
-
# Creates a new
|
|
95
|
+
# Creates a new Gem::URI::LDAP object from generic Gem::URI components as per
|
|
96
96
|
# RFC 2396. No LDAP-specific syntax checking is performed.
|
|
97
97
|
#
|
|
98
98
|
# Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+,
|
|
@@ -100,10 +100,10 @@ module Bundler::URI
|
|
|
100
100
|
#
|
|
101
101
|
# Example:
|
|
102
102
|
#
|
|
103
|
-
# uri =
|
|
103
|
+
# uri = Gem::URI::LDAP.new("ldap", nil, "ldap.example.com", nil, nil,
|
|
104
104
|
# "/dc=example;dc=com", nil, "query", nil)
|
|
105
105
|
#
|
|
106
|
-
# See also
|
|
106
|
+
# See also Gem::URI::Generic.new.
|
|
107
107
|
#
|
|
108
108
|
def initialize(*arg)
|
|
109
109
|
super(*arg)
|
|
@@ -250,8 +250,8 @@ module Bundler::URI
|
|
|
250
250
|
val
|
|
251
251
|
end
|
|
252
252
|
|
|
253
|
-
# Checks if
|
|
254
|
-
# For
|
|
253
|
+
# Checks if Gem::URI has a path.
|
|
254
|
+
# For Gem::URI::LDAP this will return +false+.
|
|
255
255
|
def hierarchical?
|
|
256
256
|
false
|
|
257
257
|
end
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
#
|
|
4
4
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
|
5
5
|
#
|
|
6
|
-
# See
|
|
6
|
+
# See Gem::URI for general documentation
|
|
7
7
|
#
|
|
8
8
|
|
|
9
9
|
require_relative 'ldap'
|
|
10
10
|
|
|
11
|
-
module
|
|
11
|
+
module Gem::URI
|
|
12
12
|
|
|
13
13
|
# The default port for LDAPS URIs is 636, and the scheme is 'ldaps:' rather
|
|
14
14
|
# than 'ldap:'. Other than that, LDAPS URIs are identical to LDAP URIs;
|
|
15
|
-
# see
|
|
15
|
+
# see Gem::URI::LDAP.
|
|
16
16
|
class LDAPS < LDAP
|
|
17
|
-
# A Default port of 636 for
|
|
17
|
+
# A Default port of 636 for Gem::URI::LDAPS
|
|
18
18
|
DEFAULT_PORT = 636
|
|
19
19
|
end
|
|
20
20
|
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
|
5
5
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
|
6
6
|
#
|
|
7
|
-
# See
|
|
7
|
+
# See Gem::URI for general documentation
|
|
8
8
|
#
|
|
9
9
|
|
|
10
10
|
require_relative 'generic'
|
|
11
11
|
|
|
12
|
-
module
|
|
12
|
+
module Gem::URI
|
|
13
13
|
|
|
14
14
|
#
|
|
15
15
|
# RFC6068, the mailto URL scheme.
|
|
@@ -17,10 +17,10 @@ module Bundler::URI
|
|
|
17
17
|
class MailTo < Generic
|
|
18
18
|
include RFC2396_REGEXP
|
|
19
19
|
|
|
20
|
-
# A Default port of nil for
|
|
20
|
+
# A Default port of nil for Gem::URI::MailTo.
|
|
21
21
|
DEFAULT_PORT = nil
|
|
22
22
|
|
|
23
|
-
# An Array of the available components for
|
|
23
|
+
# An Array of the available components for Gem::URI::MailTo.
|
|
24
24
|
COMPONENT = [ :scheme, :to, :headers ].freeze
|
|
25
25
|
|
|
26
26
|
# :stopdoc:
|
|
@@ -58,7 +58,7 @@ module Bundler::URI
|
|
|
58
58
|
#
|
|
59
59
|
# == Description
|
|
60
60
|
#
|
|
61
|
-
# Creates a new
|
|
61
|
+
# Creates a new Gem::URI::MailTo object from components, with syntax checking.
|
|
62
62
|
#
|
|
63
63
|
# Components can be provided as an Array or Hash. If an Array is used,
|
|
64
64
|
# the components must be supplied as <code>[to, headers]</code>.
|
|
@@ -71,15 +71,15 @@ module Bundler::URI
|
|
|
71
71
|
#
|
|
72
72
|
# Examples:
|
|
73
73
|
#
|
|
74
|
-
# require '
|
|
74
|
+
# require 'rubygems/vendor/uri/lib/uri'
|
|
75
75
|
#
|
|
76
|
-
# m1 =
|
|
76
|
+
# m1 = Gem::URI::MailTo.build(['joe@example.com', 'subject=Ruby'])
|
|
77
77
|
# m1.to_s # => "mailto:joe@example.com?subject=Ruby"
|
|
78
78
|
#
|
|
79
|
-
# m2 =
|
|
79
|
+
# m2 = Gem::URI::MailTo.build(['john@example.com', [['Subject', 'Ruby'], ['Cc', 'jack@example.com']]])
|
|
80
80
|
# m2.to_s # => "mailto:john@example.com?Subject=Ruby&Cc=jack@example.com"
|
|
81
81
|
#
|
|
82
|
-
# m3 =
|
|
82
|
+
# m3 = Gem::URI::MailTo.build({:to => 'listman@example.com', :headers => [['subject', 'subscribe']]})
|
|
83
83
|
# m3.to_s # => "mailto:listman@example.com?subject=subscribe"
|
|
84
84
|
#
|
|
85
85
|
def self.build(args)
|
|
@@ -123,10 +123,10 @@ module Bundler::URI
|
|
|
123
123
|
#
|
|
124
124
|
# == Description
|
|
125
125
|
#
|
|
126
|
-
# Creates a new
|
|
126
|
+
# Creates a new Gem::URI::MailTo object from generic URL components with
|
|
127
127
|
# no syntax checking.
|
|
128
128
|
#
|
|
129
|
-
# This method is usually called from
|
|
129
|
+
# This method is usually called from Gem::URI::parse, which checks
|
|
130
130
|
# the validity of each component.
|
|
131
131
|
#
|
|
132
132
|
def initialize(*arg)
|
|
@@ -174,12 +174,12 @@ module Bundler::URI
|
|
|
174
174
|
# check url safety as path-rootless
|
|
175
175
|
if /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~])*\z/ !~ addr
|
|
176
176
|
raise InvalidComponentError,
|
|
177
|
-
"an address in 'to' is invalid as
|
|
177
|
+
"an address in 'to' is invalid as Gem::URI #{addr.dump}"
|
|
178
178
|
end
|
|
179
179
|
|
|
180
180
|
# check addr-spec
|
|
181
181
|
# don't s/\+/ /g
|
|
182
|
-
addr.gsub!(/%\h\h/,
|
|
182
|
+
addr.gsub!(/%\h\h/, Gem::URI::TBLDECWWWCOMP_)
|
|
183
183
|
if EMAIL_REGEXP !~ addr
|
|
184
184
|
raise InvalidComponentError,
|
|
185
185
|
"an address in 'to' is invalid as uri-escaped addr-spec #{addr.dump}"
|
|
@@ -235,7 +235,7 @@ module Bundler::URI
|
|
|
235
235
|
v
|
|
236
236
|
end
|
|
237
237
|
|
|
238
|
-
# Constructs String from
|
|
238
|
+
# Constructs String from Gem::URI.
|
|
239
239
|
def to_s
|
|
240
240
|
@scheme + ':' +
|
|
241
241
|
if @to
|
|
@@ -259,25 +259,25 @@ module Bundler::URI
|
|
|
259
259
|
#
|
|
260
260
|
# Example:
|
|
261
261
|
#
|
|
262
|
-
# require '
|
|
262
|
+
# require 'rubygems/vendor/uri/lib/uri'
|
|
263
263
|
#
|
|
264
|
-
# uri =
|
|
264
|
+
# uri = Gem::URI.parse("mailto:ruby-list@ruby-lang.org?Subject=subscribe&cc=myaddr")
|
|
265
265
|
# uri.to_mailtext
|
|
266
266
|
# # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n"
|
|
267
267
|
#
|
|
268
268
|
def to_mailtext
|
|
269
|
-
to =
|
|
269
|
+
to = Gem::URI.decode_www_form_component(@to)
|
|
270
270
|
head = ''
|
|
271
271
|
body = ''
|
|
272
272
|
@headers.each do |x|
|
|
273
273
|
case x[0]
|
|
274
274
|
when 'body'
|
|
275
|
-
body =
|
|
275
|
+
body = Gem::URI.decode_www_form_component(x[1])
|
|
276
276
|
when 'to'
|
|
277
|
-
to << ', ' +
|
|
277
|
+
to << ', ' + Gem::URI.decode_www_form_component(x[1])
|
|
278
278
|
else
|
|
279
|
-
head <<
|
|
280
|
-
|
|
279
|
+
head << Gem::URI.decode_www_form_component(x[0]).capitalize + ': ' +
|
|
280
|
+
Gem::URI.decode_www_form_component(x[1]) + "\n"
|
|
281
281
|
end
|
|
282
282
|
end
|
|
283
283
|
|
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
# License::
|
|
7
7
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
|
8
8
|
#
|
|
9
|
-
# See
|
|
9
|
+
# See Gem::URI for general documentation
|
|
10
10
|
#
|
|
11
11
|
|
|
12
|
-
module
|
|
12
|
+
module Gem::URI
|
|
13
13
|
#
|
|
14
|
-
# Includes
|
|
14
|
+
# Includes Gem::URI::REGEXP::PATTERN
|
|
15
15
|
#
|
|
16
16
|
module RFC2396_REGEXP
|
|
17
17
|
#
|
|
18
|
-
# Patterns used to parse
|
|
18
|
+
# Patterns used to parse Gem::URI's
|
|
19
19
|
#
|
|
20
20
|
module PATTERN
|
|
21
21
|
# :stopdoc:
|
|
22
22
|
|
|
23
|
-
# RFC 2396 (
|
|
23
|
+
# RFC 2396 (Gem::URI Generic Syntax)
|
|
24
24
|
# RFC 2732 (IPv6 Literal Addresses in URL's)
|
|
25
25
|
# RFC 2373 (IPv6 Addressing Architecture)
|
|
26
26
|
|
|
@@ -57,7 +57,7 @@ module Bundler::URI
|
|
|
57
57
|
# :startdoc:
|
|
58
58
|
end # REGEXP
|
|
59
59
|
|
|
60
|
-
# Class that parses String's into
|
|
60
|
+
# Class that parses String's into Gem::URI's.
|
|
61
61
|
#
|
|
62
62
|
# It contains a Hash set of patterns and Regexp's that match and validate.
|
|
63
63
|
#
|
|
@@ -67,32 +67,32 @@ module Bundler::URI
|
|
|
67
67
|
#
|
|
68
68
|
# == Synopsis
|
|
69
69
|
#
|
|
70
|
-
#
|
|
70
|
+
# Gem::URI::RFC2396_Parser.new([opts])
|
|
71
71
|
#
|
|
72
72
|
# == Args
|
|
73
73
|
#
|
|
74
74
|
# The constructor accepts a hash as options for parser.
|
|
75
|
-
# Keys of options are pattern names of
|
|
75
|
+
# Keys of options are pattern names of Gem::URI components
|
|
76
76
|
# and values of options are pattern strings.
|
|
77
77
|
# The constructor generates set of regexps for parsing URIs.
|
|
78
78
|
#
|
|
79
79
|
# You can use the following keys:
|
|
80
80
|
#
|
|
81
|
-
# * :ESCAPED (
|
|
82
|
-
# * :UNRESERVED (
|
|
83
|
-
# * :DOMLABEL (
|
|
84
|
-
# * :TOPLABEL (
|
|
85
|
-
# * :HOSTNAME (
|
|
81
|
+
# * :ESCAPED (Gem::URI::PATTERN::ESCAPED in default)
|
|
82
|
+
# * :UNRESERVED (Gem::URI::PATTERN::UNRESERVED in default)
|
|
83
|
+
# * :DOMLABEL (Gem::URI::PATTERN::DOMLABEL in default)
|
|
84
|
+
# * :TOPLABEL (Gem::URI::PATTERN::TOPLABEL in default)
|
|
85
|
+
# * :HOSTNAME (Gem::URI::PATTERN::HOSTNAME in default)
|
|
86
86
|
#
|
|
87
87
|
# == Examples
|
|
88
88
|
#
|
|
89
|
-
# p =
|
|
90
|
-
# u = p.parse("http://example.jp/%uABCD") #=> #<
|
|
91
|
-
#
|
|
89
|
+
# p = Gem::URI::RFC2396_Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
|
|
90
|
+
# u = p.parse("http://example.jp/%uABCD") #=> #<Gem::URI::HTTP http://example.jp/%uABCD>
|
|
91
|
+
# Gem::URI.parse(u.to_s) #=> raises Gem::URI::InvalidURIError
|
|
92
92
|
#
|
|
93
93
|
# s = "http://example.com/ABCD"
|
|
94
|
-
# u1 = p.parse(s) #=> #<
|
|
95
|
-
# u2 =
|
|
94
|
+
# u1 = p.parse(s) #=> #<Gem::URI::HTTP http://example.com/ABCD>
|
|
95
|
+
# u2 = Gem::URI.parse(s) #=> #<Gem::URI::HTTP http://example.com/ABCD>
|
|
96
96
|
# u1 == u2 #=> true
|
|
97
97
|
# u1.eql?(u2) #=> false
|
|
98
98
|
#
|
|
@@ -116,7 +116,7 @@ module Bundler::URI
|
|
|
116
116
|
# See also #initialize_regexp.
|
|
117
117
|
attr_reader :regexp
|
|
118
118
|
|
|
119
|
-
# Returns a split
|
|
119
|
+
# Returns a split Gem::URI against +regexp[:ABS_URI]+.
|
|
120
120
|
def split(uri)
|
|
121
121
|
case uri
|
|
122
122
|
when ''
|
|
@@ -126,7 +126,7 @@ module Bundler::URI
|
|
|
126
126
|
scheme, opaque, userinfo, host, port,
|
|
127
127
|
registry, path, query, fragment = $~[1..-1]
|
|
128
128
|
|
|
129
|
-
#
|
|
129
|
+
# Gem::URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
|
|
130
130
|
|
|
131
131
|
# absoluteURI = scheme ":" ( hier_part | opaque_part )
|
|
132
132
|
# hier_part = ( net_path | abs_path ) [ "?" query ]
|
|
@@ -140,11 +140,11 @@ module Bundler::URI
|
|
|
140
140
|
|
|
141
141
|
if !scheme
|
|
142
142
|
raise InvalidURIError,
|
|
143
|
-
"bad
|
|
143
|
+
"bad Gem::URI (absolute but no scheme): #{uri}"
|
|
144
144
|
end
|
|
145
145
|
if !opaque && (!path && (!host && !registry))
|
|
146
146
|
raise InvalidURIError,
|
|
147
|
-
"bad
|
|
147
|
+
"bad Gem::URI (absolute but no path): #{uri}"
|
|
148
148
|
end
|
|
149
149
|
|
|
150
150
|
when @regexp[:REL_URI]
|
|
@@ -161,7 +161,7 @@ module Bundler::URI
|
|
|
161
161
|
path = abs_path
|
|
162
162
|
end
|
|
163
163
|
|
|
164
|
-
#
|
|
164
|
+
# Gem::URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
|
|
165
165
|
|
|
166
166
|
# relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
|
|
167
167
|
|
|
@@ -173,7 +173,7 @@ module Bundler::URI
|
|
|
173
173
|
# server = [ [ userinfo "@" ] hostport ]
|
|
174
174
|
|
|
175
175
|
else
|
|
176
|
-
raise InvalidURIError, "bad
|
|
176
|
+
raise InvalidURIError, "bad Gem::URI (is not Gem::URI?): #{uri}"
|
|
177
177
|
end
|
|
178
178
|
|
|
179
179
|
path = '' if !path && !opaque # (see RFC2396 Section 5.2)
|
|
@@ -197,16 +197,16 @@ module Bundler::URI
|
|
|
197
197
|
#
|
|
198
198
|
# == Description
|
|
199
199
|
#
|
|
200
|
-
# Parses +uri+ and constructs either matching
|
|
201
|
-
# (File, FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or
|
|
200
|
+
# Parses +uri+ and constructs either matching Gem::URI scheme object
|
|
201
|
+
# (File, FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or Gem::URI::Generic.
|
|
202
202
|
#
|
|
203
203
|
# == Usage
|
|
204
204
|
#
|
|
205
|
-
#
|
|
206
|
-
# #=> #<
|
|
205
|
+
# Gem::URI::RFC2396_PARSER.parse("ldap://ldap.example.com/dc=example?user=john")
|
|
206
|
+
# #=> #<Gem::URI::LDAP ldap://ldap.example.com/dc=example?user=john>
|
|
207
207
|
#
|
|
208
208
|
def parse(uri)
|
|
209
|
-
|
|
209
|
+
Gem::URI.for(*self.split(uri), self)
|
|
210
210
|
end
|
|
211
211
|
|
|
212
212
|
#
|
|
@@ -343,7 +343,7 @@ module Bundler::URI
|
|
|
343
343
|
ret[:TOPLABEL] = opts.delete(:TOPLABEL) || PATTERN::TOPLABEL
|
|
344
344
|
ret[:HOSTNAME] = hostname = opts.delete(:HOSTNAME)
|
|
345
345
|
|
|
346
|
-
# RFC 2396 (
|
|
346
|
+
# RFC 2396 (Gem::URI Generic Syntax)
|
|
347
347
|
# RFC 2732 (IPv6 Literal Addresses in URL's)
|
|
348
348
|
# RFC 2373 (IPv6 Addressing Architecture)
|
|
349
349
|
|
|
@@ -446,7 +446,7 @@ module Bundler::URI
|
|
|
446
446
|
# relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
|
|
447
447
|
ret[:REL_URI] = rel_uri = "(?:#{net_path}|#{abs_path}|#{rel_path})(?:\\?#{query})?"
|
|
448
448
|
|
|
449
|
-
#
|
|
449
|
+
# Gem::URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
|
|
450
450
|
ret[:URI_REF] = "(?:#{abs_uri}|#{rel_uri})?(?:##{fragment})?"
|
|
451
451
|
|
|
452
452
|
ret[:X_ABS_URI] = "
|
|
@@ -495,16 +495,16 @@ module Bundler::URI
|
|
|
495
495
|
def initialize_regexp(pattern)
|
|
496
496
|
ret = {}
|
|
497
497
|
|
|
498
|
-
# for
|
|
498
|
+
# for Gem::URI::split
|
|
499
499
|
ret[:ABS_URI] = Regexp.new('\A\s*+' + pattern[:X_ABS_URI] + '\s*\z', Regexp::EXTENDED)
|
|
500
500
|
ret[:REL_URI] = Regexp.new('\A\s*+' + pattern[:X_REL_URI] + '\s*\z', Regexp::EXTENDED)
|
|
501
501
|
|
|
502
|
-
# for
|
|
502
|
+
# for Gem::URI::extract
|
|
503
503
|
ret[:URI_REF] = Regexp.new(pattern[:URI_REF])
|
|
504
504
|
ret[:ABS_URI_REF] = Regexp.new(pattern[:X_ABS_URI], Regexp::EXTENDED)
|
|
505
505
|
ret[:REL_URI_REF] = Regexp.new(pattern[:X_REL_URI], Regexp::EXTENDED)
|
|
506
506
|
|
|
507
|
-
# for
|
|
507
|
+
# for Gem::URI::escape/unescape
|
|
508
508
|
ret[:ESCAPED] = Regexp.new(pattern[:ESCAPED])
|
|
509
509
|
ret[:UNSAFE] = Regexp.new("[^#{pattern[:UNRESERVED]}#{pattern[:RESERVED]}]")
|
|
510
510
|
|
|
@@ -523,25 +523,25 @@ module Bundler::URI
|
|
|
523
523
|
ret
|
|
524
524
|
end
|
|
525
525
|
|
|
526
|
-
# Returns +uri+ as-is if it is
|
|
526
|
+
# Returns +uri+ as-is if it is Gem::URI, or convert it to Gem::URI if it is
|
|
527
527
|
# a String.
|
|
528
528
|
def convert_to_uri(uri)
|
|
529
|
-
if uri.is_a?(
|
|
529
|
+
if uri.is_a?(Gem::URI::Generic)
|
|
530
530
|
uri
|
|
531
531
|
elsif uri = String.try_convert(uri)
|
|
532
532
|
parse(uri)
|
|
533
533
|
else
|
|
534
534
|
raise ArgumentError,
|
|
535
|
-
"bad argument (expected
|
|
535
|
+
"bad argument (expected Gem::URI object or Gem::URI string)"
|
|
536
536
|
end
|
|
537
537
|
end
|
|
538
538
|
|
|
539
539
|
end # class Parser
|
|
540
540
|
|
|
541
|
-
# Backward compatibility for
|
|
541
|
+
# Backward compatibility for Gem::URI::REGEXP::PATTERN::*
|
|
542
542
|
RFC2396_Parser.new.pattern.each_pair do |sym, str|
|
|
543
543
|
unless RFC2396_REGEXP::PATTERN.const_defined?(sym, false)
|
|
544
544
|
RFC2396_REGEXP::PATTERN.const_set(sym, str)
|
|
545
545
|
end
|
|
546
546
|
end
|
|
547
|
-
end # module
|
|
547
|
+
end # module Gem::URI
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
module
|
|
2
|
+
module Gem::URI
|
|
3
3
|
class RFC3986_Parser # :nodoc:
|
|
4
|
-
#
|
|
4
|
+
# Gem::URI defined in RFC3986
|
|
5
5
|
HOST = %r[
|
|
6
6
|
(?<IP-literal>\[(?:
|
|
7
7
|
(?<IPv6address>
|
|
@@ -34,7 +34,7 @@ module Bundler::URI
|
|
|
34
34
|
|
|
35
35
|
RFC3986_URI = %r[\A
|
|
36
36
|
(?<seg>#{SEG}){0}
|
|
37
|
-
(?<
|
|
37
|
+
(?<Gem::URI>
|
|
38
38
|
(?<scheme>#{SCHEME}):
|
|
39
39
|
(?<hier-part>//
|
|
40
40
|
(?<authority>
|
|
@@ -78,10 +78,10 @@ module Bundler::URI
|
|
|
78
78
|
begin
|
|
79
79
|
uri = uri.to_str
|
|
80
80
|
rescue NoMethodError
|
|
81
|
-
raise InvalidURIError, "bad
|
|
81
|
+
raise InvalidURIError, "bad Gem::URI (is not Gem::URI?): #{uri.inspect}"
|
|
82
82
|
end
|
|
83
83
|
uri.ascii_only? or
|
|
84
|
-
raise InvalidURIError, "
|
|
84
|
+
raise InvalidURIError, "Gem::URI must be ascii only #{uri.dump}"
|
|
85
85
|
if m = RFC3986_URI.match(uri)
|
|
86
86
|
query = m["query"]
|
|
87
87
|
scheme = m["scheme"]
|
|
@@ -127,12 +127,12 @@ module Bundler::URI
|
|
|
127
127
|
m["fragment"]
|
|
128
128
|
]
|
|
129
129
|
else
|
|
130
|
-
raise InvalidURIError, "bad
|
|
130
|
+
raise InvalidURIError, "bad Gem::URI (is not Gem::URI?): #{uri.inspect}"
|
|
131
131
|
end
|
|
132
132
|
end
|
|
133
133
|
|
|
134
134
|
def parse(uri) # :nodoc:
|
|
135
|
-
|
|
135
|
+
Gem::URI.for(*self.split(uri), self)
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
def join(*uris) # :nodoc:
|
|
@@ -142,25 +142,25 @@ module Bundler::URI
|
|
|
142
142
|
|
|
143
143
|
# Compatibility for RFC2396 parser
|
|
144
144
|
def extract(str, schemes = nil, &block) # :nodoc:
|
|
145
|
-
warn "
|
|
145
|
+
warn "Gem::URI::RFC3986_PARSER.extract is obsolete. Use Gem::URI::RFC2396_PARSER.extract explicitly.", uplevel: 1 if $VERBOSE
|
|
146
146
|
RFC2396_PARSER.extract(str, schemes, &block)
|
|
147
147
|
end
|
|
148
148
|
|
|
149
149
|
# Compatibility for RFC2396 parser
|
|
150
150
|
def make_regexp(schemes = nil) # :nodoc:
|
|
151
|
-
warn "
|
|
151
|
+
warn "Gem::URI::RFC3986_PARSER.make_regexp is obsolete. Use Gem::URI::RFC2396_PARSER.make_regexp explicitly.", uplevel: 1 if $VERBOSE
|
|
152
152
|
RFC2396_PARSER.make_regexp(schemes)
|
|
153
153
|
end
|
|
154
154
|
|
|
155
155
|
# Compatibility for RFC2396 parser
|
|
156
156
|
def escape(str, unsafe = nil) # :nodoc:
|
|
157
|
-
warn "
|
|
157
|
+
warn "Gem::URI::RFC3986_PARSER.escape is obsolete. Use Gem::URI::RFC2396_PARSER.escape explicitly.", uplevel: 1 if $VERBOSE
|
|
158
158
|
unsafe ? RFC2396_PARSER.escape(str, unsafe) : RFC2396_PARSER.escape(str)
|
|
159
159
|
end
|
|
160
160
|
|
|
161
161
|
# Compatibility for RFC2396 parser
|
|
162
162
|
def unescape(str, escaped = nil) # :nodoc:
|
|
163
|
-
warn "
|
|
163
|
+
warn "Gem::URI::RFC3986_PARSER.unescape is obsolete. Use Gem::URI::RFC2396_PARSER.unescape explicitly.", uplevel: 1 if $VERBOSE
|
|
164
164
|
escaped ? RFC2396_PARSER.unescape(str, escaped) : RFC2396_PARSER.unescape(str)
|
|
165
165
|
end
|
|
166
166
|
|
|
@@ -192,15 +192,15 @@ module Bundler::URI
|
|
|
192
192
|
end
|
|
193
193
|
|
|
194
194
|
def convert_to_uri(uri)
|
|
195
|
-
if uri.is_a?(
|
|
195
|
+
if uri.is_a?(Gem::URI::Generic)
|
|
196
196
|
uri
|
|
197
197
|
elsif uri = String.try_convert(uri)
|
|
198
198
|
parse(uri)
|
|
199
199
|
else
|
|
200
200
|
raise ArgumentError,
|
|
201
|
-
"bad argument (expected
|
|
201
|
+
"bad argument (expected Gem::URI object or Gem::URI string)"
|
|
202
202
|
end
|
|
203
203
|
end
|
|
204
204
|
|
|
205
205
|
end # class Parser
|
|
206
|
-
end # module
|
|
206
|
+
end # module Gem::URI
|