bundler 2.2.33 → 2.4.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +682 -1
- data/README.md +3 -6
- data/bundler.gemspec +8 -10
- data/exe/bundle +12 -24
- data/exe/bundler +1 -1
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/cli/add.rb +1 -1
- data/lib/bundler/cli/binstubs.rb +5 -1
- data/lib/bundler/cli/check.rb +1 -1
- data/lib/bundler/cli/common.rb +4 -2
- data/lib/bundler/cli/config.rb +10 -1
- data/lib/bundler/cli/console.rb +2 -2
- data/lib/bundler/cli/doctor.rb +7 -1
- data/lib/bundler/cli/gem.rb +73 -41
- data/lib/bundler/cli/info.rb +11 -2
- data/lib/bundler/cli/init.rb +6 -2
- data/lib/bundler/cli/install.rb +15 -33
- data/lib/bundler/cli/lock.rb +8 -5
- data/lib/bundler/cli/open.rb +6 -4
- data/lib/bundler/cli/outdated.rb +13 -6
- data/lib/bundler/cli/platform.rb +2 -2
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli/update.rb +6 -2
- data/lib/bundler/cli/viz.rb +1 -1
- data/lib/bundler/cli.rb +63 -20
- data/lib/bundler/compact_index_client/cache.rb +1 -10
- data/lib/bundler/compact_index_client/updater.rb +53 -39
- data/lib/bundler/compact_index_client.rb +0 -6
- data/lib/bundler/constants.rb +1 -1
- data/lib/bundler/current_ruby.rb +18 -6
- data/lib/bundler/definition.rb +289 -165
- data/lib/bundler/dependency.rb +24 -71
- data/lib/bundler/digest.rb +1 -1
- data/lib/bundler/dsl.rb +13 -45
- data/lib/bundler/endpoint_specification.rb +15 -13
- data/lib/bundler/env.rb +2 -2
- data/lib/bundler/environment_preserver.rb +3 -2
- data/lib/bundler/errors.rb +15 -15
- data/lib/bundler/feature_flag.rb +0 -2
- data/lib/bundler/fetcher/base.rb +6 -8
- data/lib/bundler/fetcher/compact_index.rb +18 -25
- data/lib/bundler/fetcher/dependency.rb +2 -6
- data/lib/bundler/fetcher/downloader.rb +2 -5
- data/lib/bundler/fetcher/index.rb +0 -26
- data/lib/bundler/fetcher.rb +22 -29
- data/lib/bundler/force_platform.rb +18 -0
- data/lib/bundler/friendly_errors.rb +21 -7
- data/lib/bundler/gem_helper.rb +2 -2
- data/lib/bundler/gem_helpers.rb +9 -2
- data/lib/bundler/gem_version_promoter.rb +53 -98
- data/lib/bundler/graph.rb +3 -3
- data/lib/bundler/index.rb +13 -51
- data/lib/bundler/injector.rb +18 -4
- data/lib/bundler/inline.rb +9 -21
- data/lib/bundler/installer/gem_installer.rb +13 -5
- data/lib/bundler/installer/parallel_installer.rb +3 -33
- data/lib/bundler/installer/standalone.rb +42 -11
- data/lib/bundler/installer.rb +21 -45
- data/lib/bundler/lazy_specification.rb +55 -54
- data/lib/bundler/lockfile_generator.rb +3 -3
- data/lib/bundler/lockfile_parser.rb +29 -27
- data/lib/bundler/man/bundle-add.1 +21 -5
- data/lib/bundler/man/bundle-add.1.ronn +16 -4
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +9 -3
- data/lib/bundler/man/bundle-cache.1.ronn +9 -2
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +2 -2
- data/lib/bundler/man/bundle-clean.1.ronn +1 -1
- data/lib/bundler/man/bundle-config.1 +32 -16
- data/lib/bundler/man/bundle-config.1.ronn +29 -20
- data/lib/bundler/man/bundle-console.1 +53 -0
- data/lib/bundler/man/bundle-console.1.ronn +44 -0
- data/lib/bundler/man/bundle-doctor.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +6 -6
- data/lib/bundler/man/bundle-exec.1.ronn +6 -6
- data/lib/bundler/man/bundle-gem.1 +27 -37
- data/lib/bundler/man/bundle-gem.1.ronn +5 -5
- data/lib/bundler/man/bundle-help.1 +13 -0
- data/lib/bundler/man/bundle-help.1.ronn +12 -0
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +5 -1
- data/lib/bundler/man/bundle-init.1.ronn +2 -0
- data/lib/bundler/man/bundle-inject.1 +5 -2
- data/lib/bundler/man/bundle-inject.1.ronn +3 -1
- data/lib/bundler/man/bundle-install.1 +6 -31
- data/lib/bundler/man/bundle-install.1.ronn +8 -31
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +22 -2
- data/lib/bundler/man/bundle-open.1.ronn +9 -1
- data/lib/bundler/man/bundle-outdated.1 +15 -18
- data/lib/bundler/man/bundle-outdated.1.ronn +13 -19
- data/lib/bundler/man/bundle-platform.1 +16 -6
- data/lib/bundler/man/bundle-platform.1.ronn +14 -7
- data/lib/bundler/man/bundle-plugin.1 +81 -0
- data/lib/bundler/man/bundle-plugin.1.ronn +59 -0
- 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 +2 -2
- data/lib/bundler/man/bundle-update.1.ronn +2 -1
- data/lib/bundler/man/bundle-version.1 +35 -0
- data/lib/bundler/man/bundle-version.1.ronn +24 -0
- data/lib/bundler/man/bundle-viz.1 +4 -1
- data/lib/bundler/man/bundle-viz.1.ronn +2 -0
- data/lib/bundler/man/bundle.1 +15 -10
- data/lib/bundler/man/bundle.1.ronn +12 -7
- data/lib/bundler/man/gemfile.5 +94 -83
- data/lib/bundler/man/gemfile.5.ronn +100 -87
- data/lib/bundler/man/index.txt +4 -0
- data/lib/bundler/match_metadata.rb +13 -0
- data/lib/bundler/match_platform.rb +0 -1
- data/lib/bundler/match_remote_metadata.rb +29 -0
- data/lib/bundler/mirror.rb +5 -7
- data/lib/bundler/plugin/api/source.rb +3 -9
- data/lib/bundler/plugin/index.rb +4 -4
- data/lib/bundler/plugin/installer/git.rb +0 -4
- data/lib/bundler/plugin/installer/rubygems.rb +0 -8
- data/lib/bundler/plugin/installer.rb +6 -3
- data/lib/bundler/plugin.rb +3 -1
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +7 -5
- data/lib/bundler/resolver/base.rb +107 -0
- data/lib/bundler/resolver/candidate.rb +94 -0
- data/lib/bundler/resolver/incompatibility.rb +15 -0
- data/lib/bundler/resolver/package.rb +72 -0
- data/lib/bundler/resolver/root.rb +25 -0
- data/lib/bundler/resolver/spec_group.rb +43 -71
- data/lib/bundler/resolver.rb +342 -302
- data/lib/bundler/ruby_dsl.rb +1 -1
- data/lib/bundler/ruby_version.rb +6 -19
- data/lib/bundler/rubygems_ext.rb +149 -28
- data/lib/bundler/rubygems_gem_installer.rb +32 -20
- data/lib/bundler/rubygems_integration.rb +24 -95
- data/lib/bundler/runtime.rb +2 -7
- data/lib/bundler/safe_marshal.rb +31 -0
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings.rb +7 -12
- data/lib/bundler/setup.rb +4 -1
- data/lib/bundler/shared_helpers.rb +15 -22
- data/lib/bundler/source/git/git_proxy.rb +237 -74
- data/lib/bundler/source/git.rb +54 -38
- data/lib/bundler/source/metadata.rb +3 -4
- data/lib/bundler/source/path/installer.rb +1 -22
- data/lib/bundler/source/path.rb +7 -7
- data/lib/bundler/source/rubygems.rb +85 -128
- data/lib/bundler/source.rb +4 -5
- data/lib/bundler/source_list.rb +12 -2
- data/lib/bundler/source_map.rb +15 -2
- data/lib/bundler/spec_set.rb +62 -34
- data/lib/bundler/stub_specification.rb +5 -3
- data/lib/bundler/templates/Executable +3 -5
- data/lib/bundler/templates/Executable.bundler +6 -11
- data/lib/bundler/templates/Executable.standalone +4 -4
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +3 -0
- data/lib/bundler/templates/newgem/README.md.tt +7 -11
- data/lib/bundler/templates/newgem/Rakefile.tt +22 -2
- data/lib/bundler/templates/newgem/bin/console.tt +0 -4
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
- data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +11 -1
- data/lib/bundler/templates/newgem/gitignore.tt +3 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +13 -4
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +11 -4
- data/lib/bundler/templates/newgem/standard.yml.tt +1 -0
- data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
- data/lib/bundler/ui/shell.rb +36 -13
- data/lib/bundler/ui/silent.rb +21 -5
- data/lib/bundler/uri_normalizer.rb +23 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +3 -3
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +3 -1
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1351 -409
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
- data/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +60 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +248 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
- data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +6 -2
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +9 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +19 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +23 -5
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/tsort/lib/tsort.rb +318 -319
- data/lib/bundler/vendor/uri/lib/uri/common.rb +76 -91
- data/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +32 -13
- data/lib/bundler/vendor/uri/lib/uri/http.rb +40 -3
- data/lib/bundler/vendor/uri/lib/uri/https.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +2 -2
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -3
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +16 -23
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +12 -18
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +3 -3
- data/lib/bundler/vendored_persistent.rb +1 -33
- data/lib/bundler/{vendored_tmpdir.rb → vendored_pub_grub.rb} +1 -1
- data/lib/bundler/version.rb +5 -1
- data/lib/bundler/worker.rb +5 -7
- data/lib/bundler.rb +47 -82
- metadata +52 -38
- data/lib/bundler/dep_proxy.rb +0 -55
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -22
- data/lib/bundler/templates/gems.rb +0 -8
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +0 -5
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -6
- data/lib/bundler/vendor/molinillo/LICENSE +0 -9
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -143
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -11
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
- data/lib/bundler/vendored_molinillo.rb +0 -4
- data/lib/bundler/version_ranges.rb +0 -122
@@ -3,7 +3,6 @@
|
|
3
3
|
# = uri/common.rb
|
4
4
|
#
|
5
5
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
6
|
-
# Revision:: $Id$
|
7
6
|
# License::
|
8
7
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
9
8
|
#
|
@@ -14,9 +13,12 @@ require_relative "rfc2396_parser"
|
|
14
13
|
require_relative "rfc3986_parser"
|
15
14
|
|
16
15
|
module Bundler::URI
|
16
|
+
include RFC2396_REGEXP
|
17
|
+
|
17
18
|
REGEXP = RFC2396_REGEXP
|
18
19
|
Parser = RFC2396_Parser
|
19
20
|
RFC3986_PARSER = RFC3986_Parser.new
|
21
|
+
Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)
|
20
22
|
|
21
23
|
# Bundler::URI::Parser.new
|
22
24
|
DEFAULT_PARSER = Parser.new
|
@@ -28,6 +30,7 @@ module Bundler::URI
|
|
28
30
|
DEFAULT_PARSER.regexp.each_pair do |sym, str|
|
29
31
|
const_set(sym, str)
|
30
32
|
end
|
33
|
+
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
|
31
34
|
|
32
35
|
module Util # :nodoc:
|
33
36
|
def make_components_hash(klass, array_hash)
|
@@ -61,88 +64,44 @@ module Bundler::URI
|
|
61
64
|
module_function :make_components_hash
|
62
65
|
end
|
63
66
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
# == Synopsis
|
68
|
-
#
|
69
|
-
# Bundler::URI.escape(str [, unsafe])
|
70
|
-
#
|
71
|
-
# == Args
|
72
|
-
#
|
73
|
-
# +str+::
|
74
|
-
# String to replaces in.
|
75
|
-
# +unsafe+::
|
76
|
-
# Regexp that matches all symbols that must be replaced with codes.
|
77
|
-
# By default uses <tt>UNSAFE</tt>.
|
78
|
-
# When this argument is a String, it represents a character set.
|
79
|
-
#
|
80
|
-
# == Description
|
81
|
-
#
|
82
|
-
# Escapes the string, replacing all unsafe characters with codes.
|
83
|
-
#
|
84
|
-
# This method is obsolete and should not be used. Instead, use
|
85
|
-
# CGI.escape, Bundler::URI.encode_www_form or Bundler::URI.encode_www_form_component
|
86
|
-
# depending on your specific use case.
|
87
|
-
#
|
88
|
-
# == Usage
|
89
|
-
#
|
90
|
-
# require 'bundler/vendor/uri/lib/uri'
|
91
|
-
#
|
92
|
-
# enc_uri = Bundler::URI.escape("http://example.com/?a=\11\15")
|
93
|
-
# # => "http://example.com/?a=%09%0D"
|
94
|
-
#
|
95
|
-
# Bundler::URI.unescape(enc_uri)
|
96
|
-
# # => "http://example.com/?a=\t\r"
|
97
|
-
#
|
98
|
-
# Bundler::URI.escape("@?@!", "!?")
|
99
|
-
# # => "@%3F@%21"
|
100
|
-
#
|
101
|
-
def escape(*arg)
|
102
|
-
warn "Bundler::URI.escape is obsolete", uplevel: 1
|
103
|
-
DEFAULT_PARSER.escape(*arg)
|
104
|
-
end
|
105
|
-
alias encode escape
|
106
|
-
#
|
107
|
-
# == Synopsis
|
108
|
-
#
|
109
|
-
# Bundler::URI.unescape(str)
|
110
|
-
#
|
111
|
-
# == Args
|
112
|
-
#
|
113
|
-
# +str+::
|
114
|
-
# String to unescape.
|
115
|
-
#
|
116
|
-
# == Description
|
117
|
-
#
|
118
|
-
# This method is obsolete and should not be used. Instead, use
|
119
|
-
# CGI.unescape, Bundler::URI.decode_www_form or Bundler::URI.decode_www_form_component
|
120
|
-
# depending on your specific use case.
|
121
|
-
#
|
122
|
-
# == Usage
|
123
|
-
#
|
124
|
-
# require 'bundler/vendor/uri/lib/uri'
|
125
|
-
#
|
126
|
-
# enc_uri = Bundler::URI.escape("http://example.com/?a=\11\15")
|
127
|
-
# # => "http://example.com/?a=%09%0D"
|
128
|
-
#
|
129
|
-
# Bundler::URI.unescape(enc_uri)
|
130
|
-
# # => "http://example.com/?a=\t\r"
|
131
|
-
#
|
132
|
-
def unescape(*arg)
|
133
|
-
warn "Bundler::URI.unescape is obsolete", uplevel: 1
|
134
|
-
DEFAULT_PARSER.unescape(*arg)
|
135
|
-
end
|
136
|
-
alias decode unescape
|
137
|
-
end # module Escape
|
67
|
+
module Schemes
|
68
|
+
end
|
69
|
+
private_constant :Schemes
|
138
70
|
|
139
|
-
|
140
|
-
|
71
|
+
#
|
72
|
+
# Register the given +klass+ to be instantiated when parsing URLs with the given +scheme+.
|
73
|
+
# Note that currently only schemes which after .upcase are valid constant names
|
74
|
+
# can be registered (no -/+/. allowed).
|
75
|
+
#
|
76
|
+
def self.register_scheme(scheme, klass)
|
77
|
+
Schemes.const_set(scheme.to_s.upcase, klass)
|
78
|
+
end
|
141
79
|
|
142
|
-
@@schemes = {}
|
143
80
|
# Returns a Hash of the defined schemes.
|
144
81
|
def self.scheme_list
|
145
|
-
|
82
|
+
Schemes.constants.map { |name|
|
83
|
+
[name.to_s.upcase, Schemes.const_get(name)]
|
84
|
+
}.to_h
|
85
|
+
end
|
86
|
+
|
87
|
+
INITIAL_SCHEMES = scheme_list
|
88
|
+
private_constant :INITIAL_SCHEMES
|
89
|
+
Ractor.make_shareable(INITIAL_SCHEMES) if defined?(Ractor)
|
90
|
+
|
91
|
+
#
|
92
|
+
# Construct a Bundler::URI instance, using the scheme to detect the appropriate class
|
93
|
+
# from +Bundler::URI.scheme_list+.
|
94
|
+
#
|
95
|
+
def self.for(scheme, *arguments, default: Generic)
|
96
|
+
const_name = scheme.to_s.upcase
|
97
|
+
|
98
|
+
uri_class = INITIAL_SCHEMES[const_name]
|
99
|
+
uri_class ||= if /\A[A-Z]\w*\z/.match?(const_name) && Schemes.const_defined?(const_name, false)
|
100
|
+
Schemes.const_get(const_name, false)
|
101
|
+
end
|
102
|
+
uri_class ||= default
|
103
|
+
|
104
|
+
return uri_class.new(scheme, *arguments)
|
146
105
|
end
|
147
106
|
|
148
107
|
#
|
@@ -315,7 +274,7 @@ module Bundler::URI
|
|
315
274
|
#
|
316
275
|
# Returns a Regexp object which matches to Bundler::URI-like strings.
|
317
276
|
# The Regexp object returned by this method includes arbitrary
|
318
|
-
# number of capture group (parentheses). Never rely on
|
277
|
+
# number of capture group (parentheses). Never rely on its number.
|
319
278
|
#
|
320
279
|
# == Usage
|
321
280
|
#
|
@@ -341,6 +300,7 @@ module Bundler::URI
|
|
341
300
|
256.times do |i|
|
342
301
|
TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
|
343
302
|
end
|
303
|
+
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
|
344
304
|
TBLENCWWWCOMP_[' '] = '+'
|
345
305
|
TBLENCWWWCOMP_.freeze
|
346
306
|
TBLDECWWWCOMP_ = {} # :nodoc:
|
@@ -362,10 +322,37 @@ module Bundler::URI
|
|
362
322
|
# If +enc+ is given, convert +str+ to the encoding before percent encoding.
|
363
323
|
#
|
364
324
|
# This is an implementation of
|
365
|
-
#
|
325
|
+
# https://www.w3.org/TR/2013/CR-html5-20130806/forms.html#url-encoded-form-data.
|
366
326
|
#
|
367
327
|
# See Bundler::URI.decode_www_form_component, Bundler::URI.encode_www_form.
|
368
328
|
def self.encode_www_form_component(str, enc=nil)
|
329
|
+
_encode_uri_component(/[^*\-.0-9A-Z_a-z]/, TBLENCWWWCOMP_, str, enc)
|
330
|
+
end
|
331
|
+
|
332
|
+
# Decodes given +str+ of URL-encoded form data.
|
333
|
+
#
|
334
|
+
# This decodes + to SP.
|
335
|
+
#
|
336
|
+
# See Bundler::URI.encode_www_form_component, Bundler::URI.decode_www_form.
|
337
|
+
def self.decode_www_form_component(str, enc=Encoding::UTF_8)
|
338
|
+
_decode_uri_component(/\+|%\h\h/, str, enc)
|
339
|
+
end
|
340
|
+
|
341
|
+
# Encodes +str+ using URL encoding
|
342
|
+
#
|
343
|
+
# This encodes SP to %20 instead of +.
|
344
|
+
def self.encode_uri_component(str, enc=nil)
|
345
|
+
_encode_uri_component(/[^*\-.0-9A-Z_a-z]/, TBLENCURICOMP_, str, enc)
|
346
|
+
end
|
347
|
+
|
348
|
+
# Decodes given +str+ of URL-encoded data.
|
349
|
+
#
|
350
|
+
# This does not decode + to SP.
|
351
|
+
def self.decode_uri_component(str, enc=Encoding::UTF_8)
|
352
|
+
_decode_uri_component(/%\h\h/, str, enc)
|
353
|
+
end
|
354
|
+
|
355
|
+
def self._encode_uri_component(regexp, table, str, enc)
|
369
356
|
str = str.to_s.dup
|
370
357
|
if str.encoding != Encoding::ASCII_8BIT
|
371
358
|
if enc && enc != Encoding::ASCII_8BIT
|
@@ -374,19 +361,16 @@ module Bundler::URI
|
|
374
361
|
end
|
375
362
|
str.force_encoding(Encoding::ASCII_8BIT)
|
376
363
|
end
|
377
|
-
str.gsub!(
|
364
|
+
str.gsub!(regexp, table)
|
378
365
|
str.force_encoding(Encoding::US_ASCII)
|
379
366
|
end
|
367
|
+
private_class_method :_encode_uri_component
|
380
368
|
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
#
|
385
|
-
# See Bundler::URI.encode_www_form_component, Bundler::URI.decode_www_form.
|
386
|
-
def self.decode_www_form_component(str, enc=Encoding::UTF_8)
|
387
|
-
raise ArgumentError, "invalid %-encoding (#{str})" if /%(?!\h\h)/ =~ str
|
388
|
-
str.b.gsub(/\+|%\h\h/, TBLDECWWWCOMP_).force_encoding(enc)
|
369
|
+
def self._decode_uri_component(regexp, str, enc)
|
370
|
+
raise ArgumentError, "invalid %-encoding (#{str})" if /%(?!\h\h)/.match?(str)
|
371
|
+
str.b.gsub(regexp, TBLDECWWWCOMP_).force_encoding(enc)
|
389
372
|
end
|
373
|
+
private_class_method :_decode_uri_component
|
390
374
|
|
391
375
|
# Generates URL-encoded form data from given +enum+.
|
392
376
|
#
|
@@ -403,7 +387,7 @@ module Bundler::URI
|
|
403
387
|
# This method doesn't handle files. When you send a file, use
|
404
388
|
# multipart/form-data.
|
405
389
|
#
|
406
|
-
# This refers
|
390
|
+
# This refers https://url.spec.whatwg.org/#concept-urlencoded-serializer
|
407
391
|
#
|
408
392
|
# Bundler::URI.encode_www_form([["q", "ruby"], ["lang", "en"]])
|
409
393
|
# #=> "q=ruby&lang=en"
|
@@ -716,6 +700,7 @@ module Bundler::URI
|
|
716
700
|
"utf-16"=>"utf-16le",
|
717
701
|
"utf-16le"=>"utf-16le",
|
718
702
|
} # :nodoc:
|
703
|
+
Ractor.make_shareable(WEB_ENCODINGS_) if defined?(Ractor)
|
719
704
|
|
720
705
|
# :nodoc:
|
721
706
|
# return encoding or nil
|
@@ -33,6 +33,9 @@ module Bundler::URI
|
|
33
33
|
# If an Array is used, the components must be passed in the
|
34
34
|
# order <code>[host, path]</code>.
|
35
35
|
#
|
36
|
+
# A path from e.g. the File class should be escaped before
|
37
|
+
# being passed.
|
38
|
+
#
|
36
39
|
# Examples:
|
37
40
|
#
|
38
41
|
# require 'bundler/vendor/uri/lib/uri'
|
@@ -44,6 +47,9 @@ module Bundler::URI
|
|
44
47
|
# :path => '/ruby/src'})
|
45
48
|
# uri2.to_s # => "file://host.example.com/ruby/src"
|
46
49
|
#
|
50
|
+
# uri3 = Bundler::URI::File.build({:path => Bundler::URI::escape('/path/my file.txt')})
|
51
|
+
# uri3.to_s # => "file:///path/my%20file.txt"
|
52
|
+
#
|
47
53
|
def self.build(args)
|
48
54
|
tmp = Util::make_components_hash(self, args)
|
49
55
|
super(tmp)
|
@@ -90,5 +96,5 @@ module Bundler::URI
|
|
90
96
|
end
|
91
97
|
end
|
92
98
|
|
93
|
-
|
99
|
+
register_scheme 'FILE', File
|
94
100
|
end
|
@@ -3,7 +3,6 @@
|
|
3
3
|
#
|
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
|
-
# Revision:: $Id$
|
7
6
|
#
|
8
7
|
# See Bundler::URI for general documentation
|
9
8
|
#
|
@@ -263,5 +262,6 @@ module Bundler::URI
|
|
263
262
|
return str
|
264
263
|
end
|
265
264
|
end
|
266
|
-
|
265
|
+
|
266
|
+
register_scheme 'FTP', FTP
|
267
267
|
end
|
@@ -4,7 +4,6 @@
|
|
4
4
|
#
|
5
5
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
6
6
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
7
|
-
# Revision:: $Id$
|
8
7
|
#
|
9
8
|
# See Bundler::URI for general documentation
|
10
9
|
#
|
@@ -565,16 +564,26 @@ module Bundler::URI
|
|
565
564
|
end
|
566
565
|
end
|
567
566
|
|
568
|
-
# Returns the user component.
|
567
|
+
# Returns the user component (without Bundler::URI decoding).
|
569
568
|
def user
|
570
569
|
@user
|
571
570
|
end
|
572
571
|
|
573
|
-
# Returns the password component.
|
572
|
+
# Returns the password component (without Bundler::URI decoding).
|
574
573
|
def password
|
575
574
|
@password
|
576
575
|
end
|
577
576
|
|
577
|
+
# Returns the user component after Bundler::URI decoding.
|
578
|
+
def decoded_user
|
579
|
+
Bundler::URI.decode_uri_component(@user) if @user
|
580
|
+
end
|
581
|
+
|
582
|
+
# Returns the password component after Bundler::URI decoding.
|
583
|
+
def decoded_password
|
584
|
+
Bundler::URI.decode_uri_component(@password) if @password
|
585
|
+
end
|
586
|
+
|
578
587
|
#
|
579
588
|
# Checks the host +v+ component for RFC2396 compliance
|
580
589
|
# and against the Bundler::URI::Parser Regexp for :HOST.
|
@@ -644,7 +653,7 @@ module Bundler::URI
|
|
644
653
|
#
|
645
654
|
def hostname
|
646
655
|
v = self.host
|
647
|
-
|
656
|
+
v&.start_with?('[') && v.end_with?(']') ? v[1..-2] : v
|
648
657
|
end
|
649
658
|
|
650
659
|
# Sets the host part of the Bundler::URI as the argument with brackets for IPv6 addresses.
|
@@ -660,7 +669,7 @@ module Bundler::URI
|
|
660
669
|
# it is wrapped with brackets.
|
661
670
|
#
|
662
671
|
def hostname=(v)
|
663
|
-
v = "[#{v}]" if
|
672
|
+
v = "[#{v}]" if !(v&.start_with?('[') && v&.end_with?(']')) && v&.index(':')
|
664
673
|
self.host = v
|
665
674
|
end
|
666
675
|
|
@@ -1098,7 +1107,7 @@ module Bundler::URI
|
|
1098
1107
|
# # => "http://my.example.com/main.rbx?page=1"
|
1099
1108
|
#
|
1100
1109
|
def merge(oth)
|
1101
|
-
rel = parser.
|
1110
|
+
rel = parser.__send__(:convert_to_uri, oth)
|
1102
1111
|
|
1103
1112
|
if rel.absolute?
|
1104
1113
|
#raise BadURIError, "both Bundler::URI are absolute" if absolute?
|
@@ -1183,7 +1192,7 @@ module Bundler::URI
|
|
1183
1192
|
|
1184
1193
|
# :stopdoc:
|
1185
1194
|
def route_from0(oth)
|
1186
|
-
oth = parser.
|
1195
|
+
oth = parser.__send__(:convert_to_uri, oth)
|
1187
1196
|
if self.relative?
|
1188
1197
|
raise BadURIError,
|
1189
1198
|
"relative Bundler::URI: #{self}"
|
@@ -1291,7 +1300,7 @@ module Bundler::URI
|
|
1291
1300
|
# #=> #<Bundler::URI::Generic /main.rbx?page=1>
|
1292
1301
|
#
|
1293
1302
|
def route_to(oth)
|
1294
|
-
parser.
|
1303
|
+
parser.__send__(:convert_to_uri, oth).route_from(self)
|
1295
1304
|
end
|
1296
1305
|
|
1297
1306
|
#
|
@@ -1405,7 +1414,7 @@ module Bundler::URI
|
|
1405
1414
|
# Returns an Array of the components defined from the COMPONENT Array.
|
1406
1415
|
def component_ary
|
1407
1416
|
component.collect do |x|
|
1408
|
-
self.
|
1417
|
+
self.__send__(x)
|
1409
1418
|
end
|
1410
1419
|
end
|
1411
1420
|
protected :component_ary
|
@@ -1430,7 +1439,7 @@ module Bundler::URI
|
|
1430
1439
|
def select(*components)
|
1431
1440
|
components.collect do |c|
|
1432
1441
|
if component.include?(c)
|
1433
|
-
self.
|
1442
|
+
self.__send__(c)
|
1434
1443
|
else
|
1435
1444
|
raise ArgumentError,
|
1436
1445
|
"expected of components of #{self.class} (#{self.class.component.join(', ')})"
|
@@ -1515,9 +1524,19 @@ module Bundler::URI
|
|
1515
1524
|
proxy_uri = env["CGI_#{name.upcase}"]
|
1516
1525
|
end
|
1517
1526
|
elsif name == 'http_proxy'
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1527
|
+
if RUBY_ENGINE == 'jruby' && p_addr = ENV_JAVA['http.proxyHost']
|
1528
|
+
p_port = ENV_JAVA['http.proxyPort']
|
1529
|
+
if p_user = ENV_JAVA['http.proxyUser']
|
1530
|
+
p_pass = ENV_JAVA['http.proxyPass']
|
1531
|
+
proxy_uri = "http://#{p_user}:#{p_pass}@#{p_addr}:#{p_port}"
|
1532
|
+
else
|
1533
|
+
proxy_uri = "http://#{p_addr}:#{p_port}"
|
1534
|
+
end
|
1535
|
+
else
|
1536
|
+
unless proxy_uri = env[name]
|
1537
|
+
if proxy_uri = env[name.upcase]
|
1538
|
+
warn 'The environment variable HTTP_PROXY is discouraged. Use http_proxy.', uplevel: 1
|
1539
|
+
end
|
1521
1540
|
end
|
1522
1541
|
end
|
1523
1542
|
else
|
@@ -3,7 +3,6 @@
|
|
3
3
|
#
|
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
|
-
# Revision:: $Id$
|
7
6
|
#
|
8
7
|
# See Bundler::URI for general documentation
|
9
8
|
#
|
@@ -81,8 +80,46 @@ module Bundler::URI
|
|
81
80
|
url = @query ? "#@path?#@query" : @path.dup
|
82
81
|
url.start_with?(?/.freeze) ? url : ?/ + url
|
83
82
|
end
|
84
|
-
end
|
85
83
|
|
86
|
-
|
84
|
+
#
|
85
|
+
# == Description
|
86
|
+
#
|
87
|
+
# Returns the authority for an HTTP uri, as defined in
|
88
|
+
# https://datatracker.ietf.org/doc/html/rfc3986/#section-3.2.
|
89
|
+
#
|
90
|
+
#
|
91
|
+
# Example:
|
92
|
+
#
|
93
|
+
# Bundler::URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').authority #=> "www.example.com"
|
94
|
+
# Bundler::URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').authority #=> "www.example.com:8000"
|
95
|
+
# Bundler::URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').authority #=> "www.example.com"
|
96
|
+
#
|
97
|
+
def authority
|
98
|
+
if port == default_port
|
99
|
+
host
|
100
|
+
else
|
101
|
+
"#{host}:#{port}"
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
#
|
106
|
+
# == Description
|
107
|
+
#
|
108
|
+
# Returns the origin for an HTTP uri, as defined in
|
109
|
+
# https://datatracker.ietf.org/doc/html/rfc6454.
|
110
|
+
#
|
111
|
+
#
|
112
|
+
# Example:
|
113
|
+
#
|
114
|
+
# Bundler::URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').origin #=> "http://www.example.com"
|
115
|
+
# Bundler::URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').origin #=> "http://www.example.com:8000"
|
116
|
+
# Bundler::URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').origin #=> "http://www.example.com"
|
117
|
+
# Bundler::URI::HTTPS.build(host: 'www.example.com', path: '/foo/bar').origin #=> "https://www.example.com"
|
118
|
+
#
|
119
|
+
def origin
|
120
|
+
"#{scheme}://#{authority}"
|
121
|
+
end
|
122
|
+
end
|
87
123
|
|
124
|
+
register_scheme 'HTTP', HTTP
|
88
125
|
end
|
@@ -3,7 +3,6 @@
|
|
3
3
|
#
|
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
|
-
# Revision:: $Id$
|
7
6
|
#
|
8
7
|
# See Bundler::URI for general documentation
|
9
8
|
#
|
@@ -19,5 +18,6 @@ module Bundler::URI
|
|
19
18
|
# A Default port of 443 for Bundler::URI::HTTPS
|
20
19
|
DEFAULT_PORT = 443
|
21
20
|
end
|
22
|
-
|
21
|
+
|
22
|
+
register_scheme 'HTTPS', HTTPS
|
23
23
|
end
|
@@ -7,7 +7,6 @@
|
|
7
7
|
# License::
|
8
8
|
# Bundler::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
|
-
# Revision:: $Id$
|
11
10
|
#
|
12
11
|
# See Bundler::URI for general documentation
|
13
12
|
#
|
@@ -119,6 +118,7 @@ module Bundler::URI
|
|
119
118
|
|
120
119
|
# Private method to cleanup +dn+ from using the +path+ component attribute.
|
121
120
|
def parse_dn
|
121
|
+
raise InvalidURIError, 'bad LDAP URL' unless @path
|
122
122
|
@dn = @path[1..-1]
|
123
123
|
end
|
124
124
|
private :parse_dn
|
@@ -257,5 +257,5 @@ module Bundler::URI
|
|
257
257
|
end
|
258
258
|
end
|
259
259
|
|
260
|
-
|
260
|
+
register_scheme 'LDAP', LDAP
|
261
261
|
end
|
@@ -3,7 +3,6 @@
|
|
3
3
|
#
|
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
|
-
# Revision:: $Id$
|
7
6
|
#
|
8
7
|
# See Bundler::URI for general documentation
|
9
8
|
#
|
@@ -16,7 +15,7 @@ module Bundler::URI
|
|
16
15
|
# RFC6068, the mailto URL scheme.
|
17
16
|
#
|
18
17
|
class MailTo < Generic
|
19
|
-
include
|
18
|
+
include RFC2396_REGEXP
|
20
19
|
|
21
20
|
# A Default port of nil for Bundler::URI::MailTo.
|
22
21
|
DEFAULT_PORT = nil
|
@@ -290,5 +289,5 @@ module Bundler::URI
|
|
290
289
|
alias to_rfc822text to_mailtext
|
291
290
|
end
|
292
291
|
|
293
|
-
|
292
|
+
register_scheme 'MAILTO', MailTo
|
294
293
|
end
|
@@ -3,7 +3,6 @@
|
|
3
3
|
# = uri/common.rb
|
4
4
|
#
|
5
5
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
6
|
-
# Revision:: $Id$
|
7
6
|
# License::
|
8
7
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
9
8
|
#
|
@@ -117,7 +116,7 @@ module Bundler::URI
|
|
117
116
|
# See also Bundler::URI::Parser.initialize_regexp.
|
118
117
|
attr_reader :regexp
|
119
118
|
|
120
|
-
# Returns a split Bundler::URI against regexp[:ABS_URI]
|
119
|
+
# Returns a split Bundler::URI against +regexp[:ABS_URI]+.
|
121
120
|
def split(uri)
|
122
121
|
case uri
|
123
122
|
when ''
|
@@ -208,21 +207,9 @@ module Bundler::URI
|
|
208
207
|
# #=> #<Bundler::URI::LDAP ldap://ldap.example.com/dc=example?user=john>
|
209
208
|
#
|
210
209
|
def parse(uri)
|
211
|
-
|
212
|
-
registry, path, opaque, query, fragment = self.split(uri)
|
213
|
-
|
214
|
-
if scheme && Bundler::URI.scheme_list.include?(scheme.upcase)
|
215
|
-
Bundler::URI.scheme_list[scheme.upcase].new(scheme, userinfo, host, port,
|
216
|
-
registry, path, opaque, query,
|
217
|
-
fragment, self)
|
218
|
-
else
|
219
|
-
Generic.new(scheme, userinfo, host, port,
|
220
|
-
registry, path, opaque, query,
|
221
|
-
fragment, self)
|
222
|
-
end
|
210
|
+
Bundler::URI.for(*self.split(uri), self)
|
223
211
|
end
|
224
212
|
|
225
|
-
|
226
213
|
#
|
227
214
|
# == Args
|
228
215
|
#
|
@@ -270,8 +257,8 @@ module Bundler::URI
|
|
270
257
|
end
|
271
258
|
end
|
272
259
|
|
273
|
-
# Returns Regexp that is default self.regexp[:ABS_URI_REF]
|
274
|
-
# unless +schemes+ is provided. Then it is a Regexp.union with self.pattern[:X_ABS_URI]
|
260
|
+
# Returns Regexp that is default +self.regexp[:ABS_URI_REF]+,
|
261
|
+
# unless +schemes+ is provided. Then it is a Regexp.union with +self.pattern[:X_ABS_URI]+.
|
275
262
|
def make_regexp(schemes = nil)
|
276
263
|
unless schemes
|
277
264
|
@regexp[:ABS_URI_REF]
|
@@ -290,7 +277,7 @@ module Bundler::URI
|
|
290
277
|
# +str+::
|
291
278
|
# String to make safe
|
292
279
|
# +unsafe+::
|
293
|
-
# Regexp to apply. Defaults to self.regexp[:UNSAFE]
|
280
|
+
# Regexp to apply. Defaults to +self.regexp[:UNSAFE]+
|
294
281
|
#
|
295
282
|
# == Description
|
296
283
|
#
|
@@ -322,7 +309,7 @@ module Bundler::URI
|
|
322
309
|
# +str+::
|
323
310
|
# String to remove escapes from
|
324
311
|
# +escaped+::
|
325
|
-
# Regexp to apply. Defaults to self.regexp[:ESCAPED]
|
312
|
+
# Regexp to apply. Defaults to +self.regexp[:ESCAPED]+
|
326
313
|
#
|
327
314
|
# == Description
|
328
315
|
#
|
@@ -335,8 +322,14 @@ module Bundler::URI
|
|
335
322
|
end
|
336
323
|
|
337
324
|
@@to_s = Kernel.instance_method(:to_s)
|
338
|
-
|
339
|
-
|
325
|
+
if @@to_s.respond_to?(:bind_call)
|
326
|
+
def inspect
|
327
|
+
@@to_s.bind_call(self)
|
328
|
+
end
|
329
|
+
else
|
330
|
+
def inspect
|
331
|
+
@@to_s.bind(self).call
|
332
|
+
end
|
340
333
|
end
|
341
334
|
|
342
335
|
private
|
@@ -504,8 +497,8 @@ module Bundler::URI
|
|
504
497
|
ret = {}
|
505
498
|
|
506
499
|
# for Bundler::URI::split
|
507
|
-
ret[:ABS_URI] = Regexp.new('\A\s
|
508
|
-
ret[:REL_URI] = Regexp.new('\A\s
|
500
|
+
ret[:ABS_URI] = Regexp.new('\A\s*+' + pattern[:X_ABS_URI] + '\s*\z', Regexp::EXTENDED)
|
501
|
+
ret[:REL_URI] = Regexp.new('\A\s*+' + pattern[:X_REL_URI] + '\s*\z', Regexp::EXTENDED)
|
509
502
|
|
510
503
|
# for Bundler::URI::extract
|
511
504
|
ret[:URI_REF] = Regexp.new(pattern[:URI_REF])
|