rubygems-update 3.5.5 → 3.5.7

Sign up to get free protection for your applications and to get access to all the features.
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,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "tsort"
3
+ require_relative "vendored_tsort"
4
4
 
5
5
  ##
6
6
  # A RequestSet groups a request to activate a set of dependencies.
@@ -284,6 +284,11 @@ class Gem::Requirement
284
284
  def _tilde_requirements
285
285
  @_tilde_requirements ||= _sorted_requirements.select {|r| r.first == "~>" }
286
286
  end
287
+
288
+ def initialize_copy(other) # :nodoc:
289
+ @requirements = other.requirements.dup
290
+ super
291
+ end
287
292
  end
288
293
 
289
294
  class Gem::Version
@@ -30,7 +30,7 @@ class Gem::Resolver::APISet < Gem::Resolver::Set
30
30
  def initialize(dep_uri = "https://index.rubygems.org/info/")
31
31
  super()
32
32
 
33
- dep_uri = URI dep_uri unless URI === dep_uri
33
+ dep_uri = Gem::URI dep_uri unless Gem::URI === dep_uri
34
34
 
35
35
  @dep_uri = dep_uri
36
36
  @uri = dep_uri + ".."
@@ -60,7 +60,7 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
60
60
 
61
61
  def replace_failed_api_set(error) # :nodoc:
62
62
  uri = error.original_uri
63
- uri = URI uri unless URI === uri
63
+ uri = Gem::URI uri unless Gem::URI === uri
64
64
  uri += "."
65
65
 
66
66
  raise error unless api_set = @sets.find do |set|
@@ -11,7 +11,7 @@ require_relative "util/list"
11
11
  # all the requirements.
12
12
 
13
13
  class Gem::Resolver
14
- require_relative "resolver/molinillo"
14
+ require_relative "vendored_molinillo"
15
15
 
16
16
  ##
17
17
  # If the DEBUG_RESOLVER environment variable is set then debugging mode is
@@ -167,7 +167,7 @@ class Gem::Resolver
167
167
  reqs
168
168
  end
169
169
 
170
- include Molinillo::UI
170
+ include Gem::Molinillo::UI
171
171
 
172
172
  def output
173
173
  @output ||= debug? ? $stdout : File.open(IO::NULL, "w")
@@ -177,14 +177,14 @@ class Gem::Resolver
177
177
  DEBUG_RESOLVER
178
178
  end
179
179
 
180
- include Molinillo::SpecificationProvider
180
+ include Gem::Molinillo::SpecificationProvider
181
181
 
182
182
  ##
183
183
  # Proceed with resolution! Returns an array of ActivationRequest objects.
184
184
 
185
185
  def resolve
186
- Molinillo::Resolver.new(self, self).resolve(@needed.map {|d| DependencyRequest.new d, nil }).tsort.map(&:payload).compact
187
- rescue Molinillo::VersionConflict => e
186
+ Gem::Molinillo::Resolver.new(self, self).resolve(@needed.map {|d| DependencyRequest.new d, nil }).tsort.map(&:payload).compact
187
+ rescue Gem::Molinillo::VersionConflict => e
188
188
  conflict = e.conflicts.values.first
189
189
  raise Gem::DependencyResolutionError, Conflict.new(conflict.requirement_trees.first.first, conflict.existing, conflict.requirement)
190
190
  ensure
@@ -49,7 +49,7 @@ class Gem::S3URISigner
49
49
  string_to_sign = generate_string_to_sign(date_time, credential_info, canonical_request)
50
50
  signature = generate_signature(s3_config, date, string_to_sign)
51
51
 
52
- URI.parse("https://#{canonical_host}#{uri.path}?#{query_params}&X-Amz-Signature=#{signature}")
52
+ Gem::URI.parse("https://#{canonical_host}#{uri.path}?#{query_params}&X-Amz-Signature=#{signature}")
53
53
  end
54
54
 
55
55
  private
@@ -140,7 +140,7 @@ class Gem::S3URISigner
140
140
  end
141
141
 
142
142
  def ec2_metadata_credentials_json
143
- require_relative "net/http"
143
+ require_relative "vendored_net_http"
144
144
  require_relative "request"
145
145
  require_relative "request/connection_pools"
146
146
  require "json"
@@ -152,7 +152,7 @@ class Gem::S3URISigner
152
152
  end
153
153
 
154
154
  def ec2_metadata_request(url)
155
- uri = URI(url)
155
+ uri = Gem::URI(url)
156
156
  @request_pool ||= create_request_pool(uri)
157
157
  request = Gem::Request.new(uri, Gem::Net::HTTP::Get, nil, @request_pool)
158
158
  response = request.fetch
@@ -25,8 +25,17 @@ module Gem
25
25
  runtime
26
26
  ].freeze
27
27
 
28
+ @aliases_enabled = true
29
+ def self.aliases_enabled=(value) # :nodoc:
30
+ @aliases_enabled = !!value
31
+ end
32
+
33
+ def self.aliases_enabled? # :nodoc:
34
+ @aliases_enabled
35
+ end
36
+
28
37
  def self.safe_load(input)
29
- ::Psych.safe_load(input, permitted_classes: PERMITTED_CLASSES, permitted_symbols: PERMITTED_SYMBOLS, aliases: true)
38
+ ::Psych.safe_load(input, permitted_classes: PERMITTED_CLASSES, permitted_symbols: PERMITTED_SYMBOLS, aliases: @aliases_enabled)
30
39
  end
31
40
 
32
41
  def self.load(input)
@@ -323,7 +323,7 @@ require_relative "openssl"
323
323
  # == Original author
324
324
  #
325
325
  # Paul Duncan <pabs@pablotron.org>
326
- # http://pablotron.org/
326
+ # https://pablotron.org/
327
327
 
328
328
  module Gem::Security
329
329
  ##
@@ -221,14 +221,14 @@ class Gem::Source::Git < Gem::Source
221
221
  end
222
222
 
223
223
  ##
224
- # A hash for the git gem based on the git repository URI.
224
+ # A hash for the git gem based on the git repository Gem::URI.
225
225
 
226
226
  def uri_hash # :nodoc:
227
227
  require_relative "../openssl"
228
228
 
229
229
  normalized =
230
230
  if @repository.match?(%r{^\w+://(\w+@)?})
231
- uri = URI(@repository).normalize.to_s.sub %r{/$},""
231
+ uri = Gem::URI(@repository).normalize.to_s.sub %r{/$},""
232
232
  uri.sub(/\A(\w+)/) { $1.downcase }
233
233
  else
234
234
  @repository
@@ -44,7 +44,7 @@ class Gem::SourceList
44
44
  end
45
45
 
46
46
  ##
47
- # Appends +obj+ to the source list which may be a Gem::Source, URI or URI
47
+ # Appends +obj+ to the source list which may be a Gem::Source, Gem::URI or URI
48
48
  # String.
49
49
 
50
50
  def <<(obj)
@@ -341,7 +341,7 @@ class Gem::Specification < Gem::BasicSpecification
341
341
  # https://opensource.org/licenses/ approved.
342
342
  #
343
343
  # The most commonly used OSI-approved licenses are MIT and Apache-2.0.
344
- # GitHub also provides a license picker at http://choosealicense.com/.
344
+ # GitHub also provides a license picker at https://choosealicense.com/.
345
345
  #
346
346
  # You can also use a custom license file along with your gemspec and specify
347
347
  # a LicenseRef-<idstring>, where idstring is the name of the file containing
@@ -1003,8 +1003,6 @@ class Gem::Specification < Gem::BasicSpecification
1003
1003
  def self.find_all_by_name(name, *requirements)
1004
1004
  requirements = Gem::Requirement.default if requirements.empty?
1005
1005
 
1006
- # TODO: maybe try: find_all { |s| spec === dep }
1007
-
1008
1006
  Gem::Dependency.new(name, *requirements).matching_specs
1009
1007
  end
1010
1008
 
@@ -1022,8 +1020,6 @@ class Gem::Specification < Gem::BasicSpecification
1022
1020
  def self.find_by_name(name, *requirements)
1023
1021
  requirements = Gem::Requirement.default if requirements.empty?
1024
1022
 
1025
- # TODO: maybe try: find { |s| spec === dep }
1026
-
1027
1023
  Gem::Dependency.new(name, *requirements).to_spec
1028
1024
  end
1029
1025
 
@@ -2079,7 +2075,8 @@ class Gem::Specification < Gem::BasicSpecification
2079
2075
  end
2080
2076
 
2081
2077
  ##
2082
- # Duplicates array_attributes from +other_spec+ so state isn't shared.
2078
+ # Duplicates Array and Gem::Requirement attributes from +other_spec+ so state isn't shared.
2079
+ #
2083
2080
 
2084
2081
  def initialize_copy(other_spec)
2085
2082
  self.class.array_attributes.each do |name|
@@ -2101,6 +2098,9 @@ class Gem::Specification < Gem::BasicSpecification
2101
2098
  raise e
2102
2099
  end
2103
2100
  end
2101
+
2102
+ @required_ruby_version = other_spec.required_ruby_version.dup
2103
+ @required_rubygems_version = other_spec.required_rubygems_version.dup
2104
2104
  end
2105
2105
 
2106
2106
  def base_dir
@@ -7,7 +7,7 @@ class Gem::SpecificationPolicy
7
7
 
8
8
  VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/ # :nodoc:
9
9
 
10
- SPECIAL_CHARACTERS = /\A[#{Regexp.escape('.-_')}]+/ # :nodoc:
10
+ SPECIAL_CHARACTERS = /\A[#{Regexp.escape(".-_")}]+/ # :nodoc:
11
11
 
12
12
  VALID_URI_PATTERN = %r{\Ahttps?:\/\/([^\s:@]+:[^\s:@]*@)?[A-Za-z\d\-]+(\.[A-Za-z\d\-]+)+\.?(:\d{1,5})?([\/?]\S*)?\z} # :nodoc:
13
13
 
@@ -103,6 +103,8 @@ class Gem::SpecificationPolicy
103
103
 
104
104
  validate_dependencies
105
105
 
106
+ validate_required_ruby_version
107
+
106
108
  validate_extensions
107
109
 
108
110
  validate_removed_attributes
@@ -227,6 +229,12 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
227
229
  end
228
230
  end
229
231
 
232
+ def validate_required_ruby_version
233
+ if @specification.required_ruby_version.requirements == [Gem::Requirement::DefaultRequirement]
234
+ warning "make sure you specify the oldest ruby version constraint (like \">= 3.0\") that you want your gem to support by setting the `required_ruby_version` gemspec attribute"
235
+ end
236
+ end
237
+
230
238
  ##
231
239
  # Issues a warning for each file to be packaged which is world-readable.
232
240
  #
@@ -427,13 +435,13 @@ or set it to nil if you don't want to specify a license.
427
435
 
428
436
  # Make sure a homepage is valid HTTP/HTTPS URI
429
437
  if homepage && !homepage.empty?
430
- require "uri"
438
+ require_relative "vendor/uri/lib/uri"
431
439
  begin
432
- homepage_uri = URI.parse(homepage)
433
- unless [URI::HTTP, URI::HTTPS].member? homepage_uri.class
440
+ homepage_uri = Gem::URI.parse(homepage)
441
+ unless [Gem::URI::HTTP, Gem::URI::HTTPS].member? homepage_uri.class
434
442
  error "\"#{homepage}\" is not a valid HTTP URI"
435
443
  end
436
- rescue URI::InvalidURIError
444
+ rescue Gem::URI::InvalidURIError
437
445
  error "\"#{homepage}\" is not a valid HTTP URI"
438
446
  end
439
447
  end
@@ -497,10 +505,10 @@ You have specified rust based extension, but Cargo.lock is not part of the gem f
497
505
 
498
506
  def validate_rake_extensions(builder) # :nodoc:
499
507
  rake_extension = @specification.extensions.any? {|s| builder.builder_for(s) == Gem::Ext::RakeBuilder }
500
- rake_dependency = @specification.dependencies.any? {|d| d.name == "rake" }
508
+ rake_dependency = @specification.dependencies.any? {|d| d.name == "rake" && d.type == :runtime }
501
509
 
502
510
  warning <<-WARNING if rake_extension && !rake_dependency
503
- You have specified rake based extension, but rake is not added as dependency. It is recommended to add rake as a dependency in gemspec since there's no guarantee rake will be already installed.
511
+ You have specified rake based extension, but rake is not added as runtime dependency. It is recommended to add rake as a runtime dependency in gemspec since there's no guarantee rake will be already installed.
504
512
  WARNING
505
513
  end
506
514
 
data/lib/rubygems/uri.rb CHANGED
@@ -16,9 +16,9 @@ class Gem::Uri
16
16
  # Parses uri, raising if it's invalid
17
17
 
18
18
  def self.parse!(uri)
19
- require "uri"
19
+ require_relative "vendor/uri/lib/uri"
20
20
 
21
- raise URI::InvalidURIError unless uri
21
+ raise Gem::URI::InvalidURIError unless uri
22
22
 
23
23
  return uri unless uri.is_a?(String)
24
24
 
@@ -28,9 +28,9 @@ class Gem::Uri
28
28
  # as "%7BDESede%7D". If this is escaped again the percentage
29
29
  # symbols will be escaped.
30
30
  begin
31
- URI.parse(uri)
32
- rescue URI::InvalidURIError
33
- URI.parse(URI::DEFAULT_PARSER.escape(uri))
31
+ Gem::URI.parse(uri)
32
+ rescue Gem::URI::InvalidURIError
33
+ Gem::URI.parse(Gem::URI::DEFAULT_PARSER.escape(uri))
34
34
  end
35
35
  end
36
36
 
@@ -39,7 +39,7 @@ class Gem::Uri
39
39
 
40
40
  def self.parse(uri)
41
41
  parse!(uri)
42
- rescue URI::InvalidURIError
42
+ rescue Gem::URI::InvalidURIError
43
43
  uri
44
44
  end
45
45
 
@@ -28,6 +28,7 @@ class Gem::Licenses
28
28
  AGPL-3.0-or-later
29
29
  AMDPLPA
30
30
  AML
31
+ AML-glslang
31
32
  AMPAS
32
33
  ANTLR-PD
33
34
  ANTLR-PD-fallback
@@ -42,6 +43,7 @@ class Gem::Licenses
42
43
  Abstyles
43
44
  AdaCore-doc
44
45
  Adobe-2006
46
+ Adobe-Display-PostScript
45
47
  Adobe-Glyph
46
48
  Adobe-Utopia
47
49
  Afmparse
@@ -57,6 +59,7 @@ class Gem::Licenses
57
59
  Artistic-2.0
58
60
  BSD-1-Clause
59
61
  BSD-2-Clause
62
+ BSD-2-Clause-Darwin
60
63
  BSD-2-Clause-Patent
61
64
  BSD-2-Clause-Views
62
65
  BSD-3-Clause
@@ -71,6 +74,7 @@ class Gem::Licenses
71
74
  BSD-3-Clause-No-Nuclear-Warranty
72
75
  BSD-3-Clause-Open-MPI
73
76
  BSD-3-Clause-Sun
77
+ BSD-3-Clause-acpica
74
78
  BSD-3-Clause-flex
75
79
  BSD-4-Clause
76
80
  BSD-4-Clause-Shortened
@@ -82,7 +86,9 @@ class Gem::Licenses
82
86
  BSD-Inferno-Nettverk
83
87
  BSD-Protection
84
88
  BSD-Source-Code
89
+ BSD-Source-beginning-file
85
90
  BSD-Systemics
91
+ BSD-Systemics-W3Works
86
92
  BSL-1.0
87
93
  BUSL-1.1
88
94
  Baekmuk
@@ -96,6 +102,7 @@ class Gem::Licenses
96
102
  BlueOak-1.0.0
97
103
  Boehm-GC
98
104
  Borceux
105
+ Brian-Gladman-2-Clause
99
106
  Brian-Gladman-3-Clause
100
107
  C-UDA-1.0
101
108
  CAL-1.0
@@ -107,6 +114,7 @@ class Gem::Licenses
107
114
  CC-BY-2.5-AU
108
115
  CC-BY-3.0
109
116
  CC-BY-3.0-AT
117
+ CC-BY-3.0-AU
110
118
  CC-BY-3.0-DE
111
119
  CC-BY-3.0-IGO
112
120
  CC-BY-3.0-NL
@@ -172,6 +180,7 @@ class Gem::Licenses
172
180
  CERN-OHL-W-2.0
173
181
  CFITSIO
174
182
  CMU-Mach
183
+ CMU-Mach-nodoc
175
184
  CNRI-Jython
176
185
  CNRI-Python
177
186
  CNRI-Python-GPL-Compatible
@@ -181,6 +190,7 @@ class Gem::Licenses
181
190
  CPOL-1.02
182
191
  CUA-OPL-1.0
183
192
  Caldera
193
+ Caldera-no-preamble
184
194
  ClArtistic
185
195
  Clips
186
196
  Community-Spec-1.0
@@ -191,10 +201,12 @@ class Gem::Licenses
191
201
  CrystalStacker
192
202
  Cube
193
203
  D-FSL-1.0
204
+ DEC-3-Clause
194
205
  DL-DE-BY-2.0
195
206
  DL-DE-ZERO-2.0
196
207
  DOC
197
208
  DRL-1.0
209
+ DRL-1.1
198
210
  DSDP
199
211
  Dotseqn
200
212
  ECL-1.0
@@ -215,6 +227,7 @@ class Gem::Licenses
215
227
  FBM
216
228
  FDK-AAC
217
229
  FSFAP
230
+ FSFAP-no-warranty-disclaimer
218
231
  FSFUL
219
232
  FSFULLR
220
233
  FSFULLRWD
@@ -225,6 +238,7 @@ class Gem::Licenses
225
238
  FreeBSD-DOC
226
239
  FreeImage
227
240
  Furuseth
241
+ GCR-docs
228
242
  GD
229
243
  GFDL-1.1-invariants-only
230
244
  GFDL-1.1-invariants-or-later
@@ -260,6 +274,10 @@ class Gem::Licenses
260
274
  HP-1989
261
275
  HPND
262
276
  HPND-DEC
277
+ HPND-Fenneberg-Livingston
278
+ HPND-INRIA-IMAG
279
+ HPND-Kevlin-Henney
280
+ HPND-MIT-disclaimer
263
281
  HPND-Markus-Kuhn
264
282
  HPND-Pbmplus
265
283
  HPND-UC
@@ -267,6 +285,7 @@ class Gem::Licenses
267
285
  HPND-doc-sell
268
286
  HPND-export-US
269
287
  HPND-export-US-modify
288
+ HPND-sell-MIT-disclaimer-xserver
270
289
  HPND-sell-regexpr
271
290
  HPND-sell-variant
272
291
  HPND-sell-variant-MIT-disclaimer
@@ -281,6 +300,7 @@ class Gem::Licenses
281
300
  IPA
282
301
  IPL-1.0
283
302
  ISC
303
+ ISC-Veillard
284
304
  ImageMagick
285
305
  Imlib2
286
306
  Info-ZIP
@@ -306,6 +326,7 @@ class Gem::Licenses
306
326
  LGPL-3.0-or-later
307
327
  LGPLLR
308
328
  LOOP
329
+ LPD-document
309
330
  LPL-1.0
310
331
  LPL-1.02
311
332
  LPPL-1.0
@@ -350,6 +371,8 @@ class Gem::Licenses
350
371
  MS-PL
351
372
  MS-RL
352
373
  MTLL
374
+ Mackerras-3-Clause
375
+ Mackerras-3-Clause-acknowledgment
353
376
  MakeIndex
354
377
  Martin-Birgmeier
355
378
  McPhee-slideshow
@@ -434,6 +457,8 @@ class Gem::Licenses
434
457
  OSL-3.0
435
458
  OpenPBS-2.3
436
459
  OpenSSL
460
+ OpenSSL-standalone
461
+ OpenVision
437
462
  PADL
438
463
  PDDL-1.0
439
464
  PHP-3.0
@@ -441,6 +466,7 @@ class Gem::Licenses
441
466
  PSF-2.0
442
467
  Parity-6.0.0
443
468
  Parity-7.0.0
469
+ Pixar
444
470
  Plexus
445
471
  PolyForm-Noncommercial-1.0.0
446
472
  PolyForm-Small-Business-1.0.0
@@ -459,6 +485,7 @@ class Gem::Licenses
459
485
  Rdisc
460
486
  Ruby
461
487
  SAX-PD
488
+ SAX-PD-2.0
462
489
  SCEA
463
490
  SGI-B-1.0
464
491
  SGI-B-1.1
@@ -476,6 +503,7 @@ class Gem::Licenses
476
503
  SPL-1.0
477
504
  SSH-OpenSSH
478
505
  SSH-short
506
+ SSLeay-standalone
479
507
  SSPL-1.0
480
508
  SWL
481
509
  Saxpath
@@ -489,11 +517,13 @@ class Gem::Licenses
489
517
  Spencer-94
490
518
  Spencer-99
491
519
  SugarCRM-1.1.3
520
+ Sun-PPP
492
521
  SunPro
493
522
  Symlinks
494
523
  TAPR-OHL-1.0
495
524
  TCL
496
525
  TCP-wrappers
526
+ TGPPL-1.0
497
527
  TMate
498
528
  TORQUE-1.1
499
529
  TOSL
@@ -506,8 +536,10 @@ class Gem::Licenses
506
536
  TermReadKey
507
537
  UCAR
508
538
  UCL-1.0
539
+ UMich-Merit
509
540
  UPL-1.0
510
541
  URT-RLE
542
+ Unicode-3.0
511
543
  Unicode-DFS-2015
512
544
  Unicode-DFS-2016
513
545
  Unicode-TOU
@@ -542,6 +574,7 @@ class Gem::Licenses
542
574
  Zimbra-1.3
543
575
  Zimbra-1.4
544
576
  Zlib
577
+ bcrypt-Solar-Designer
545
578
  blessing
546
579
  bzip2-1.0.6
547
580
  check-cvs
@@ -557,6 +590,8 @@ class Gem::Licenses
557
590
  fwlw
558
591
  gSOAP-1.3b
559
592
  gnuplot
593
+ gtkbook
594
+ hdparm
560
595
  iMatix
561
596
  libpng-2.0
562
597
  libselinux-1.0
@@ -564,6 +599,7 @@ class Gem::Licenses
564
599
  libutil-David-Nugent
565
600
  lsof
566
601
  magaz
602
+ mailprio
567
603
  metamail
568
604
  mpi-permissive
569
605
  mpich2
@@ -572,12 +608,15 @@ class Gem::Licenses
572
608
  psfrag
573
609
  psutils
574
610
  python-ldap
611
+ radvd
575
612
  snprintf
613
+ softSurfer
576
614
  ssh-keyscan
577
615
  swrule
578
616
  ulem
579
617
  w3m
580
618
  xinetd
619
+ xkeyboard-config-Zinoviev
581
620
  xlock
582
621
  xpp
583
622
  zlib-acknowledgement
@@ -626,6 +665,7 @@ class Gem::Licenses
626
665
  Autoconf-exception-generic
627
666
  Autoconf-exception-generic-3.0
628
667
  Autoconf-exception-macro
668
+ Bison-exception-1.24
629
669
  Bison-exception-2.2
630
670
  Bootloader-exception
631
671
  CLISP-exception-2.0
@@ -638,6 +678,7 @@ class Gem::Licenses
638
678
  GCC-exception-2.0-note
639
679
  GCC-exception-3.1
640
680
  GNAT-exception
681
+ GNOME-examples-exception
641
682
  GNU-compiler-exception
642
683
  GPL-3.0-interface-exception
643
684
  GPL-3.0-linking-exception
@@ -645,6 +686,7 @@ class Gem::Licenses
645
686
  GPL-CC-1.0
646
687
  GStreamer-exception-2005
647
688
  GStreamer-exception-2008
689
+ Gmsh-exception
648
690
  KiCad-libraries-exception
649
691
  LGPL-3.0-linking-exception
650
692
  LLGPL
@@ -671,6 +713,7 @@ class Gem::Licenses
671
713
  WxWindows-exception-3.1
672
714
  cryptsetup-OpenSSL-exception
673
715
  eCos-exception-2.0
716
+ fmt-exception
674
717
  freertos-exception-2.0
675
718
  gnu-javamail-exception
676
719
  i2p-gpl-java-exception
data/lib/rubygems/util.rb CHANGED
@@ -105,7 +105,7 @@ module Gem::Util
105
105
  end
106
106
 
107
107
  ##
108
- # Corrects +path+ (usually returned by `URI.parse().path` on Windows), that
108
+ # Corrects +path+ (usually returned by `Gem::URI.parse().path` on Windows), that
109
109
  # comes with a leading slash.
110
110
 
111
111
  def self.correct_for_windows_path(path)
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gem::Molinillo
4
+ # @!visibility private
5
+ module Delegates
6
+ # Delegates all {Gem::Molinillo::ResolutionState} methods to a `#state` property.
7
+ module ResolutionState
8
+ # (see Gem::Molinillo::ResolutionState#name)
9
+ def name
10
+ current_state = state || Gem::Molinillo::ResolutionState.empty
11
+ current_state.name
12
+ end
13
+
14
+ # (see Gem::Molinillo::ResolutionState#requirements)
15
+ def requirements
16
+ current_state = state || Gem::Molinillo::ResolutionState.empty
17
+ current_state.requirements
18
+ end
19
+
20
+ # (see Gem::Molinillo::ResolutionState#activated)
21
+ def activated
22
+ current_state = state || Gem::Molinillo::ResolutionState.empty
23
+ current_state.activated
24
+ end
25
+
26
+ # (see Gem::Molinillo::ResolutionState#requirement)
27
+ def requirement
28
+ current_state = state || Gem::Molinillo::ResolutionState.empty
29
+ current_state.requirement
30
+ end
31
+
32
+ # (see Gem::Molinillo::ResolutionState#possibilities)
33
+ def possibilities
34
+ current_state = state || Gem::Molinillo::ResolutionState.empty
35
+ current_state.possibilities
36
+ end
37
+
38
+ # (see Gem::Molinillo::ResolutionState#depth)
39
+ def depth
40
+ current_state = state || Gem::Molinillo::ResolutionState.empty
41
+ current_state.depth
42
+ end
43
+
44
+ # (see Gem::Molinillo::ResolutionState#conflicts)
45
+ def conflicts
46
+ current_state = state || Gem::Molinillo::ResolutionState.empty
47
+ current_state.conflicts
48
+ end
49
+
50
+ # (see Gem::Molinillo::ResolutionState#unused_unwind_options)
51
+ def unused_unwind_options
52
+ current_state = state || Gem::Molinillo::ResolutionState.empty
53
+ current_state.unused_unwind_options
54
+ end
55
+ end
56
+ end
57
+ end