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.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/{lib/bundler/vendor/connection_pool/LICENSE → MIT.txt} +8 -6
  3. data/bundler.gemspec +23 -6
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/checksum.rb +40 -25
  6. data/lib/bundler/ci_detector.rb +1 -1
  7. data/lib/bundler/cli/add.rb +3 -4
  8. data/lib/bundler/cli/cache.rb +4 -0
  9. data/lib/bundler/cli/clean.rb +5 -0
  10. data/lib/bundler/cli/common.rb +37 -1
  11. data/lib/bundler/cli/config.rb +4 -2
  12. data/lib/bundler/cli/gem.rb +0 -17
  13. data/lib/bundler/cli/install.rb +4 -5
  14. data/lib/bundler/cli/lock.rb +1 -2
  15. data/lib/bundler/cli/outdated.rb +8 -3
  16. data/lib/bundler/cli/pristine.rb +2 -1
  17. data/lib/bundler/cli/update.rb +21 -12
  18. data/lib/bundler/cli.rb +14 -11
  19. data/lib/bundler/definition.rb +61 -24
  20. data/lib/bundler/dependency.rb +4 -0
  21. data/lib/bundler/dsl.rb +77 -11
  22. data/lib/bundler/endpoint_specification.rb +51 -14
  23. data/lib/bundler/env.rb +7 -24
  24. data/lib/bundler/errors.rb +34 -5
  25. data/lib/bundler/fetcher/compact_index.rb +14 -5
  26. data/lib/bundler/fetcher/connection_pools.rb +150 -0
  27. data/lib/bundler/fetcher/downloader.rb +31 -16
  28. data/lib/bundler/fetcher.rb +8 -47
  29. data/lib/bundler/injector.rb +3 -3
  30. data/lib/bundler/inline.rb +44 -4
  31. data/lib/bundler/installer/parallel_installer.rb +25 -30
  32. data/lib/bundler/installer.rb +20 -6
  33. data/lib/bundler/lazy_specification.rb +44 -17
  34. data/lib/bundler/lockfile_generator.rb +24 -2
  35. data/lib/bundler/lockfile_parser.rb +43 -5
  36. data/lib/bundler/man/bundle-add.1 +7 -4
  37. data/lib/bundler/man/bundle-add.1.ronn +8 -4
  38. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  39. data/lib/bundler/man/bundle-cache.1 +2 -2
  40. data/lib/bundler/man/bundle-cache.1.ronn +2 -2
  41. data/lib/bundler/man/bundle-check.1 +1 -1
  42. data/lib/bundler/man/bundle-clean.1 +1 -1
  43. data/lib/bundler/man/bundle-config.1 +38 -6
  44. data/lib/bundler/man/bundle-config.1.ronn +143 -10
  45. data/lib/bundler/man/bundle-console.1 +1 -1
  46. data/lib/bundler/man/bundle-doctor.1 +1 -1
  47. data/lib/bundler/man/bundle-env.1 +1 -1
  48. data/lib/bundler/man/bundle-exec.1 +1 -1
  49. data/lib/bundler/man/bundle-fund.1 +1 -1
  50. data/lib/bundler/man/bundle-gem.1 +1 -1
  51. data/lib/bundler/man/bundle-help.1 +1 -1
  52. data/lib/bundler/man/bundle-info.1 +1 -1
  53. data/lib/bundler/man/bundle-init.1 +1 -1
  54. data/lib/bundler/man/bundle-install.1 +2 -2
  55. data/lib/bundler/man/bundle-install.1.ronn +4 -4
  56. data/lib/bundler/man/bundle-issue.1 +1 -1
  57. data/lib/bundler/man/bundle-licenses.1 +1 -1
  58. data/lib/bundler/man/bundle-list.1 +1 -1
  59. data/lib/bundler/man/bundle-lock.1 +3 -3
  60. data/lib/bundler/man/bundle-lock.1.ronn +5 -5
  61. data/lib/bundler/man/bundle-open.1 +1 -1
  62. data/lib/bundler/man/bundle-outdated.1 +1 -1
  63. data/lib/bundler/man/bundle-platform.1 +1 -1
  64. data/lib/bundler/man/bundle-plugin.1 +1 -1
  65. data/lib/bundler/man/bundle-pristine.1 +1 -1
  66. data/lib/bundler/man/bundle-remove.1 +1 -1
  67. data/lib/bundler/man/bundle-show.1 +1 -1
  68. data/lib/bundler/man/bundle-update.1 +3 -3
  69. data/lib/bundler/man/bundle-update.1.ronn +3 -5
  70. data/lib/bundler/man/bundle-version.1 +1 -1
  71. data/lib/bundler/man/bundle.1 +1 -1
  72. data/lib/bundler/man/gemfile.5 +45 -1
  73. data/lib/bundler/man/gemfile.5.ronn +53 -0
  74. data/lib/bundler/match_metadata.rb +20 -0
  75. data/lib/bundler/match_platform.rb +25 -2
  76. data/lib/bundler/match_remote_metadata.rb +21 -6
  77. data/lib/bundler/materialization.rb +2 -1
  78. data/lib/bundler/override.rb +69 -0
  79. data/lib/bundler/plugin/dsl.rb +3 -5
  80. data/lib/bundler/plugin/events.rb +55 -13
  81. data/lib/bundler/plugin/index.rb +87 -11
  82. data/lib/bundler/plugin/installer/path.rb +1 -1
  83. data/lib/bundler/plugin/installer.rb +13 -5
  84. data/lib/bundler/plugin.rb +58 -30
  85. data/lib/bundler/remote_specification.rb +6 -3
  86. data/lib/bundler/resolver/base.rb +2 -1
  87. data/lib/bundler/resolver/incompatibility.rb +1 -1
  88. data/lib/bundler/resolver.rb +73 -23
  89. data/lib/bundler/ruby_version.rb +0 -2
  90. data/lib/bundler/rubygems_ext.rb +71 -1
  91. data/lib/bundler/rubygems_gem_installer.rb +41 -2
  92. data/lib/bundler/rubygems_integration.rb +7 -2
  93. data/lib/bundler/runtime.rb +69 -2
  94. data/lib/bundler/self_manager.rb +9 -15
  95. data/lib/bundler/settings.rb +373 -30
  96. data/lib/bundler/shared_helpers.rb +2 -1
  97. data/lib/bundler/source/git/git_proxy.rb +2 -10
  98. data/lib/bundler/source/git.rb +15 -6
  99. data/lib/bundler/source/path/installer.rb +1 -1
  100. data/lib/bundler/source/rubygems/remote.rb +10 -5
  101. data/lib/bundler/source/rubygems.rb +48 -12
  102. data/lib/bundler/spec_set.rb +16 -4
  103. data/lib/bundler/stub_specification.rb +2 -1
  104. data/lib/bundler/templates/newgem/Gemfile.tt +4 -4
  105. data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -3
  106. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -1
  107. data/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +1 -1
  108. data/lib/bundler/ui/shell.rb +0 -4
  109. data/lib/bundler/ui/silent.rb +0 -4
  110. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +35 -2
  111. data/lib/bundler/vendor/thor/lib/thor/base.rb +2 -1
  112. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +14 -6
  113. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +2 -0
  114. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  115. data/lib/bundler/vendor/thor/lib/thor.rb +34 -1
  116. data/lib/bundler/vendored_pub_grub.rb +5 -2
  117. data/lib/bundler/vendored_securerandom.rb +11 -8
  118. data/lib/bundler/vendored_uri.rb +14 -14
  119. data/lib/bundler/version.rb +1 -1
  120. data/lib/bundler/worker.rb +3 -2
  121. data/lib/bundler.rb +1 -1
  122. data/lib/rubygems/compact_index_client/cache.rb +122 -0
  123. data/lib/rubygems/compact_index_client/cache_file.rb +147 -0
  124. data/lib/rubygems/compact_index_client/http_fetcher.rb +88 -0
  125. data/lib/rubygems/compact_index_client/parser.rb +90 -0
  126. data/lib/rubygems/compact_index_client/updater.rb +113 -0
  127. data/lib/rubygems/compact_index_client.rb +111 -0
  128. data/lib/rubygems/cooldown_settings.rb +57 -0
  129. data/lib/rubygems/credential_store/native/linux.rb +97 -0
  130. data/lib/rubygems/credential_store/native/macos.rb +88 -0
  131. data/lib/rubygems/credential_store/native/windows.rb +130 -0
  132. data/lib/rubygems/credential_store.rb +332 -0
  133. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/assignment.rb +1 -1
  134. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +7 -7
  135. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/failure_writer.rb +1 -1
  136. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/incompatibility.rb +4 -4
  137. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/package.rb +1 -1
  138. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/partial_solution.rb +1 -1
  139. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/rubygems.rb +3 -3
  140. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/solve_failure.rb +1 -1
  141. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/static_package_source.rb +3 -3
  142. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/strategy.rb +2 -2
  143. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/term.rb +1 -1
  144. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/version.rb +1 -1
  145. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/version_constraint.rb +3 -3
  146. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/version_range.rb +1 -1
  147. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/version_solver.rb +2 -2
  148. data/lib/{bundler → rubygems}/vendor/pub_grub/lib/pub_grub/version_union.rb +1 -1
  149. data/lib/rubygems/vendor/pub_grub/lib/pub_grub.rb +57 -0
  150. data/lib/{bundler → rubygems}/vendor/securerandom/lib/securerandom.rb +10 -6
  151. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/common.rb +119 -119
  152. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/file.rb +13 -13
  153. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/ftp.rb +24 -24
  154. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/generic.rb +132 -132
  155. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/http.rb +18 -18
  156. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/https.rb +4 -4
  157. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/ldap.rb +14 -14
  158. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/ldaps.rb +4 -4
  159. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/mailto.rb +21 -21
  160. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/rfc2396_parser.rb +39 -39
  161. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/rfc3986_parser.rb +14 -14
  162. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/version.rb +1 -1
  163. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/ws.rb +12 -12
  164. data/lib/{bundler → rubygems}/vendor/uri/lib/uri/wss.rb +4 -4
  165. data/lib/{bundler → rubygems}/vendor/uri/lib/uri.rb +35 -31
  166. data/lib/rubygems/yaml_serializer.rb +880 -0
  167. metadata +77 -68
  168. data/CHANGELOG.md +0 -5784
  169. data/LICENSE.md +0 -22
  170. data/README.md +0 -58
  171. data/lib/bundler/compact_index_client/cache.rb +0 -107
  172. data/lib/bundler/compact_index_client/cache_file.rb +0 -148
  173. data/lib/bundler/compact_index_client/parser.rb +0 -87
  174. data/lib/bundler/compact_index_client/updater.rb +0 -105
  175. data/lib/bundler/compact_index_client.rb +0 -92
  176. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +0 -227
  177. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +0 -3
  178. data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -56
  179. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +0 -230
  180. data/lib/bundler/vendor/net-http-persistent/README.rdoc +0 -82
  181. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +0 -41
  182. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +0 -65
  183. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +0 -80
  184. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +0 -1153
  185. data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +0 -31
  186. data/lib/bundler/vendored_persistent.rb +0 -11
  187. data/lib/bundler/yaml_serializer.rb +0 -98
  188. /data/lib/{bundler → rubygems}/vendor/pub_grub/LICENSE.txt +0 -0
  189. /data/lib/{bundler → rubygems}/vendor/securerandom/COPYING +0 -0
  190. /data/lib/{bundler → rubygems}/vendor/uri/COPYING +0 -0
@@ -6,13 +6,13 @@
6
6
  # License::
7
7
  # You can redistribute it and/or modify it under the same term as Ruby.
8
8
  #
9
- # See Bundler::URI for general documentation
9
+ # See Gem::URI for general documentation
10
10
  #
11
11
 
12
12
  require_relative "rfc2396_parser"
13
13
  require_relative "rfc3986_parser"
14
14
 
15
- module Bundler::URI
15
+ module Gem::URI
16
16
  # The default parser instance for RFC 2396.
17
17
  RFC2396_PARSER = RFC2396_Parser.new
18
18
  Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
@@ -27,17 +27,17 @@ module Bundler::URI
27
27
 
28
28
  # Set the default parser instance.
29
29
  def self.parser=(parser = RFC3986_PARSER)
30
- remove_const(:Parser) if defined?(::Bundler::URI::Parser)
30
+ remove_const(:Parser) if defined?(::Gem::URI::Parser)
31
31
  const_set("Parser", parser.class)
32
32
 
33
- remove_const(:PARSER) if defined?(::Bundler::URI::PARSER)
33
+ remove_const(:PARSER) if defined?(::Gem::URI::PARSER)
34
34
  const_set("PARSER", parser)
35
35
 
36
- remove_const(:REGEXP) if defined?(::Bundler::URI::REGEXP)
37
- remove_const(:PATTERN) if defined?(::Bundler::URI::PATTERN)
36
+ remove_const(:REGEXP) if defined?(::Gem::URI::REGEXP)
37
+ remove_const(:PATTERN) if defined?(::Gem::URI::PATTERN)
38
38
  if Parser == RFC2396_Parser
39
- const_set("REGEXP", Bundler::URI::RFC2396_REGEXP)
40
- const_set("PATTERN", Bundler::URI::RFC2396_REGEXP::PATTERN)
39
+ const_set("REGEXP", Gem::URI::RFC2396_REGEXP)
40
+ const_set("PATTERN", Gem::URI::RFC2396_REGEXP::PATTERN)
41
41
  end
42
42
 
43
43
  Parser.new.regexp.each_pair do |sym, str|
@@ -49,13 +49,13 @@ module Bundler::URI
49
49
 
50
50
  def self.const_missing(const) # :nodoc:
51
51
  if const == :REGEXP
52
- warn "Bundler::URI::REGEXP is obsolete. Use Bundler::URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
53
- Bundler::URI::RFC2396_REGEXP
52
+ warn "Gem::URI::REGEXP is obsolete. Use Gem::URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
53
+ Gem::URI::RFC2396_REGEXP
54
54
  elsif value = RFC2396_PARSER.regexp[const]
55
- warn "Bundler::URI::#{const} is obsolete. Use Bundler::URI::RFC2396_PARSER.regexp[#{const.inspect}] explicitly.", uplevel: 1 if $VERBOSE
55
+ warn "Gem::URI::#{const} is obsolete. Use Gem::URI::RFC2396_PARSER.regexp[#{const.inspect}] explicitly.", uplevel: 1 if $VERBOSE
56
56
  value
57
57
  elsif value = RFC2396_Parser.const_get(const)
58
- warn "Bundler::URI::#{const} is obsolete. Use Bundler::URI::RFC2396_Parser::#{const} explicitly.", uplevel: 1 if $VERBOSE
58
+ warn "Gem::URI::#{const} is obsolete. Use Gem::URI::RFC2396_Parser::#{const} explicitly.", uplevel: 1 if $VERBOSE
59
59
  value
60
60
  else
61
61
  super
@@ -133,10 +133,10 @@ module Bundler::URI
133
133
  private_constant :Schemes
134
134
 
135
135
  # Registers the given +klass+ as the class to be instantiated
136
- # when parsing a \Bundler::URI with the given +scheme+:
136
+ # when parsing a \Gem::URI with the given +scheme+:
137
137
  #
138
- # Bundler::URI.register_scheme('MS_SEARCH', Bundler::URI::Generic) # => Bundler::URI::Generic
139
- # Bundler::URI.scheme_list['MS_SEARCH'] # => Bundler::URI::Generic
138
+ # Gem::URI.register_scheme('MS_SEARCH', Gem::URI::Generic) # => Gem::URI::Generic
139
+ # Gem::URI.scheme_list['MS_SEARCH'] # => Gem::URI::Generic
140
140
  #
141
141
  # Note that after calling String#upcase on +scheme+, it must be a valid
142
142
  # constant name.
@@ -146,18 +146,18 @@ module Bundler::URI
146
146
 
147
147
  # Returns a hash of the defined schemes:
148
148
  #
149
- # Bundler::URI.scheme_list
149
+ # Gem::URI.scheme_list
150
150
  # # =>
151
- # {"MAILTO"=>Bundler::URI::MailTo,
152
- # "LDAPS"=>Bundler::URI::LDAPS,
153
- # "WS"=>Bundler::URI::WS,
154
- # "HTTP"=>Bundler::URI::HTTP,
155
- # "HTTPS"=>Bundler::URI::HTTPS,
156
- # "LDAP"=>Bundler::URI::LDAP,
157
- # "FILE"=>Bundler::URI::File,
158
- # "FTP"=>Bundler::URI::FTP}
159
- #
160
- # Related: Bundler::URI.register_scheme.
151
+ # {"MAILTO"=>Gem::URI::MailTo,
152
+ # "LDAPS"=>Gem::URI::LDAPS,
153
+ # "WS"=>Gem::URI::WS,
154
+ # "HTTP"=>Gem::URI::HTTP,
155
+ # "HTTPS"=>Gem::URI::HTTPS,
156
+ # "LDAP"=>Gem::URI::LDAP,
157
+ # "FILE"=>Gem::URI::File,
158
+ # "FTP"=>Gem::URI::FTP}
159
+ #
160
+ # Related: Gem::URI.register_scheme.
161
161
  def self.scheme_list
162
162
  Schemes.list
163
163
  end
@@ -171,18 +171,18 @@ module Bundler::URI
171
171
  # Returns a new object constructed from the given +scheme+, +arguments+,
172
172
  # and +default+:
173
173
  #
174
- # - The new object is an instance of <tt>Bundler::URI.scheme_list[scheme.upcase]</tt>.
174
+ # - The new object is an instance of <tt>Gem::URI.scheme_list[scheme.upcase]</tt>.
175
175
  # - The object is initialized by calling the class initializer
176
176
  # using +scheme+ and +arguments+.
177
- # See Bundler::URI::Generic.new.
177
+ # See Gem::URI::Generic.new.
178
178
  #
179
179
  # Examples:
180
180
  #
181
181
  # values = ['john.doe', 'www.example.com', '123', nil, '/forum/questions/', nil, 'tag=networking&order=newest', 'top']
182
- # Bundler::URI.for('https', *values)
183
- # # => #<Bundler::URI::HTTPS https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
184
- # Bundler::URI.for('foo', *values, default: Bundler::URI::HTTP)
185
- # # => #<Bundler::URI::HTTP foo://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
182
+ # Gem::URI.for('https', *values)
183
+ # # => #<Gem::URI::HTTPS https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
184
+ # Gem::URI.for('foo', *values, default: Gem::URI::HTTP)
185
+ # # => #<Gem::URI::HTTP foo://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
186
186
  #
187
187
  def self.for(scheme, *arguments, default: Generic)
188
188
  const_name = Schemes.escape(scheme)
@@ -195,28 +195,28 @@ module Bundler::URI
195
195
  end
196
196
 
197
197
  #
198
- # Base class for all Bundler::URI exceptions.
198
+ # Base class for all Gem::URI exceptions.
199
199
  #
200
200
  class Error < StandardError; end
201
201
  #
202
- # Not a Bundler::URI.
202
+ # Not a Gem::URI.
203
203
  #
204
204
  class InvalidURIError < Error; end
205
205
  #
206
- # Not a Bundler::URI component.
206
+ # Not a Gem::URI component.
207
207
  #
208
208
  class InvalidComponentError < Error; end
209
209
  #
210
- # Bundler::URI is valid, bad usage is not.
210
+ # Gem::URI is valid, bad usage is not.
211
211
  #
212
212
  class BadURIError < Error; end
213
213
 
214
- # Returns a 9-element array representing the parts of the \Bundler::URI
214
+ # Returns a 9-element array representing the parts of the \Gem::URI
215
215
  # formed from the string +uri+;
216
216
  # each array element is a string or +nil+:
217
217
  #
218
218
  # names = %w[scheme userinfo host port registry path opaque query fragment]
219
- # values = Bundler::URI.split('https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
219
+ # values = Gem::URI.split('https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
220
220
  # names.zip(values)
221
221
  # # =>
222
222
  # [["scheme", "https"],
@@ -233,42 +233,42 @@ module Bundler::URI
233
233
  PARSER.split(uri)
234
234
  end
235
235
 
236
- # Returns a new \Bundler::URI object constructed from the given string +uri+:
236
+ # Returns a new \Gem::URI object constructed from the given string +uri+:
237
237
  #
238
- # Bundler::URI.parse('https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
239
- # # => #<Bundler::URI::HTTPS https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
240
- # Bundler::URI.parse('http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
241
- # # => #<Bundler::URI::HTTP http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
238
+ # Gem::URI.parse('https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
239
+ # # => #<Gem::URI::HTTPS https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
240
+ # Gem::URI.parse('http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top')
241
+ # # => #<Gem::URI::HTTP http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top>
242
242
  #
243
- # It's recommended to first Bundler::URI::RFC2396_PARSER.escape string +uri+
244
- # if it may contain invalid Bundler::URI characters.
243
+ # It's recommended to first Gem::URI::RFC2396_PARSER.escape string +uri+
244
+ # if it may contain invalid Gem::URI characters.
245
245
  #
246
246
  def self.parse(uri)
247
247
  PARSER.parse(uri)
248
248
  end
249
249
 
250
- # Merges the given Bundler::URI strings +str+
250
+ # Merges the given Gem::URI strings +str+
251
251
  # per {RFC 2396}[https://www.rfc-editor.org/rfc/rfc2396.html].
252
252
  #
253
253
  # Each string in +str+ is converted to an
254
- # {RFC3986 Bundler::URI}[https://www.rfc-editor.org/rfc/rfc3986.html] before being merged.
254
+ # {RFC3986 Gem::URI}[https://www.rfc-editor.org/rfc/rfc3986.html] before being merged.
255
255
  #
256
256
  # Examples:
257
257
  #
258
- # Bundler::URI.join("http://example.com/","main.rbx")
259
- # # => #<Bundler::URI::HTTP http://example.com/main.rbx>
258
+ # Gem::URI.join("http://example.com/","main.rbx")
259
+ # # => #<Gem::URI::HTTP http://example.com/main.rbx>
260
260
  #
261
- # Bundler::URI.join('http://example.com', 'foo')
262
- # # => #<Bundler::URI::HTTP http://example.com/foo>
261
+ # Gem::URI.join('http://example.com', 'foo')
262
+ # # => #<Gem::URI::HTTP http://example.com/foo>
263
263
  #
264
- # Bundler::URI.join('http://example.com', '/foo', '/bar')
265
- # # => #<Bundler::URI::HTTP http://example.com/bar>
264
+ # Gem::URI.join('http://example.com', '/foo', '/bar')
265
+ # # => #<Gem::URI::HTTP http://example.com/bar>
266
266
  #
267
- # Bundler::URI.join('http://example.com', '/foo', 'bar')
268
- # # => #<Bundler::URI::HTTP http://example.com/bar>
267
+ # Gem::URI.join('http://example.com', '/foo', 'bar')
268
+ # # => #<Gem::URI::HTTP http://example.com/bar>
269
269
  #
270
- # Bundler::URI.join('http://example.com', '/foo/', 'bar')
271
- # # => #<Bundler::URI::HTTP http://example.com/foo/bar>
270
+ # Gem::URI.join('http://example.com', '/foo/', 'bar')
271
+ # # => #<Gem::URI::HTTP http://example.com/foo/bar>
272
272
  #
273
273
  def self.join(*str)
274
274
  DEFAULT_PARSER.join(*str)
@@ -277,14 +277,14 @@ module Bundler::URI
277
277
  #
278
278
  # == Synopsis
279
279
  #
280
- # Bundler::URI::extract(str[, schemes][,&blk])
280
+ # Gem::URI::extract(str[, schemes][,&blk])
281
281
  #
282
282
  # == Args
283
283
  #
284
284
  # +str+::
285
285
  # String to extract URIs from.
286
286
  # +schemes+::
287
- # Limit Bundler::URI matching to specific schemes.
287
+ # Limit Gem::URI matching to specific schemes.
288
288
  #
289
289
  # == Description
290
290
  #
@@ -293,20 +293,20 @@ module Bundler::URI
293
293
  #
294
294
  # == Usage
295
295
  #
296
- # require "bundler/vendor/uri/lib/uri"
296
+ # require "rubygems/vendor/uri/lib/uri"
297
297
  #
298
- # Bundler::URI.extract("text here http://foo.example.org/bla and here mailto:test@example.com and here also.")
298
+ # Gem::URI.extract("text here http://foo.example.org/bla and here mailto:test@example.com and here also.")
299
299
  # # => ["http://foo.example.com/bla", "mailto:test@example.com"]
300
300
  #
301
301
  def self.extract(str, schemes = nil, &block) # :nodoc:
302
- warn "Bundler::URI.extract is obsolete", uplevel: 1 if $VERBOSE
302
+ warn "Gem::URI.extract is obsolete", uplevel: 1 if $VERBOSE
303
303
  PARSER.extract(str, schemes, &block)
304
304
  end
305
305
 
306
306
  #
307
307
  # == Synopsis
308
308
  #
309
- # Bundler::URI::regexp([match_schemes])
309
+ # Gem::URI::regexp([match_schemes])
310
310
  #
311
311
  # == Args
312
312
  #
@@ -316,27 +316,27 @@ module Bundler::URI
316
316
  #
317
317
  # == Description
318
318
  #
319
- # Returns a Regexp object which matches to Bundler::URI-like strings.
319
+ # Returns a Regexp object which matches to Gem::URI-like strings.
320
320
  # The Regexp object returned by this method includes arbitrary
321
321
  # number of capture group (parentheses). Never rely on its number.
322
322
  #
323
323
  # == Usage
324
324
  #
325
- # require 'bundler/vendor/uri/lib/uri'
325
+ # require 'rubygems/vendor/uri/lib/uri'
326
326
  #
327
- # # extract first Bundler::URI from html_string
328
- # html_string.slice(Bundler::URI.regexp)
327
+ # # extract first Gem::URI from html_string
328
+ # html_string.slice(Gem::URI.regexp)
329
329
  #
330
330
  # # remove ftp URIs
331
- # html_string.sub(Bundler::URI.regexp(['ftp']), '')
331
+ # html_string.sub(Gem::URI.regexp(['ftp']), '')
332
332
  #
333
333
  # # You should not rely on the number of parentheses
334
- # html_string.scan(Bundler::URI.regexp) do |*matches|
334
+ # html_string.scan(Gem::URI.regexp) do |*matches|
335
335
  # p $&
336
336
  # end
337
337
  #
338
338
  def self.regexp(schemes = nil)# :nodoc:
339
- warn "Bundler::URI.regexp is obsolete", uplevel: 1 if $VERBOSE
339
+ warn "Gem::URI.regexp is obsolete", uplevel: 1 if $VERBOSE
340
340
  PARSER.make_regexp(schemes)
341
341
  end
342
342
 
@@ -370,7 +370,7 @@ module Bundler::URI
370
370
  #
371
371
  # Example:
372
372
  #
373
- # Bundler::URI.encode_www_form_component('*.-_azAZ09')
373
+ # Gem::URI.encode_www_form_component('*.-_azAZ09')
374
374
  # # => "*.-_azAZ09"
375
375
  #
376
376
  # - Converts:
@@ -381,7 +381,7 @@ module Bundler::URI
381
381
  #
382
382
  # Example:
383
383
  #
384
- # Bundler::URI.encode_www_form_component('Here are some punctuation characters: ,;?:')
384
+ # Gem::URI.encode_www_form_component('Here are some punctuation characters: ,;?:')
385
385
  # # => "Here+are+some+punctuation+characters%3A+%2C%3B%3F%3A"
386
386
  #
387
387
  # Encoding:
@@ -393,7 +393,7 @@ module Bundler::URI
393
393
  #
394
394
  # In either case, the returned string has forced encoding Encoding::US_ASCII.
395
395
  #
396
- # Related: Bundler::URI.encode_uri_component (encodes <tt>' '</tt> as <tt>'%20'</tt>).
396
+ # Related: Gem::URI.encode_uri_component (encodes <tt>' '</tt> as <tt>'%20'</tt>).
397
397
  def self.encode_www_form_component(str, enc=nil)
398
398
  _encode_uri_component(/[^*\-.0-9A-Z_a-z]/, TBLENCWWWCOMP_, str, enc)
399
399
  end
@@ -413,7 +413,7 @@ module Bundler::URI
413
413
  #
414
414
  # Example:
415
415
  #
416
- # Bundler::URI.decode_www_form_component('*.-_azAZ09')
416
+ # Gem::URI.decode_www_form_component('*.-_azAZ09')
417
417
  # # => "*.-_azAZ09"
418
418
  #
419
419
  # - Converts:
@@ -423,27 +423,27 @@ module Bundler::URI
423
423
  #
424
424
  # Example:
425
425
  #
426
- # Bundler::URI.decode_www_form_component('Here+are+some+punctuation+characters%3A+%2C%3B%3F%3A')
426
+ # Gem::URI.decode_www_form_component('Here+are+some+punctuation+characters%3A+%2C%3B%3F%3A')
427
427
  # # => "Here are some punctuation characters: ,;?:"
428
428
  #
429
- # Related: Bundler::URI.decode_uri_component (preserves <tt>'+'</tt>).
429
+ # Related: Gem::URI.decode_uri_component (preserves <tt>'+'</tt>).
430
430
  def self.decode_www_form_component(str, enc=Encoding::UTF_8)
431
431
  _decode_uri_component(/\+|%\h\h/, str, enc)
432
432
  end
433
433
 
434
- # Like Bundler::URI.encode_www_form_component, except that <tt>' '</tt> (space)
434
+ # Like Gem::URI.encode_www_form_component, except that <tt>' '</tt> (space)
435
435
  # is encoded as <tt>'%20'</tt> (instead of <tt>'+'</tt>).
436
436
  def self.encode_uri_component(str, enc=nil)
437
437
  _encode_uri_component(/[^*\-.0-9A-Z_a-z]/, TBLENCURICOMP_, str, enc)
438
438
  end
439
439
 
440
- # Like Bundler::URI.decode_www_form_component, except that <tt>'+'</tt> is preserved.
440
+ # Like Gem::URI.decode_www_form_component, except that <tt>'+'</tt> is preserved.
441
441
  def self.decode_uri_component(str, enc=Encoding::UTF_8)
442
442
  _decode_uri_component(/%\h\h/, str, enc)
443
443
  end
444
444
 
445
445
  # Returns a string derived from the given string +str+ with
446
- # Bundler::URI-encoded characters matching +regexp+ according to +table+.
446
+ # Gem::URI-encoded characters matching +regexp+ according to +table+.
447
447
  def self._encode_uri_component(regexp, table, str, enc)
448
448
  str = str.to_s.dup
449
449
  if str.encoding != Encoding::ASCII_8BIT
@@ -480,15 +480,15 @@ module Bundler::URI
480
480
  #
481
481
  # Simple examples:
482
482
  #
483
- # Bundler::URI.encode_www_form([['foo', 0], ['bar', 1], ['baz', 2]])
483
+ # Gem::URI.encode_www_form([['foo', 0], ['bar', 1], ['baz', 2]])
484
484
  # # => "foo=0&bar=1&baz=2"
485
- # Bundler::URI.encode_www_form({foo: 0, bar: 1, baz: 2})
485
+ # Gem::URI.encode_www_form({foo: 0, bar: 1, baz: 2})
486
486
  # # => "foo=0&bar=1&baz=2"
487
487
  #
488
- # The returned string is formed using method Bundler::URI.encode_www_form_component,
488
+ # The returned string is formed using method Gem::URI.encode_www_form_component,
489
489
  # which converts certain characters:
490
490
  #
491
- # Bundler::URI.encode_www_form('f#o': '/', 'b-r': '$', 'b z': '@')
491
+ # Gem::URI.encode_www_form('f#o': '/', 'b-r': '$', 'b z': '@')
492
492
  # # => "f%23o=%2F&b-r=%24&b+z=%40"
493
493
  #
494
494
  # When +enum+ is Array-like, each element +ele+ is converted to a field:
@@ -497,39 +497,39 @@ module Bundler::URI
497
497
  # the field is formed from its first two elements
498
498
  # (and any additional elements are ignored):
499
499
  #
500
- # name = Bundler::URI.encode_www_form_component(ele[0], enc)
501
- # value = Bundler::URI.encode_www_form_component(ele[1], enc)
500
+ # name = Gem::URI.encode_www_form_component(ele[0], enc)
501
+ # value = Gem::URI.encode_www_form_component(ele[1], enc)
502
502
  # "#{name}=#{value}"
503
503
  #
504
504
  # Examples:
505
505
  #
506
- # Bundler::URI.encode_www_form([%w[foo bar], %w[baz bat bah]])
506
+ # Gem::URI.encode_www_form([%w[foo bar], %w[baz bat bah]])
507
507
  # # => "foo=bar&baz=bat"
508
- # Bundler::URI.encode_www_form([['foo', 0], ['bar', :baz, 'bat']])
508
+ # Gem::URI.encode_www_form([['foo', 0], ['bar', :baz, 'bat']])
509
509
  # # => "foo=0&bar=baz"
510
510
  #
511
511
  # - If +ele+ is an array of one element,
512
512
  # the field is formed from <tt>ele[0]</tt>:
513
513
  #
514
- # Bundler::URI.encode_www_form_component(ele[0])
514
+ # Gem::URI.encode_www_form_component(ele[0])
515
515
  #
516
516
  # Example:
517
517
  #
518
- # Bundler::URI.encode_www_form([['foo'], [:bar], [0]])
518
+ # Gem::URI.encode_www_form([['foo'], [:bar], [0]])
519
519
  # # => "foo&bar&0"
520
520
  #
521
521
  # - Otherwise the field is formed from +ele+:
522
522
  #
523
- # Bundler::URI.encode_www_form_component(ele)
523
+ # Gem::URI.encode_www_form_component(ele)
524
524
  #
525
525
  # Example:
526
526
  #
527
- # Bundler::URI.encode_www_form(['foo', :bar, 0])
527
+ # Gem::URI.encode_www_form(['foo', :bar, 0])
528
528
  # # => "foo&bar&0"
529
529
  #
530
530
  # The elements of an Array-like +enum+ may be mixture:
531
531
  #
532
- # Bundler::URI.encode_www_form([['foo', 0], ['bar', 1, 2], ['baz'], :bat])
532
+ # Gem::URI.encode_www_form([['foo', 0], ['bar', 1, 2], ['baz'], :bat])
533
533
  # # => "foo=0&bar=1&baz&bat"
534
534
  #
535
535
  # When +enum+ is Hash-like,
@@ -539,29 +539,29 @@ module Bundler::URI
539
539
  # {Array-convertible}[https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html#label-Array-Convertible+Objects],
540
540
  # each element +ele+ in +value+ is paired with +key+ to form a field:
541
541
  #
542
- # name = Bundler::URI.encode_www_form_component(key, enc)
543
- # value = Bundler::URI.encode_www_form_component(ele, enc)
542
+ # name = Gem::URI.encode_www_form_component(key, enc)
543
+ # value = Gem::URI.encode_www_form_component(ele, enc)
544
544
  # "#{name}=#{value}"
545
545
  #
546
546
  # Example:
547
547
  #
548
- # Bundler::URI.encode_www_form({foo: [:bar, 1], baz: [:bat, :bam, 2]})
548
+ # Gem::URI.encode_www_form({foo: [:bar, 1], baz: [:bat, :bam, 2]})
549
549
  # # => "foo=bar&foo=1&baz=bat&baz=bam&baz=2"
550
550
  #
551
551
  # - Otherwise, +key+ and +value+ are paired to form a field:
552
552
  #
553
- # name = Bundler::URI.encode_www_form_component(key, enc)
554
- # value = Bundler::URI.encode_www_form_component(value, enc)
553
+ # name = Gem::URI.encode_www_form_component(key, enc)
554
+ # value = Gem::URI.encode_www_form_component(value, enc)
555
555
  # "#{name}=#{value}"
556
556
  #
557
557
  # Example:
558
558
  #
559
- # Bundler::URI.encode_www_form({foo: 0, bar: 1, baz: 2})
559
+ # Gem::URI.encode_www_form({foo: 0, bar: 1, baz: 2})
560
560
  # # => "foo=0&bar=1&baz=2"
561
561
  #
562
562
  # The elements of a Hash-like +enum+ may be mixture:
563
563
  #
564
- # Bundler::URI.encode_www_form({foo: [0, 1], bar: 2})
564
+ # Gem::URI.encode_www_form({foo: [0, 1], bar: 2})
565
565
  # # => "foo=0&foo=1&bar=2"
566
566
  #
567
567
  def self.encode_www_form(enum, enc=nil)
@@ -598,23 +598,23 @@ module Bundler::URI
598
598
  #
599
599
  # A simple example:
600
600
  #
601
- # Bundler::URI.decode_www_form('foo=0&bar=1&baz')
601
+ # Gem::URI.decode_www_form('foo=0&bar=1&baz')
602
602
  # # => [["foo", "0"], ["bar", "1"], ["baz", ""]]
603
603
  #
604
604
  # The returned strings have certain conversions,
605
- # similar to those performed in Bundler::URI.decode_www_form_component:
605
+ # similar to those performed in Gem::URI.decode_www_form_component:
606
606
  #
607
- # Bundler::URI.decode_www_form('f%23o=%2F&b-r=%24&b+z=%40')
607
+ # Gem::URI.decode_www_form('f%23o=%2F&b-r=%24&b+z=%40')
608
608
  # # => [["f#o", "/"], ["b-r", "$"], ["b z", "@"]]
609
609
  #
610
610
  # The given string may contain consecutive separators:
611
611
  #
612
- # Bundler::URI.decode_www_form('foo=0&&bar=1&&baz=2')
612
+ # Gem::URI.decode_www_form('foo=0&&bar=1&&baz=2')
613
613
  # # => [["foo", "0"], ["", ""], ["bar", "1"], ["", ""], ["baz", "2"]]
614
614
  #
615
615
  # A different separator may be specified:
616
616
  #
617
- # Bundler::URI.decode_www_form('foo=0--bar=1--baz', separator: '--')
617
+ # Gem::URI.decode_www_form('foo=0--bar=1--baz', separator: '--')
618
618
  # # => [["foo", "0"], ["bar", "1"], ["baz", ""]]
619
619
  #
620
620
  def self.decode_www_form(str, enc=Encoding::UTF_8, separator: '&', use__charset_: false, isindex: false)
@@ -890,32 +890,32 @@ module Bundler::URI
890
890
  def self.get_encoding(label)
891
891
  Encoding.find(WEB_ENCODINGS_[label.to_str.strip.downcase]) rescue nil
892
892
  end
893
- end # module Bundler::URI
893
+ end # module Gem::URI
894
894
 
895
- module Bundler
895
+ module Gem
896
896
 
897
897
  #
898
- # Returns a \Bundler::URI object derived from the given +uri+,
899
- # which may be a \Bundler::URI string or an existing \Bundler::URI object:
898
+ # Returns a \Gem::URI object derived from the given +uri+,
899
+ # which may be a \Gem::URI string or an existing \Gem::URI object:
900
900
  #
901
- # require 'bundler/vendor/uri/lib/uri'
902
- # # Returns a new Bundler::URI.
903
- # uri = Bundler::URI('http://github.com/ruby/ruby')
904
- # # => #<Bundler::URI::HTTP http://github.com/ruby/ruby>
905
- # # Returns the given Bundler::URI.
906
- # Bundler::URI(uri)
907
- # # => #<Bundler::URI::HTTP http://github.com/ruby/ruby>
901
+ # require 'rubygems/vendor/uri/lib/uri'
902
+ # # Returns a new Gem::URI.
903
+ # uri = Gem::URI('http://github.com/ruby/ruby')
904
+ # # => #<Gem::URI::HTTP http://github.com/ruby/ruby>
905
+ # # Returns the given Gem::URI.
906
+ # Gem::URI(uri)
907
+ # # => #<Gem::URI::HTTP http://github.com/ruby/ruby>
908
908
  #
909
- # You must require 'bundler/vendor/uri/lib/uri' to use this method.
909
+ # You must require 'rubygems/vendor/uri/lib/uri' to use this method.
910
910
  #
911
911
  def URI(uri)
912
- if uri.is_a?(Bundler::URI::Generic)
912
+ if uri.is_a?(Gem::URI::Generic)
913
913
  uri
914
914
  elsif uri = String.try_convert(uri)
915
- Bundler::URI.parse(uri)
915
+ Gem::URI.parse(uri)
916
916
  else
917
917
  raise ArgumentError,
918
- "bad argument (expected Bundler::URI object or Bundler::URI string)"
918
+ "bad argument (expected Gem::URI object or Gem::URI string)"
919
919
  end
920
920
  end
921
921
  module_function :URI
@@ -2,17 +2,17 @@
2
2
 
3
3
  require_relative 'generic'
4
4
 
5
- module Bundler::URI
5
+ module Gem::URI
6
6
 
7
7
  #
8
- # The "file" Bundler::URI is defined by RFC8089.
8
+ # The "file" Gem::URI is defined by RFC8089.
9
9
  #
10
10
  class File < Generic
11
- # A Default port of nil for Bundler::URI::File.
11
+ # A Default port of nil for Gem::URI::File.
12
12
  DEFAULT_PORT = nil
13
13
 
14
14
  #
15
- # An Array of the available components for Bundler::URI::File.
15
+ # An Array of the available components for Gem::URI::File.
16
16
  #
17
17
  COMPONENT = [
18
18
  :scheme,
@@ -23,7 +23,7 @@ module Bundler::URI
23
23
  #
24
24
  # == Description
25
25
  #
26
- # Creates a new Bundler::URI::File object from components, with syntax checking.
26
+ # Creates a new Gem::URI::File object from components, with syntax checking.
27
27
  #
28
28
  # The components accepted are +host+ and +path+.
29
29
  #
@@ -38,16 +38,16 @@ module Bundler::URI
38
38
  #
39
39
  # Examples:
40
40
  #
41
- # require 'bundler/vendor/uri/lib/uri'
41
+ # require 'rubygems/vendor/uri/lib/uri'
42
42
  #
43
- # uri1 = Bundler::URI::File.build(['host.example.com', '/path/file.zip'])
43
+ # uri1 = Gem::URI::File.build(['host.example.com', '/path/file.zip'])
44
44
  # uri1.to_s # => "file://host.example.com/path/file.zip"
45
45
  #
46
- # uri2 = Bundler::URI::File.build({:host => 'host.example.com',
46
+ # uri2 = Gem::URI::File.build({:host => 'host.example.com',
47
47
  # :path => '/ruby/src'})
48
48
  # uri2.to_s # => "file://host.example.com/ruby/src"
49
49
  #
50
- # uri3 = Bundler::URI::File.build({:path => Bundler::URI::RFC2396_PARSER.escape('/path/my file.txt')})
50
+ # uri3 = Gem::URI::File.build({:path => Gem::URI::RFC2396_PARSER.escape('/path/my file.txt')})
51
51
  # uri3.to_s # => "file:///path/my%20file.txt"
52
52
  #
53
53
  def self.build(args)
@@ -57,7 +57,7 @@ module Bundler::URI
57
57
 
58
58
  # Protected setter for the host component +v+.
59
59
  #
60
- # See also Bundler::URI::Generic.host=.
60
+ # See also Gem::URI::Generic.host=.
61
61
  #
62
62
  def set_host(v)
63
63
  v = "" if v.nil? || v == "localhost"
@@ -70,17 +70,17 @@ module Bundler::URI
70
70
 
71
71
  # raise InvalidURIError
72
72
  def check_userinfo(user)
73
- raise Bundler::URI::InvalidURIError, "cannot set userinfo for file Bundler::URI"
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 Bundler::URI::InvalidURIError, "cannot set user for file Bundler::URI"
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 Bundler::URI::InvalidURIError, "cannot set password for file Bundler::URI"
83
+ raise Gem::URI::InvalidURIError, "cannot set password for file Gem::URI"
84
84
  end
85
85
 
86
86
  # do nothing