rubygems-update 3.5.5 → 3.5.7

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 (192) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -0
  3. data/Manifest.txt +81 -64
  4. data/bundler/CHANGELOG.md +33 -0
  5. data/bundler/lib/bundler/build_metadata.rb +2 -2
  6. data/bundler/lib/bundler/cli/binstubs.rb +1 -1
  7. data/bundler/lib/bundler/cli/gem.rb +1 -1
  8. data/bundler/lib/bundler/cli/lock.rb +5 -4
  9. data/bundler/lib/bundler/cli/plugin.rb +2 -2
  10. data/bundler/lib/bundler/cli.rb +2 -2
  11. data/bundler/lib/bundler/definition.rb +54 -28
  12. data/bundler/lib/bundler/dsl.rb +16 -1
  13. data/bundler/lib/bundler/environment_preserver.rb +3 -3
  14. data/bundler/lib/bundler/fetcher/downloader.rb +1 -1
  15. data/bundler/lib/bundler/fetcher.rb +2 -2
  16. data/bundler/lib/bundler/injector.rb +1 -1
  17. data/bundler/lib/bundler/installer.rb +2 -2
  18. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  19. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  20. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  21. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  22. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  26. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  27. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-install.1 +3 -3
  33. data/bundler/lib/bundler/man/bundle-install.1.ronn +2 -2
  34. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-plugin.1 +4 -4
  40. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +3 -3
  41. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle.1 +1 -1
  48. data/bundler/lib/bundler/man/gemfile.5 +3 -3
  49. data/bundler/lib/bundler/man/gemfile.5.ronn +2 -2
  50. data/bundler/lib/bundler/mirror.rb +3 -3
  51. data/bundler/lib/bundler/plugin/api/source.rb +2 -2
  52. data/bundler/lib/bundler/plugin/installer.rb +5 -9
  53. data/bundler/lib/bundler/runtime.rb +1 -1
  54. data/bundler/lib/bundler/settings.rb +14 -11
  55. data/bundler/lib/bundler/source/git/git_proxy.rb +1 -1
  56. data/bundler/lib/bundler/source/git.rb +1 -1
  57. data/bundler/lib/bundler/source/rubygems/remote.rb +1 -1
  58. data/bundler/lib/bundler/source/rubygems.rb +2 -2
  59. data/bundler/lib/bundler/spec_set.rb +1 -1
  60. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -3
  61. data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
  62. data/bundler/lib/bundler/uri_credentials_filter.rb +2 -2
  63. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +22 -22
  64. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +1 -0
  65. data/bundler/lib/bundler/vendored_net_http.rb +7 -3
  66. data/bundler/lib/bundler/vendored_timeout.rb +7 -3
  67. data/bundler/lib/bundler/vendored_uri.rb +18 -1
  68. data/bundler/lib/bundler/version.rb +1 -1
  69. data/bundler/lib/bundler/yaml_serializer.rb +12 -0
  70. data/bundler/lib/bundler.rb +3 -2
  71. data/lib/rubygems/command.rb +1 -1
  72. data/lib/rubygems/command_manager.rb +1 -1
  73. data/lib/rubygems/commands/help_command.rb +2 -2
  74. data/lib/rubygems/commands/rdoc_command.rb +1 -8
  75. data/lib/rubygems/commands/sources_command.rb +2 -2
  76. data/lib/rubygems/defaults.rb +4 -4
  77. data/lib/rubygems/dependency.rb +2 -2
  78. data/lib/rubygems/dependency_list.rb +1 -1
  79. data/lib/rubygems/ext/cargo_builder.rb +1 -1
  80. data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +1 -1
  81. data/lib/rubygems/gemcutter_utilities.rb +40 -23
  82. data/lib/rubygems/local_remote_options.rb +6 -6
  83. data/lib/rubygems/remote_fetcher.rb +3 -3
  84. data/lib/rubygems/request.rb +5 -5
  85. data/lib/rubygems/request_set.rb +1 -1
  86. data/lib/rubygems/requirement.rb +5 -0
  87. data/lib/rubygems/resolver/api_set.rb +1 -1
  88. data/lib/rubygems/resolver/best_set.rb +1 -1
  89. data/lib/rubygems/resolver.rb +5 -5
  90. data/lib/rubygems/s3_uri_signer.rb +3 -3
  91. data/lib/rubygems/safe_yaml.rb +10 -1
  92. data/lib/rubygems/security.rb +1 -1
  93. data/lib/rubygems/source/git.rb +2 -2
  94. data/lib/rubygems/source_list.rb +1 -1
  95. data/lib/rubygems/specification.rb +6 -6
  96. data/lib/rubygems/specification_policy.rb +15 -7
  97. data/lib/rubygems/uri.rb +6 -6
  98. data/lib/rubygems/util/licenses.rb +43 -0
  99. data/lib/rubygems/util.rb +1 -1
  100. data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
  101. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/delegates/specification_provider.rb +11 -11
  102. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
  103. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
  104. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
  105. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
  106. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
  107. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/log.rb +1 -1
  108. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
  109. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
  110. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/vertex.rb +1 -1
  111. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph.rb +2 -2
  112. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/errors.rb +1 -1
  113. data/lib/rubygems/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
  114. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/specification_provider.rb +2 -2
  115. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/ui.rb +1 -1
  116. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolution.rb +3 -3
  117. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolver.rb +1 -1
  118. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/state.rb +1 -1
  119. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo.rb +2 -2
  120. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/generic_request.rb +9 -9
  121. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/header.rb +2 -2
  122. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/request.rb +3 -3
  123. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/requests.rb +30 -30
  124. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/response.rb +2 -2
  125. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/responses.rb +6 -6
  126. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/status.rb +1 -1
  127. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http.rb +15 -15
  128. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/https.rb +1 -1
  129. data/lib/rubygems/vendor/optparse/lib/optparse/uri.rb +7 -0
  130. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse.rb +11 -11
  131. data/lib/rubygems/{timeout → vendor/timeout}/lib/timeout.rb +1 -1
  132. data/lib/rubygems/{tsort → vendor/tsort}/lib/tsort.rb +2 -2
  133. data/lib/rubygems/vendor/uri/.document +1 -0
  134. data/lib/rubygems/vendor/uri/LICENSE.txt +22 -0
  135. data/lib/rubygems/vendor/uri/lib/uri/common.rb +853 -0
  136. data/lib/rubygems/vendor/uri/lib/uri/file.rb +100 -0
  137. data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +267 -0
  138. data/lib/rubygems/vendor/uri/lib/uri/generic.rb +1588 -0
  139. data/lib/rubygems/vendor/uri/lib/uri/http.rb +125 -0
  140. data/lib/rubygems/vendor/uri/lib/uri/https.rb +23 -0
  141. data/lib/rubygems/vendor/uri/lib/uri/ldap.rb +261 -0
  142. data/lib/rubygems/vendor/uri/lib/uri/ldaps.rb +22 -0
  143. data/lib/rubygems/vendor/uri/lib/uri/mailto.rb +293 -0
  144. data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +539 -0
  145. data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +183 -0
  146. data/lib/rubygems/vendor/uri/lib/uri/version.rb +6 -0
  147. data/lib/rubygems/vendor/uri/lib/uri/ws.rb +83 -0
  148. data/lib/rubygems/vendor/uri/lib/uri/wss.rb +23 -0
  149. data/lib/rubygems/vendor/uri/lib/uri.rb +104 -0
  150. data/lib/rubygems/vendored_molinillo.rb +3 -0
  151. data/lib/rubygems/vendored_net_http.rb +5 -0
  152. data/lib/rubygems/vendored_optparse.rb +3 -0
  153. data/lib/rubygems/vendored_timeout.rb +5 -0
  154. data/lib/rubygems/vendored_tsort.rb +3 -0
  155. data/lib/rubygems/yaml_serializer.rb +12 -0
  156. data/lib/rubygems.rb +2 -2
  157. data/rubygems-update.gemspec +7 -2
  158. metadata +87 -67
  159. data/lib/rubygems/net/http.rb +0 -3
  160. data/lib/rubygems/optparse/lib/optparse/uri.rb +0 -7
  161. data/lib/rubygems/optparse.rb +0 -3
  162. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  163. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  164. data/lib/rubygems/resolver/molinillo.rb +0 -3
  165. data/lib/rubygems/timeout.rb +0 -3
  166. data/lib/rubygems/tsort.rb +0 -3
  167. /data/lib/rubygems/{net-http → vendor/molinillo}/.document +0 -0
  168. /data/lib/rubygems/{resolver → vendor}/molinillo/LICENSE +0 -0
  169. /data/lib/rubygems/{net-protocol → vendor/net-http}/.document +0 -0
  170. /data/lib/rubygems/{net-http → vendor/net-http}/LICENSE.txt +0 -0
  171. /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/backward.rb +0 -0
  172. /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/exceptions.rb +0 -0
  173. /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/proxy_delta.rb +0 -0
  174. /data/lib/rubygems/{optparse → vendor/net-protocol}/.document +0 -0
  175. /data/lib/rubygems/{net-protocol → vendor/net-protocol}/LICENSE.txt +0 -0
  176. /data/lib/rubygems/{net-protocol → vendor/net-protocol}/lib/net/protocol.rb +0 -0
  177. /data/lib/rubygems/{resolv → vendor/optparse}/.document +0 -0
  178. /data/lib/rubygems/{optparse → vendor/optparse}/COPYING +0 -0
  179. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optionparser.rb +0 -0
  180. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/ac.rb +0 -0
  181. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/date.rb +0 -0
  182. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/kwargs.rb +0 -0
  183. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/shellwords.rb +0 -0
  184. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/time.rb +0 -0
  185. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/version.rb +0 -0
  186. /data/lib/rubygems/{resolver/molinillo → vendor/resolv}/.document +0 -0
  187. /data/lib/rubygems/{resolv → vendor/resolv}/LICENSE.txt +0 -0
  188. /data/lib/rubygems/{resolv → vendor/resolv}/lib/resolv.rb +0 -0
  189. /data/lib/rubygems/{timeout → vendor/timeout}/.document +0 -0
  190. /data/lib/rubygems/{timeout → vendor/timeout}/LICENSE.txt +0 -0
  191. /data/lib/rubygems/{tsort → vendor/tsort}/.document +0 -0
  192. /data/lib/rubygems/{tsort → vendor/tsort}/LICENSE.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  require_relative '../../../../../vendored_net_http'
2
- require_relative '../../../../uri/lib/uri'
2
+ require_relative '../../../../../vendored_uri'
3
3
  require 'cgi' # for escaping
4
4
  require_relative '../../../../connection_pool/lib/connection_pool'
5
5
 
@@ -22,7 +22,7 @@ autoload :OpenSSL, 'openssl'
22
22
  #
23
23
  # require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
24
24
  #
25
- # uri = Bundler::URI 'http://example.com/awesome/web/service'
25
+ # uri = Gem::URI 'http://example.com/awesome/web/service'
26
26
  #
27
27
  # http = Gem::Net::HTTP::Persistent.new
28
28
  #
@@ -39,17 +39,17 @@ autoload :OpenSSL, 'openssl'
39
39
  # post = Gem::Net::HTTP::Post.new post_uri.path
40
40
  # post.set_form_data 'some' => 'cool data'
41
41
  #
42
- # # perform the POST, the Bundler::URI is always required
42
+ # # perform the POST, the Gem::URI is always required
43
43
  # response http.request post_uri, post
44
44
  #
45
45
  # Note that for GET, HEAD and other requests that do not have a body you want
46
- # to use Bundler::URI#request_uri not Bundler::URI#path. The request_uri contains the query
46
+ # to use Gem::URI#request_uri not Gem::URI#path. The request_uri contains the query
47
47
  # params which are sent in the body for other requests.
48
48
  #
49
49
  # == TLS/SSL
50
50
  #
51
51
  # TLS connections are automatically created depending upon the scheme of the
52
- # Bundler::URI. TLS connections are automatically verified against the default
52
+ # Gem::URI. TLS connections are automatically verified against the default
53
53
  # certificate store for your computer. You can override this by changing
54
54
  # verify_mode or by specifying an alternate cert_store.
55
55
  #
@@ -72,7 +72,7 @@ autoload :OpenSSL, 'openssl'
72
72
  # == Proxies
73
73
  #
74
74
  # A proxy can be set through #proxy= or at initialization time by providing a
75
- # second argument to ::new. The proxy may be the Bundler::URI of the proxy server or
75
+ # second argument to ::new. The proxy may be the Gem::URI of the proxy server or
76
76
  # <code>:ENV</code> which will consult environment variables.
77
77
  #
78
78
  # See #proxy= and #proxy_from_env for details.
@@ -197,7 +197,7 @@ class Gem::Net::HTTP::Persistent
197
197
  # NOTE: This may not work on ruby > 1.9.
198
198
 
199
199
  def self.detect_idle_timeout uri, max = 10
200
- uri = Bundler::URI uri unless Bundler::URI::Generic === uri
200
+ uri = Gem::URI uri unless Gem::URI::Generic === uri
201
201
  uri += '/'
202
202
 
203
203
  req = Gem::Net::HTTP::Head.new uri.request_uri
@@ -455,13 +455,13 @@ class Gem::Net::HTTP::Persistent
455
455
  # Set a +name+ for fun. Your library name should be good enough, but this
456
456
  # otherwise has no purpose.
457
457
  #
458
- # +proxy+ may be set to a Bundler::URI::HTTP or :ENV to pick up proxy options from
458
+ # +proxy+ may be set to a Gem::URI::HTTP or :ENV to pick up proxy options from
459
459
  # the environment. See proxy_from_env for details.
460
460
  #
461
- # In order to use a Bundler::URI for the proxy you may need to do some extra work
462
- # beyond Bundler::URI parsing if the proxy requires a password:
461
+ # In order to use a Gem::URI for the proxy you may need to do some extra work
462
+ # beyond Gem::URI parsing if the proxy requires a password:
463
463
  #
464
- # proxy = Bundler::URI 'http://proxy.example'
464
+ # proxy = Gem::URI 'http://proxy.example'
465
465
  # proxy.user = 'AzureDiamond'
466
466
  # proxy.password = 'hunter2'
467
467
  #
@@ -510,7 +510,7 @@ class Gem::Net::HTTP::Persistent
510
510
  @verify_mode = nil
511
511
  @cert_store = nil
512
512
 
513
- @generation = 0 # incremented when proxy Bundler::URI changes
513
+ @generation = 0 # incremented when proxy Gem::URI changes
514
514
 
515
515
  if HAVE_OPENSSL then
516
516
  @verify_mode = OpenSSL::SSL::VERIFY_PEER
@@ -720,12 +720,12 @@ class Gem::Net::HTTP::Persistent
720
720
  alias key= private_key=
721
721
 
722
722
  ##
723
- # Sets the proxy server. The +proxy+ may be the Bundler::URI of the proxy server,
723
+ # Sets the proxy server. The +proxy+ may be the Gem::URI of the proxy server,
724
724
  # the symbol +:ENV+ which will read the proxy from the environment or nil to
725
725
  # disable use of a proxy. See #proxy_from_env for details on setting the
726
726
  # proxy from the environment.
727
727
  #
728
- # If the proxy Bundler::URI is set after requests have been made, the next request
728
+ # If the proxy Gem::URI is set after requests have been made, the next request
729
729
  # will shut-down and re-open all connections.
730
730
  #
731
731
  # The +no_proxy+ query parameter can be used to specify hosts which shouldn't
@@ -736,9 +736,9 @@ class Gem::Net::HTTP::Persistent
736
736
  def proxy= proxy
737
737
  @proxy_uri = case proxy
738
738
  when :ENV then proxy_from_env
739
- when Bundler::URI::HTTP then proxy
739
+ when Gem::URI::HTTP then proxy
740
740
  when nil then # ignore
741
- else raise ArgumentError, 'proxy must be :ENV or a Bundler::URI::HTTP'
741
+ else raise ArgumentError, 'proxy must be :ENV or a Gem::URI::HTTP'
742
742
  end
743
743
 
744
744
  @no_proxy.clear
@@ -763,13 +763,13 @@ class Gem::Net::HTTP::Persistent
763
763
  end
764
764
 
765
765
  ##
766
- # Creates a Bundler::URI for an HTTP proxy server from ENV variables.
766
+ # Creates a Gem::URI for an HTTP proxy server from ENV variables.
767
767
  #
768
768
  # If +HTTP_PROXY+ is set a proxy will be returned.
769
769
  #
770
- # If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the Bundler::URI is given the
770
+ # If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the Gem::URI is given the
771
771
  # indicated user and password unless HTTP_PROXY contains either of these in
772
- # the Bundler::URI.
772
+ # the Gem::URI.
773
773
  #
774
774
  # The +NO_PROXY+ ENV variable can be used to specify hosts which shouldn't
775
775
  # be reached via proxy; if set it should be a comma separated list of
@@ -785,7 +785,7 @@ class Gem::Net::HTTP::Persistent
785
785
 
786
786
  return nil if env_proxy.nil? or env_proxy.empty?
787
787
 
788
- uri = Bundler::URI normalize_uri env_proxy
788
+ uri = Gem::URI normalize_uri env_proxy
789
789
 
790
790
  env_no_proxy = ENV['no_proxy'] || ENV['NO_PROXY']
791
791
 
@@ -863,7 +863,7 @@ class Gem::Net::HTTP::Persistent
863
863
  # +req+ must be a Gem::Net::HTTPGenericRequest subclass (see Gem::Net::HTTP for a list).
864
864
 
865
865
  def request uri, req = nil, &block
866
- uri = Bundler::URI uri
866
+ uri = Gem::URI uri
867
867
  req = request_setup req || uri
868
868
  response = nil
869
869
 
@@ -896,7 +896,7 @@ class Gem::Net::HTTP::Persistent
896
896
  end
897
897
 
898
898
  ##
899
- # Creates a GET request if +req_or_uri+ is a Bundler::URI and adds headers to the
899
+ # Creates a GET request if +req_or_uri+ is a Gem::URI and adds headers to the
900
900
  # request.
901
901
  #
902
902
  # Returns the request.
@@ -1,4 +1,5 @@
1
1
  require_relative 'package'
2
+ require_relative 'rubygems'
2
3
  require_relative 'version_constraint'
3
4
  require_relative 'incompatibility'
4
5
  require_relative 'basic_package_source'
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  begin
4
- require "rubygems/net/http"
4
+ require "rubygems/vendored_net_http"
5
5
  rescue LoadError
6
- require "net/http"
7
- Gem::Net = Net
6
+ begin
7
+ require "rubygems/net/http"
8
+ rescue LoadError
9
+ require "net/http"
10
+ Gem::Net = Net
11
+ end
8
12
  end
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  begin
4
- require "rubygems/timeout"
4
+ require "rubygems/vendored_timeout"
5
5
  rescue LoadError
6
- require "timeout"
7
- Gem::Timeout = Timeout
6
+ begin
7
+ require "rubygems/timeout"
8
+ rescue LoadError
9
+ require "timeout"
10
+ Gem::Timeout = Timeout
11
+ end
8
12
  end
@@ -1,4 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bundler; end
4
- require_relative "vendor/uri/lib/uri"
4
+
5
+ # Use RubyGems vendored copy when available. Otherwise fallback to Bundler
6
+ # vendored copy. The vendored copy in Bundler can be removed once support for
7
+ # RubyGems 3.5 is dropped.
8
+
9
+ begin
10
+ require "rubygems/vendor/uri/lib/uri"
11
+ rescue LoadError
12
+ require_relative "vendor/uri/lib/uri"
13
+ Gem::URI = Bundler::URI
14
+
15
+ module Gem
16
+ def URI(uri) # rubocop:disable Naming/MethodName
17
+ Bundler::URI(uri)
18
+ end
19
+ module_function :URI
20
+ end
21
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.5.5".freeze
4
+ VERSION = "2.5.7".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -58,6 +58,8 @@ module Bundler
58
58
  str.split(/\r?\n/) do |line|
59
59
  if match = HASH_REGEX.match(line)
60
60
  indent, key, quote, val = match.captures
61
+ val = strip_comment(val)
62
+
61
63
  convert_to_backward_compatible_key!(key)
62
64
  depth = indent.size / 2
63
65
  if quote.empty? && val.empty?
@@ -72,6 +74,8 @@ module Bundler
72
74
  end
73
75
  elsif match = ARRAY_REGEX.match(line)
74
76
  _, val = match.captures
77
+ val = strip_comment(val)
78
+
75
79
  last_hash[last_empty_key] = [] unless last_hash[last_empty_key].is_a?(Array)
76
80
 
77
81
  last_hash[last_empty_key].push(val)
@@ -80,6 +84,14 @@ module Bundler
80
84
  res
81
85
  end
82
86
 
87
+ def strip_comment(val)
88
+ if val.include?("#") && !val.start_with?("#")
89
+ val.split("#", 2).first.strip
90
+ else
91
+ val
92
+ end
93
+ end
94
+
83
95
  # for settings' keys
84
96
  def convert_to_backward_compatible_key!(key)
85
97
  key << "/" if /https?:/i.match?(key) && !%r{/\Z}.match?(key)
@@ -200,12 +200,13 @@ module Bundler
200
200
  #
201
201
  # @param unlock [Hash, Boolean, nil] Gems that have been requested
202
202
  # to be updated or true if all gems should be updated
203
+ # @param lockfile [Pathname] Path to Gemfile.lock
203
204
  # @return [Bundler::Definition]
204
- def definition(unlock = nil)
205
+ def definition(unlock = nil, lockfile = default_lockfile)
205
206
  @definition = nil if unlock
206
207
  @definition ||= begin
207
208
  configure
208
- Definition.build(default_gemfile, default_lockfile, unlock)
209
+ Definition.build(default_gemfile, lockfile, unlock)
209
210
  end
210
211
  end
211
212
 
@@ -6,7 +6,7 @@
6
6
  # See LICENSE.txt for permissions.
7
7
  #++
8
8
 
9
- require_relative "optparse"
9
+ require_relative "vendored_optparse"
10
10
  require_relative "requirement"
11
11
  require_relative "user_interaction"
12
12
 
@@ -106,7 +106,7 @@ class Gem::CommandManager
106
106
  # Register all the subcommands supported by the gem command.
107
107
 
108
108
  def initialize
109
- require_relative "timeout"
109
+ require_relative "vendored_timeout"
110
110
  @commands = {}
111
111
 
112
112
  BUILTIN_COMMANDS.each do |name|
@@ -59,7 +59,7 @@ multiple environments. The RubyGems implementation is designed to be
59
59
  compatible with Bundler's Gemfile format. You can see additional
60
60
  documentation on the format at:
61
61
 
62
- http://bundler.io
62
+ https://bundler.io
63
63
 
64
64
  RubyGems automatically looks for these gem dependencies files:
65
65
 
@@ -172,7 +172,7 @@ and #platforms methods:
172
172
  See the bundler Gemfile manual page for a list of platforms supported in a gem
173
173
  dependencies file.:
174
174
 
175
- http://bundler.io/v1.6/man/gemfile.5.html
175
+ https://bundler.io/v2.5/man/gemfile.5.html
176
176
 
177
177
  Ruby Version and Engine Dependency
178
178
  ==================================
@@ -84,14 +84,7 @@ Use --overwrite to force rebuilding of documentation.
84
84
  FileUtils.rm_rf File.join(spec.doc_dir, "rdoc")
85
85
  end
86
86
 
87
- begin
88
- doc.generate
89
- rescue Errno::ENOENT => e
90
- match = / - /.match(e.message)
91
- alert_error "Unable to document #{spec.full_name}, " \
92
- " #{match.post_match} is missing, skipping"
93
- terminate_interaction 1 if specs.length == 1
94
- end
87
+ doc.generate
95
88
  end
96
89
  end
97
90
  end
@@ -59,7 +59,7 @@ class Gem::Commands::SourcesCommand < Gem::Command
59
59
 
60
60
  say "#{source_uri} added to sources"
61
61
  end
62
- rescue URI::Error, ArgumentError
62
+ rescue Gem::URI::Error, ArgumentError
63
63
  say "#{source_uri} is not a URI"
64
64
  terminate_interaction 1
65
65
  rescue Gem::RemoteFetcher::FetchError => e
@@ -81,7 +81,7 @@ Do you want to add this source?
81
81
  end
82
82
 
83
83
  def check_rubygems_https(source_uri) # :nodoc:
84
- uri = URI source_uri
84
+ uri = Gem::URI source_uri
85
85
 
86
86
  if uri.scheme && uri.scheme.casecmp("http").zero? &&
87
87
  uri.host.casecmp("rubygems.org").zero?
@@ -112,7 +112,7 @@ module Gem
112
112
  # The path to standard location of the user's configuration directory.
113
113
 
114
114
  def self.config_home
115
- @config_home ||= (ENV["XDG_CONFIG_HOME"] || File.join(Gem.user_home, ".config"))
115
+ @config_home ||= ENV["XDG_CONFIG_HOME"] || File.join(Gem.user_home, ".config")
116
116
  end
117
117
 
118
118
  ##
@@ -145,21 +145,21 @@ module Gem
145
145
  # The path to standard location of the user's cache directory.
146
146
 
147
147
  def self.cache_home
148
- @cache_home ||= (ENV["XDG_CACHE_HOME"] || File.join(Gem.user_home, ".cache"))
148
+ @cache_home ||= ENV["XDG_CACHE_HOME"] || File.join(Gem.user_home, ".cache")
149
149
  end
150
150
 
151
151
  ##
152
152
  # The path to standard location of the user's data directory.
153
153
 
154
154
  def self.data_home
155
- @data_home ||= (ENV["XDG_DATA_HOME"] || File.join(Gem.user_home, ".local", "share"))
155
+ @data_home ||= ENV["XDG_DATA_HOME"] || File.join(Gem.user_home, ".local", "share")
156
156
  end
157
157
 
158
158
  ##
159
159
  # The path to standard location of the user's state directory.
160
160
 
161
161
  def self.state_home
162
- @state_home ||= (ENV["XDG_STATE_HOME"] || File.join(Gem.user_home, ".local", "state"))
162
+ @state_home ||= ENV["XDG_STATE_HOME"] || File.join(Gem.user_home, ".local", "state")
163
163
  end
164
164
 
165
165
  ##
@@ -328,9 +328,9 @@ class Gem::Dependency
328
328
  return active if active
329
329
 
330
330
  unless prerelease?
331
- # Move prereleases to the end of the list for >= 0 requirements
331
+ # Consider prereleases only as a fallback
332
332
  pre, matches = matches.partition {|spec| spec.version.prerelease? }
333
- matches += pre if requirement == Gem::Requirement.default
333
+ matches = pre if matches.empty?
334
334
  end
335
335
 
336
336
  matches.first
@@ -6,7 +6,7 @@
6
6
  # See LICENSE.txt for permissions.
7
7
  #++
8
8
 
9
- require_relative "tsort"
9
+ require_relative "vendored_tsort"
10
10
  require_relative "deprecate"
11
11
 
12
12
  ##
@@ -293,7 +293,7 @@ EOF
293
293
 
294
294
  case var_name
295
295
  # On windows, it is assumed that mkmf has setup an exports file for the
296
- # extension, so we have to to create one ourselves.
296
+ # extension, so we have to create one ourselves.
297
297
  when "DEFFILE"
298
298
  write_deffile(dest_dir, crate_name)
299
299
  else
@@ -51,7 +51,7 @@ module Gem::GemcutterUtilities
51
51
  request_line = socket.gets
52
52
 
53
53
  method, req_uri, _protocol = request_line.split(" ")
54
- req_uri = URI.parse(req_uri)
54
+ req_uri = Gem::URI.parse(req_uri)
55
55
 
56
56
  responder = SocketResponder.new(socket)
57
57
 
@@ -10,7 +10,8 @@ require_relative "gemcutter_utilities/webauthn_poller"
10
10
 
11
11
  module Gem::GemcutterUtilities
12
12
  ERROR_CODE = 1
13
- API_SCOPES = [:index_rubygems, :push_rubygem, :yank_rubygem, :add_owner, :remove_owner, :access_webhooks, :show_dashboard].freeze
13
+ API_SCOPES = [:index_rubygems, :push_rubygem, :yank_rubygem, :add_owner, :remove_owner, :access_webhooks].freeze
14
+ EXCLUSIVELY_API_SCOPES = [:show_dashboard].freeze
14
15
 
15
16
  include Gem::Text
16
17
 
@@ -84,7 +85,7 @@ module Gem::GemcutterUtilities
84
85
  # If +allowed_push_host+ metadata is present, then it will only allow that host.
85
86
 
86
87
  def rubygems_api_request(method, path, host = nil, allowed_push_host = nil, scope: nil, credentials: {}, &block)
87
- require_relative "net/http"
88
+ require_relative "vendored_net_http"
88
89
 
89
90
  self.host = host if host
90
91
  unless self.host
@@ -93,8 +94,8 @@ module Gem::GemcutterUtilities
93
94
  end
94
95
 
95
96
  if allowed_push_host
96
- allowed_host_uri = URI.parse(allowed_push_host)
97
- host_uri = URI.parse(self.host)
97
+ allowed_host_uri = Gem::URI.parse(allowed_push_host)
98
+ host_uri = Gem::URI.parse(self.host)
98
99
 
99
100
  unless (host_uri.scheme == allowed_host_uri.scheme) && (host_uri.host == allowed_host_uri.host)
100
101
  alert_error "#{self.host.inspect} is not allowed by the gemspec, which only allows #{allowed_push_host.inspect}"
@@ -102,7 +103,7 @@ module Gem::GemcutterUtilities
102
103
  end
103
104
  end
104
105
 
105
- uri = URI.parse "#{self.host}/#{path}"
106
+ uri = Gem::URI.parse "#{self.host}/#{path}"
106
107
  response = request_with_otp(method, uri, &block)
107
108
 
108
109
  if mfa_unauthorized?(response)
@@ -129,14 +130,14 @@ module Gem::GemcutterUtilities
129
130
 
130
131
  say "The existing key doesn't have access of #{scope} on #{pretty_host}. Please sign in to update access."
131
132
 
132
- email = ask " Email: "
133
- password = ask_for_password "Password: "
133
+ identifier = ask "Username/email: "
134
+ password = ask_for_password " Password: "
134
135
 
135
136
  response = rubygems_api_request(:put, "api/v1/api_key",
136
137
  sign_in_host, scope: scope) do |request|
137
- request.basic_auth email, password
138
+ request.basic_auth identifier, password
138
139
  request["OTP"] = otp if otp
139
- request.body = URI.encode_www_form({ api_key: api_key }.merge(update_scope_params))
140
+ request.body = Gem::URI.encode_www_form({ api_key: api_key }.merge(update_scope_params))
140
141
  end
141
142
 
142
143
  with_response response do |_resp|
@@ -158,25 +159,25 @@ module Gem::GemcutterUtilities
158
159
  say "Don't have an account yet? " \
159
160
  "Create one at #{sign_in_host}/sign_up"
160
161
 
161
- email = ask " Email: "
162
- password = ask_for_password "Password: "
162
+ identifier = ask "Username/email: "
163
+ password = ask_for_password " Password: "
163
164
  say "\n"
164
165
 
165
166
  key_name = get_key_name(scope)
166
167
  scope_params = get_scope_params(scope)
167
- profile = get_user_profile(email, password)
168
+ profile = get_user_profile(identifier, password)
168
169
  mfa_params = get_mfa_params(profile)
169
170
  all_params = scope_params.merge(mfa_params)
170
171
  warning = profile["warning"]
171
- credentials = { email: email, password: password }
172
+ credentials = { identifier: identifier, password: password }
172
173
 
173
174
  say "#{warning}\n" if warning
174
175
 
175
176
  response = rubygems_api_request(:post, "api/v1/api_key",
176
177
  sign_in_host, credentials: credentials, scope: scope) do |request|
177
- request.basic_auth email, password
178
+ request.basic_auth identifier, password
178
179
  request["OTP"] = otp if otp
179
- request.body = URI.encode_www_form({ name: key_name }.merge(all_params))
180
+ request.body = Gem::URI.encode_www_form({ name: key_name }.merge(all_params))
180
181
  end
181
182
 
182
183
  with_response response do |resp|
@@ -294,7 +295,7 @@ module Gem::GemcutterUtilities
294
295
  if credentials.empty?
295
296
  request.add_field "Authorization", api_key
296
297
  else
297
- request.basic_auth credentials[:email], credentials[:password]
298
+ request.basic_auth credentials[:identifier], credentials[:password]
298
299
  end
299
300
  end
300
301
  response.is_a?(Gem::Net::HTTPSuccess) ? response.body : nil
@@ -309,15 +310,31 @@ module Gem::GemcutterUtilities
309
310
  end
310
311
 
311
312
  def get_scope_params(scope)
312
- scope_params = {}
313
+ scope_params = { index_rubygems: true }
313
314
 
314
315
  if scope
315
316
  scope_params = { scope => true }
316
317
  else
317
- say "Please select scopes you want to enable for the API key (y/n)"
318
- API_SCOPES.each do |s|
319
- selected = ask_yes_no(s.to_s, false)
320
- scope_params[s] = true if selected
318
+ say "The default access scope is:"
319
+ scope_params.each do |k, _v|
320
+ say " #{k}: y"
321
+ end
322
+ say "\n"
323
+ customise = ask_yes_no("Do you want to customise scopes?", false)
324
+ if customise
325
+ EXCLUSIVELY_API_SCOPES.each do |excl_scope|
326
+ selected = ask_yes_no("#{excl_scope} (exclusive scope, answering yes will not prompt for other scopes)", false)
327
+ next unless selected
328
+
329
+ return { excl_scope => true }
330
+ end
331
+
332
+ scope_params = {}
333
+
334
+ API_SCOPES.each do |s|
335
+ selected = ask_yes_no(s.to_s, false)
336
+ scope_params[s] = true if selected
337
+ end
321
338
  end
322
339
  say "\n"
323
340
  end
@@ -329,11 +346,11 @@ module Gem::GemcutterUtilities
329
346
  host == Gem::DEFAULT_HOST
330
347
  end
331
348
 
332
- def get_user_profile(email, password)
349
+ def get_user_profile(identifier, password)
333
350
  return {} unless default_host?
334
351
 
335
352
  response = rubygems_api_request(:get, "api/v1/profile/me.yaml") do |request|
336
- request.basic_auth email, password
353
+ request.basic_auth identifier, password
337
354
  end
338
355
 
339
356
  with_response response do |resp|
@@ -6,7 +6,7 @@
6
6
  # See LICENSE.txt for permissions.
7
7
  #++
8
8
 
9
- require "uri"
9
+ require_relative "vendor/uri/lib/uri"
10
10
  require_relative "../rubygems"
11
11
 
12
12
  ##
@@ -17,10 +17,10 @@ module Gem::LocalRemoteOptions
17
17
  # Allows Gem::OptionParser to handle HTTP URIs.
18
18
 
19
19
  def accept_uri_http
20
- Gem::OptionParser.accept URI::HTTP do |value|
20
+ Gem::OptionParser.accept Gem::URI::HTTP do |value|
21
21
  begin
22
- uri = URI.parse value
23
- rescue URI::InvalidURIError
22
+ uri = Gem::URI.parse value
23
+ rescue Gem::URI::InvalidURIError
24
24
  raise Gem::OptionParser::InvalidArgument, value
25
25
  end
26
26
 
@@ -88,7 +88,7 @@ module Gem::LocalRemoteOptions
88
88
  def add_proxy_option
89
89
  accept_uri_http
90
90
 
91
- add_option(:"Local/Remote", "-p", "--[no-]http-proxy [URL]", URI::HTTP,
91
+ add_option(:"Local/Remote", "-p", "--[no-]http-proxy [URL]", Gem::URI::HTTP,
92
92
  "Use HTTP proxy for remote operations") do |value, options|
93
93
  options[:http_proxy] = value == false ? :no_proxy : value
94
94
  Gem.configuration[:http_proxy] = options[:http_proxy]
@@ -101,7 +101,7 @@ module Gem::LocalRemoteOptions
101
101
  def add_source_option
102
102
  accept_uri_http
103
103
 
104
- add_option(:"Local/Remote", "-s", "--source URL", URI::HTTP,
104
+ add_option(:"Local/Remote", "-s", "--source URL", Gem::URI::HTTP,
105
105
  "Append URL to list of remote gem sources") do |source, options|
106
106
  source << "/" unless source.end_with?("/")
107
107
 
@@ -74,9 +74,9 @@ class Gem::RemoteFetcher
74
74
 
75
75
  def initialize(proxy=nil, dns=nil, headers={})
76
76
  require_relative "core_ext/tcpsocket_init" if Gem.configuration.ipv4_fallback_enabled
77
- require_relative "net/http"
77
+ require_relative "vendored_net_http"
78
78
  require "stringio"
79
- require "uri"
79
+ require_relative "vendor/uri/lib/uri"
80
80
 
81
81
  Socket.do_not_reverse_lookup = true
82
82
 
@@ -135,7 +135,7 @@ class Gem::RemoteFetcher
135
135
 
136
136
  scheme = source_uri.scheme
137
137
 
138
- # URI.parse gets confused by MS Windows paths with forward slashes.
138
+ # Gem::URI.parse gets confused by MS Windows paths with forward slashes.
139
139
  scheme = nil if /^[a-z]$/i.match?(scheme)
140
140
 
141
141
  # REFACTOR: split this up and dispatch on scheme (eg download_http)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "net/http"
3
+ require_relative "vendored_net_http"
4
4
  require_relative "user_interaction"
5
5
 
6
6
  class Gem::Request
@@ -18,11 +18,11 @@ class Gem::Request
18
18
  end
19
19
 
20
20
  def self.proxy_uri(proxy) # :nodoc:
21
- require "uri"
21
+ require_relative "vendor/uri/lib/uri"
22
22
  case proxy
23
23
  when :no_proxy then nil
24
- when URI::HTTP then proxy
25
- else URI.parse(proxy)
24
+ when Gem::URI::HTTP then proxy
25
+ else Gem::URI.parse(proxy)
26
26
  end
27
27
  end
28
28
 
@@ -176,7 +176,7 @@ class Gem::Request
176
176
  end
177
177
 
178
178
  require "uri"
179
- uri = URI(Gem::UriFormatter.new(env_proxy).normalize)
179
+ uri = Gem::URI(Gem::UriFormatter.new(env_proxy).normalize)
180
180
 
181
181
  if uri && uri.user.nil? && uri.password.nil?
182
182
  user = ENV["#{downcase_scheme}_proxy_user"] || ENV["#{upcase_scheme}_PROXY_USER"]