rubygems-update 3.2.24 → 3.2.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -0
  3. data/Manifest.txt +7 -7
  4. data/bundler/CHANGELOG.md +62 -0
  5. data/bundler/lib/bundler/build_metadata.rb +2 -2
  6. data/bundler/lib/bundler/cli/cache.rb +1 -1
  7. data/bundler/lib/bundler/cli/doctor.rb +1 -1
  8. data/bundler/lib/bundler/cli/exec.rb +1 -6
  9. data/bundler/lib/bundler/cli/gem.rb +3 -2
  10. data/bundler/lib/bundler/cli/install.rb +4 -17
  11. data/bundler/lib/bundler/cli/list.rb +7 -1
  12. data/bundler/lib/bundler/cli/open.rb +1 -2
  13. data/bundler/lib/bundler/cli/remove.rb +1 -2
  14. data/bundler/lib/bundler/cli/update.rb +1 -1
  15. data/bundler/lib/bundler/cli.rb +12 -9
  16. data/bundler/lib/bundler/definition.rb +25 -29
  17. data/bundler/lib/bundler/dsl.rb +14 -1
  18. data/bundler/lib/bundler/errors.rb +1 -1
  19. data/bundler/lib/bundler/installer/gem_installer.rb +3 -16
  20. data/bundler/lib/bundler/installer/standalone.rb +13 -8
  21. data/bundler/lib/bundler/installer.rb +0 -1
  22. data/bundler/lib/bundler/lockfile_parser.rb +1 -0
  23. data/bundler/lib/bundler/plugin/installer.rb +2 -0
  24. data/bundler/lib/bundler/plugin.rb +23 -6
  25. data/bundler/lib/bundler/resolver.rb +10 -17
  26. data/bundler/lib/bundler/rubygems_gem_installer.rb +5 -1
  27. data/bundler/lib/bundler/rubygems_integration.rb +2 -0
  28. data/bundler/lib/bundler/runtime.rb +15 -6
  29. data/bundler/lib/bundler/settings.rb +13 -1
  30. data/bundler/lib/bundler/setup.rb +2 -2
  31. data/bundler/lib/bundler/shared_helpers.rb +0 -7
  32. data/bundler/lib/bundler/source/git/git_proxy.rb +1 -2
  33. data/bundler/lib/bundler/source/rubygems.rb +23 -2
  34. data/bundler/lib/bundler/source/rubygems_aggregate.rb +4 -0
  35. data/bundler/lib/bundler/source.rb +4 -0
  36. data/bundler/lib/bundler/source_list.rb +16 -3
  37. data/bundler/lib/bundler/spec_set.rb +13 -35
  38. data/bundler/lib/bundler/templates/Executable.bundler +6 -6
  39. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +13 -2
  40. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -2
  41. data/bundler/lib/bundler/version.rb +1 -1
  42. data/bundler/lib/bundler/worker.rb +17 -2
  43. data/bundler/lib/bundler.rb +11 -21
  44. data/lib/rubygems/command_manager.rb +3 -3
  45. data/lib/rubygems/commands/build_command.rb +3 -3
  46. data/lib/rubygems/commands/cert_command.rb +2 -2
  47. data/lib/rubygems/commands/check_command.rb +4 -4
  48. data/lib/rubygems/commands/cleanup_command.rb +3 -3
  49. data/lib/rubygems/commands/contents_command.rb +2 -2
  50. data/lib/rubygems/commands/dependency_command.rb +3 -3
  51. data/lib/rubygems/commands/environment_command.rb +1 -1
  52. data/lib/rubygems/commands/fetch_command.rb +3 -3
  53. data/lib/rubygems/commands/generate_index_command.rb +2 -2
  54. data/lib/rubygems/commands/help_command.rb +1 -1
  55. data/lib/rubygems/commands/info_command.rb +2 -2
  56. data/lib/rubygems/commands/install_command.rb +12 -11
  57. data/lib/rubygems/commands/list_command.rb +2 -2
  58. data/lib/rubygems/commands/lock_command.rb +1 -1
  59. data/lib/rubygems/commands/mirror_command.rb +1 -1
  60. data/lib/rubygems/commands/open_command.rb +2 -2
  61. data/lib/rubygems/commands/outdated_command.rb +4 -4
  62. data/lib/rubygems/commands/owner_command.rb +4 -4
  63. data/lib/rubygems/commands/pristine_command.rb +5 -5
  64. data/lib/rubygems/commands/push_command.rb +4 -4
  65. data/lib/rubygems/commands/query_command.rb +3 -3
  66. data/lib/rubygems/commands/rdoc_command.rb +3 -3
  67. data/lib/rubygems/commands/search_command.rb +2 -2
  68. data/lib/rubygems/commands/server_command.rb +3 -3
  69. data/lib/rubygems/commands/setup_command.rb +5 -5
  70. data/lib/rubygems/commands/signin_command.rb +2 -2
  71. data/lib/rubygems/commands/signout_command.rb +1 -1
  72. data/lib/rubygems/commands/sources_command.rb +4 -4
  73. data/lib/rubygems/commands/specification_command.rb +4 -4
  74. data/lib/rubygems/commands/stale_command.rb +1 -1
  75. data/lib/rubygems/commands/uninstall_command.rb +3 -3
  76. data/lib/rubygems/commands/unpack_command.rb +5 -5
  77. data/lib/rubygems/commands/update_command.rb +9 -9
  78. data/lib/rubygems/commands/which_command.rb +1 -1
  79. data/lib/rubygems/commands/yank_command.rb +4 -4
  80. data/lib/rubygems/config_file.rb +5 -5
  81. data/lib/rubygems/dependency_installer.rb +8 -8
  82. data/lib/rubygems/dependency_list.rb +1 -1
  83. data/lib/rubygems/doctor.rb +2 -2
  84. data/lib/rubygems/exceptions.rb +1 -1
  85. data/lib/rubygems/ext/builder.rb +1 -0
  86. data/lib/rubygems/ext/ext_conf_builder.rb +1 -2
  87. data/lib/rubygems/ext/rake_builder.rb +1 -2
  88. data/lib/rubygems/gem_runner.rb +3 -3
  89. data/lib/rubygems/gemcutter_utilities.rb +2 -2
  90. data/lib/rubygems/indexer.rb +2 -2
  91. data/lib/rubygems/install_default_message.rb +2 -2
  92. data/lib/rubygems/install_message.rb +2 -2
  93. data/lib/rubygems/install_update_options.rb +2 -2
  94. data/lib/rubygems/installer.rb +17 -8
  95. data/lib/rubygems/local_remote_options.rb +1 -1
  96. data/lib/rubygems/mock_gem_ui.rb +1 -1
  97. data/lib/rubygems/package/tar_reader.rb +1 -1
  98. data/lib/rubygems/package.rb +12 -12
  99. data/lib/rubygems/package_task.rb +2 -2
  100. data/lib/rubygems/platform.rb +2 -1
  101. data/lib/rubygems/rdoc.rb +1 -1
  102. data/lib/rubygems/remote_fetcher.rb +14 -21
  103. data/lib/rubygems/request.rb +5 -5
  104. data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
  105. data/lib/rubygems/request_set/lockfile.rb +1 -1
  106. data/lib/rubygems/request_set.rb +4 -4
  107. data/lib/rubygems/requirement.rb +3 -22
  108. data/lib/rubygems/resolver/git_specification.rb +1 -1
  109. data/lib/rubygems/resolver/installer_set.rb +3 -3
  110. data/lib/rubygems/resolver/molinillo.rb +1 -1
  111. data/lib/rubygems/resolver/set.rb +0 -1
  112. data/lib/rubygems/resolver/specification.rb +1 -1
  113. data/lib/rubygems/resolver.rb +31 -31
  114. data/lib/rubygems/s3_uri_signer.rb +0 -1
  115. data/lib/rubygems/safe_yaml.rb +0 -2
  116. data/lib/rubygems/security/policy.rb +1 -1
  117. data/lib/rubygems/security/signer.rb +1 -1
  118. data/lib/rubygems/security.rb +5 -5
  119. data/lib/rubygems/security_option.rb +2 -2
  120. data/lib/rubygems/server.rb +2 -2
  121. data/lib/rubygems/source.rb +6 -6
  122. data/lib/rubygems/spec_fetcher.rb +5 -5
  123. data/lib/rubygems/specification.rb +9 -15
  124. data/lib/rubygems/specification_policy.rb +2 -2
  125. data/lib/rubygems/uninstaller.rb +6 -6
  126. data/lib/rubygems/uri.rb +111 -0
  127. data/lib/rubygems/user_interaction.rb +2 -2
  128. data/lib/rubygems/util/licenses.rb +1 -1
  129. data/lib/rubygems/validator.rb +2 -2
  130. data/lib/rubygems/version_option.rb +1 -1
  131. data/lib/rubygems.rb +37 -47
  132. data/rubygems-update.gemspec +1 -1
  133. data/test/rubygems/data/null-type.gemspec.rz +0 -0
  134. data/{lib/rubygems/test_case.rb → test/rubygems/helper.rb} +16 -19
  135. data/{lib → test}/rubygems/installer_test_case.rb +1 -1
  136. data/{lib → test}/rubygems/package/tar_test_case.rb +1 -1
  137. data/test/rubygems/test_bundled_ca.rb +1 -1
  138. data/test/rubygems/test_config.rb +1 -1
  139. data/test/rubygems/test_deprecate.rb +1 -1
  140. data/test/rubygems/test_gem.rb +190 -136
  141. data/test/rubygems/test_gem_available_set.rb +1 -1
  142. data/test/rubygems/test_gem_bundler_version_finder.rb +1 -1
  143. data/test/rubygems/test_gem_command.rb +1 -1
  144. data/test/rubygems/test_gem_command_manager.rb +1 -1
  145. data/test/rubygems/test_gem_commands_build_command.rb +1 -1
  146. data/test/rubygems/test_gem_commands_cert_command.rb +1 -1
  147. data/test/rubygems/test_gem_commands_check_command.rb +1 -1
  148. data/test/rubygems/test_gem_commands_cleanup_command.rb +1 -1
  149. data/test/rubygems/test_gem_commands_contents_command.rb +1 -1
  150. data/test/rubygems/test_gem_commands_dependency_command.rb +1 -1
  151. data/test/rubygems/test_gem_commands_environment_command.rb +1 -1
  152. data/test/rubygems/test_gem_commands_fetch_command.rb +1 -1
  153. data/test/rubygems/test_gem_commands_generate_index_command.rb +1 -1
  154. data/test/rubygems/test_gem_commands_help_command.rb +1 -1
  155. data/test/rubygems/test_gem_commands_info_command.rb +1 -1
  156. data/test/rubygems/test_gem_commands_install_command.rb +26 -1
  157. data/test/rubygems/test_gem_commands_list_command.rb +1 -1
  158. data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
  159. data/test/rubygems/test_gem_commands_mirror.rb +1 -1
  160. data/test/rubygems/test_gem_commands_open_command.rb +1 -1
  161. data/test/rubygems/test_gem_commands_outdated_command.rb +1 -1
  162. data/test/rubygems/test_gem_commands_owner_command.rb +1 -1
  163. data/test/rubygems/test_gem_commands_pristine_command.rb +1 -1
  164. data/test/rubygems/test_gem_commands_push_command.rb +1 -1
  165. data/test/rubygems/test_gem_commands_query_command.rb +1 -1
  166. data/test/rubygems/test_gem_commands_search_command.rb +1 -1
  167. data/test/rubygems/test_gem_commands_server_command.rb +1 -1
  168. data/test/rubygems/test_gem_commands_setup_command.rb +3 -3
  169. data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
  170. data/test/rubygems/test_gem_commands_signout_command.rb +1 -1
  171. data/test/rubygems/test_gem_commands_sources_command.rb +1 -1
  172. data/test/rubygems/test_gem_commands_specification_command.rb +1 -1
  173. data/test/rubygems/test_gem_commands_stale_command.rb +1 -1
  174. data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -1
  175. data/test/rubygems/test_gem_commands_unpack_command.rb +1 -1
  176. data/test/rubygems/test_gem_commands_update_command.rb +1 -1
  177. data/test/rubygems/test_gem_commands_which_command.rb +1 -1
  178. data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
  179. data/test/rubygems/test_gem_config_file.rb +1 -1
  180. data/test/rubygems/test_gem_dependency.rb +1 -1
  181. data/test/rubygems/test_gem_dependency_installer.rb +1 -1
  182. data/test/rubygems/test_gem_dependency_list.rb +1 -1
  183. data/test/rubygems/test_gem_dependency_resolution_error.rb +1 -1
  184. data/test/rubygems/test_gem_doctor.rb +1 -1
  185. data/test/rubygems/test_gem_ext_builder.rb +4 -1
  186. data/test/rubygems/test_gem_ext_cmake_builder.rb +1 -1
  187. data/test/rubygems/test_gem_ext_configure_builder.rb +1 -1
  188. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +1 -1
  189. data/test/rubygems/test_gem_ext_rake_builder.rb +1 -1
  190. data/test/rubygems/test_gem_gem_runner.rb +1 -1
  191. data/test/rubygems/test_gem_gemcutter_utilities.rb +1 -1
  192. data/test/rubygems/test_gem_impossible_dependencies_error.rb +1 -1
  193. data/test/rubygems/test_gem_indexer.rb +1 -1
  194. data/test/rubygems/test_gem_install_update_options.rb +1 -1
  195. data/test/rubygems/test_gem_installer.rb +4 -2
  196. data/test/rubygems/test_gem_local_remote_options.rb +1 -1
  197. data/test/rubygems/test_gem_name_tuple.rb +1 -1
  198. data/test/rubygems/test_gem_package.rb +1 -1
  199. data/test/rubygems/test_gem_package_old.rb +1 -1
  200. data/test/rubygems/test_gem_package_tar_header.rb +1 -1
  201. data/test/rubygems/test_gem_package_tar_reader.rb +1 -1
  202. data/test/rubygems/test_gem_package_tar_reader_entry.rb +1 -1
  203. data/test/rubygems/test_gem_package_tar_writer.rb +1 -1
  204. data/test/rubygems/test_gem_package_task.rb +1 -1
  205. data/test/rubygems/test_gem_path_support.rb +1 -1
  206. data/test/rubygems/test_gem_platform.rb +2 -1
  207. data/test/rubygems/test_gem_rdoc.rb +1 -1
  208. data/test/rubygems/test_gem_remote_fetcher.rb +31 -1
  209. data/test/rubygems/test_gem_request.rb +36 -10
  210. data/test/rubygems/test_gem_request_connection_pools.rb +1 -1
  211. data/test/rubygems/test_gem_request_set.rb +1 -1
  212. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +1 -1
  213. data/test/rubygems/test_gem_request_set_lockfile.rb +1 -1
  214. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +1 -1
  215. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +1 -1
  216. data/test/rubygems/test_gem_requirement.rb +35 -1
  217. data/test/rubygems/test_gem_resolver.rb +1 -1
  218. data/test/rubygems/test_gem_resolver_activation_request.rb +1 -1
  219. data/test/rubygems/test_gem_resolver_api_set.rb +1 -1
  220. data/test/rubygems/test_gem_resolver_api_specification.rb +1 -1
  221. data/test/rubygems/test_gem_resolver_best_set.rb +1 -1
  222. data/test/rubygems/test_gem_resolver_composed_set.rb +1 -1
  223. data/test/rubygems/test_gem_resolver_conflict.rb +1 -1
  224. data/test/rubygems/test_gem_resolver_dependency_request.rb +1 -1
  225. data/test/rubygems/test_gem_resolver_git_set.rb +1 -1
  226. data/test/rubygems/test_gem_resolver_git_specification.rb +2 -1
  227. data/test/rubygems/test_gem_resolver_index_set.rb +1 -1
  228. data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
  229. data/test/rubygems/test_gem_resolver_installed_specification.rb +1 -1
  230. data/test/rubygems/test_gem_resolver_installer_set.rb +19 -1
  231. data/test/rubygems/test_gem_resolver_local_specification.rb +1 -1
  232. data/test/rubygems/test_gem_resolver_lock_set.rb +1 -1
  233. data/test/rubygems/test_gem_resolver_lock_specification.rb +1 -1
  234. data/test/rubygems/test_gem_resolver_requirement_list.rb +1 -1
  235. data/test/rubygems/test_gem_resolver_specification.rb +1 -1
  236. data/test/rubygems/test_gem_resolver_vendor_set.rb +1 -1
  237. data/test/rubygems/test_gem_resolver_vendor_specification.rb +1 -1
  238. data/test/rubygems/test_gem_security.rb +1 -1
  239. data/test/rubygems/test_gem_security_policy.rb +1 -1
  240. data/test/rubygems/test_gem_security_signer.rb +1 -1
  241. data/test/rubygems/test_gem_security_trust_dir.rb +1 -1
  242. data/test/rubygems/test_gem_server.rb +1 -1
  243. data/test/rubygems/test_gem_silent_ui.rb +1 -1
  244. data/test/rubygems/test_gem_source.rb +1 -1
  245. data/test/rubygems/test_gem_source_fetch_problem.rb +1 -1
  246. data/test/rubygems/test_gem_source_git.rb +1 -1
  247. data/test/rubygems/test_gem_source_installed.rb +1 -1
  248. data/test/rubygems/test_gem_source_list.rb +1 -1
  249. data/test/rubygems/test_gem_source_local.rb +1 -1
  250. data/test/rubygems/test_gem_source_lock.rb +1 -1
  251. data/test/rubygems/test_gem_source_specific_file.rb +1 -1
  252. data/test/rubygems/test_gem_source_subpath_problem.rb +1 -1
  253. data/test/rubygems/test_gem_source_vendor.rb +1 -1
  254. data/test/rubygems/test_gem_spec_fetcher.rb +1 -1
  255. data/test/rubygems/test_gem_specification.rb +15 -165
  256. data/test/rubygems/test_gem_stream_ui.rb +1 -1
  257. data/test/rubygems/test_gem_stub_specification.rb +1 -1
  258. data/test/rubygems/test_gem_text.rb +1 -1
  259. data/test/rubygems/test_gem_uninstaller.rb +1 -1
  260. data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +1 -1
  261. data/test/rubygems/test_gem_uri.rb +39 -0
  262. data/test/rubygems/test_gem_uri_formatter.rb +1 -1
  263. data/test/rubygems/test_gem_util.rb +1 -1
  264. data/test/rubygems/test_gem_validator.rb +1 -1
  265. data/test/rubygems/test_gem_version.rb +1 -1
  266. data/test/rubygems/test_gem_version_option.rb +1 -1
  267. data/test/rubygems/test_kernel.rb +1 -1
  268. data/test/rubygems/test_project_sanity.rb +1 -1
  269. data/test/rubygems/test_remote_fetch_error.rb +1 -1
  270. data/test/rubygems/test_require.rb +1 -1
  271. data/test/rubygems/test_rubygems.rb +44 -0
  272. data/{lib/rubygems/test_utilities.rb → test/rubygems/utilities.rb} +0 -2
  273. metadata +10 -10
  274. data/lib/rubygems/syck_hack.rb +0 -77
  275. data/lib/rubygems/uri_parser.rb +0 -34
  276. data/lib/rubygems/uri_parsing.rb +0 -23
@@ -17,8 +17,6 @@ module Gem
17
17
  Gem::Specification
18
18
  Gem::Version
19
19
  Gem::Version::Requirement
20
- YAML::Syck::DefaultKey
21
- Syck::DefaultKey
22
20
  ].freeze
23
21
 
24
22
  PERMITTED_SYMBOLS = %w[
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'rubygems/user_interaction'
2
+ require_relative '../user_interaction'
3
3
 
4
4
  ##
5
5
  # A Gem::Security::Policy object encapsulates the settings for verifying
@@ -2,7 +2,7 @@
2
2
  ##
3
3
  # Basic OpenSSL-based package signing class.
4
4
 
5
- require "rubygems/user_interaction"
5
+ require_relative "../user_interaction"
6
6
 
7
7
  class Gem::Security::Signer
8
8
  include Gem::UserInteraction
@@ -5,7 +5,7 @@
5
5
  # See LICENSE.txt for permissions.
6
6
  #++
7
7
 
8
- require 'rubygems/exceptions'
8
+ require_relative 'exceptions'
9
9
  require_relative 'openssl'
10
10
 
11
11
  ##
@@ -592,9 +592,9 @@ module Gem::Security
592
592
  end
593
593
 
594
594
  if Gem::HAVE_OPENSSL
595
- require 'rubygems/security/policy'
596
- require 'rubygems/security/policies'
597
- require 'rubygems/security/trust_dir'
595
+ require_relative 'security/policy'
596
+ require_relative 'security/policies'
597
+ require_relative 'security/trust_dir'
598
598
  end
599
599
 
600
- require 'rubygems/security/signer'
600
+ require_relative 'security/signer'
@@ -5,7 +5,7 @@
5
5
  # See LICENSE.txt for permissions.
6
6
  #++
7
7
 
8
- require 'rubygems'
8
+ require_relative '../rubygems'
9
9
 
10
10
  # forward-declare
11
11
 
@@ -20,7 +20,7 @@ end
20
20
  module Gem::SecurityOption
21
21
  def add_security_option
22
22
  OptionParser.accept Gem::Security::Policy do |value|
23
- require 'rubygems/security'
23
+ require_relative 'security'
24
24
 
25
25
  raise OptionParser::InvalidArgument, 'OpenSSL not installed' unless
26
26
  defined?(Gem::Security::HighSecurity)
@@ -3,8 +3,8 @@ require 'zlib'
3
3
  require 'erb'
4
4
  require 'uri'
5
5
 
6
- require 'rubygems'
7
- require 'rubygems/rdoc'
6
+ require_relative '../rubygems'
7
+ require_relative 'rdoc'
8
8
 
9
9
  ##
10
10
  # Gem::Server and allows users to serve gems for consumption by
@@ -238,9 +238,9 @@ class Gem::Source
238
238
  end
239
239
  end
240
240
 
241
- require 'rubygems/source/git'
242
- require 'rubygems/source/installed'
243
- require 'rubygems/source/specific_file'
244
- require 'rubygems/source/local'
245
- require 'rubygems/source/lock'
246
- require 'rubygems/source/vendor'
241
+ require_relative 'source/git'
242
+ require_relative 'source/installed'
243
+ require_relative 'source/specific_file'
244
+ require_relative 'source/local'
245
+ require_relative 'source/lock'
246
+ require_relative 'source/vendor'
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
- require 'rubygems/remote_fetcher'
3
- require 'rubygems/user_interaction'
4
- require 'rubygems/errors'
5
- require 'rubygems/text'
6
- require 'rubygems/name_tuple'
2
+ require_relative 'remote_fetcher'
3
+ require_relative 'user_interaction'
4
+ require_relative 'errors'
5
+ require_relative 'text'
6
+ require_relative 'name_tuple'
7
7
 
8
8
  ##
9
9
  # SpecFetcher handles metadata updates from remote gem repositories.
@@ -6,11 +6,11 @@
6
6
  # See LICENSE.txt for permissions.
7
7
  #++
8
8
 
9
- require 'rubygems/deprecate'
10
- require 'rubygems/basic_specification'
11
- require 'rubygems/stub_specification'
12
- require 'rubygems/specification_policy'
13
- require 'rubygems/util/list'
9
+ require_relative 'deprecate'
10
+ require_relative 'basic_specification'
11
+ require_relative 'stub_specification'
12
+ require_relative 'specification_policy'
13
+ require_relative 'util/list'
14
14
 
15
15
  ##
16
16
  # The Specification class contains the information for a gem. Typically
@@ -1568,9 +1568,9 @@ class Gem::Specification < Gem::BasicSpecification
1568
1568
  unresolved_deps = Gem::Specification.unresolved_deps.dup
1569
1569
  Gem::Specification.unresolved_deps.clear
1570
1570
 
1571
- require 'rubygems/config_file'
1572
- require 'rubygems/ext'
1573
- require 'rubygems/user_interaction'
1571
+ require_relative 'config_file'
1572
+ require_relative 'ext'
1573
+ require_relative 'user_interaction'
1574
1574
 
1575
1575
  ui = Gem::SilentUI.new
1576
1576
  Gem::DefaultUserInteraction.use_ui ui do
@@ -1690,12 +1690,6 @@ class Gem::Specification < Gem::BasicSpecification
1690
1690
  when String then
1691
1691
  if DateTimeFormat =~ date
1692
1692
  Time.utc($1.to_i, $2.to_i, $3.to_i)
1693
-
1694
- # Workaround for where the date format output from psych isn't
1695
- # parsed as a Time object by syck and thus comes through as a
1696
- # string.
1697
- elsif /\A(\d{4})-(\d{2})-(\d{2}) \d{2}:\d{2}:\d{2}\.\d+?Z\z/ =~ date
1698
- Time.utc($1.to_i, $2.to_i, $3.to_i)
1699
1693
  else
1700
1694
  raise(Gem::InvalidSpecificationException,
1701
1695
  "invalid date format in specification: #{date.inspect}")
@@ -2531,7 +2525,7 @@ class Gem::Specification < Gem::BasicSpecification
2531
2525
  # back, we have to check again here to make sure that our
2532
2526
  # psych code was properly loaded, and load it if not.
2533
2527
  unless Gem.const_defined?(:NoAliasYAMLTree)
2534
- require 'rubygems/psych_tree'
2528
+ require_relative 'psych_tree'
2535
2529
  end
2536
2530
 
2537
2531
  builder = Gem::NoAliasYAMLTree.create
@@ -1,4 +1,4 @@
1
- require 'rubygems/user_interaction'
1
+ require_relative 'user_interaction'
2
2
 
3
3
  class Gem::SpecificationPolicy
4
4
  include Gem::UserInteraction
@@ -381,7 +381,7 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
381
381
  end
382
382
 
383
383
  LAZY = '"FIxxxXME" or "TOxxxDO"'.gsub(/xxx/, '')
384
- LAZY_PATTERN = /FI XME|TO DO/x.freeze
384
+ LAZY_PATTERN = /^FI XME|^TO DO/x.freeze
385
385
  HOMEPAGE_URI_PATTERN = /\A[a-z][a-z\d+.-]*:/i.freeze
386
386
 
387
387
  def validate_lazy_metadata
@@ -6,11 +6,11 @@
6
6
  #++
7
7
 
8
8
  require 'fileutils'
9
- require 'rubygems'
10
- require 'rubygems/installer_uninstaller_utils'
11
- require 'rubygems/dependency_list'
12
- require 'rubygems/rdoc'
13
- require 'rubygems/user_interaction'
9
+ require_relative '../rubygems'
10
+ require_relative 'installer_uninstaller_utils'
11
+ require_relative 'dependency_list'
12
+ require_relative 'rdoc'
13
+ require_relative 'user_interaction'
14
14
 
15
15
  ##
16
16
  # An Uninstaller.
@@ -357,7 +357,7 @@ class Gem::Uninstaller
357
357
  # of what it did for us to find rather than trying to recreate
358
358
  # it again.
359
359
  if @format_executable
360
- require 'rubygems/installer'
360
+ require_relative 'installer'
361
361
  Gem::Installer.exec_format % File.basename(filename)
362
362
  else
363
363
  filename
@@ -0,0 +1,111 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ # The Uri handles rubygems source URIs.
5
+ #
6
+
7
+ class Gem::Uri
8
+ def initialize(source_uri)
9
+ @parsed_uri = parse(source_uri)
10
+ end
11
+
12
+ def redacted
13
+ return self unless valid_uri?
14
+
15
+ if token? || oauth_basic?
16
+ with_redacted_user
17
+ elsif password?
18
+ with_redacted_password
19
+ else
20
+ self
21
+ end
22
+ end
23
+
24
+ def to_s
25
+ @parsed_uri.to_s
26
+ end
27
+
28
+ def redact_credentials_from(text)
29
+ return text unless valid_uri? && password?
30
+
31
+ text.sub(password, 'REDACTED')
32
+ end
33
+
34
+ def method_missing(method_name, *args, &blk)
35
+ if @parsed_uri.respond_to?(method_name)
36
+ @parsed_uri.send(method_name, *args, &blk)
37
+ else
38
+ super
39
+ end
40
+ end
41
+
42
+ def respond_to_missing?(method_name, include_private = false)
43
+ @parsed_uri.respond_to?(method_name, include_private) || super
44
+ end
45
+
46
+ protected
47
+
48
+ # Add a protected reader for the cloned instance to access the original object's parsed uri
49
+ attr_reader :parsed_uri
50
+
51
+ private
52
+
53
+ ##
54
+ # Parses the #uri, raising if it's invalid
55
+
56
+ def parse!(uri)
57
+ require "uri"
58
+
59
+ raise URI::InvalidURIError unless uri
60
+
61
+ # Always escape URI's to deal with potential spaces and such
62
+ # It should also be considered that source_uri may already be
63
+ # a valid URI with escaped characters. e.g. "{DESede}" is encoded
64
+ # as "%7BDESede%7D". If this is escaped again the percentage
65
+ # symbols will be escaped.
66
+ begin
67
+ URI.parse(uri)
68
+ rescue URI::InvalidURIError
69
+ URI.parse(URI::DEFAULT_PARSER.escape(uri))
70
+ end
71
+ end
72
+
73
+ ##
74
+ # Parses the #uri, returning the original uri if it's invalid
75
+
76
+ def parse(uri)
77
+ return uri unless uri.is_a?(String)
78
+
79
+ parse!(uri)
80
+ rescue URI::InvalidURIError
81
+ uri
82
+ end
83
+
84
+ def with_redacted_user
85
+ clone.tap {|uri| uri.user = 'REDACTED' }
86
+ end
87
+
88
+ def with_redacted_password
89
+ clone.tap {|uri| uri.password = 'REDACTED' }
90
+ end
91
+
92
+ def valid_uri?
93
+ !@parsed_uri.is_a?(String)
94
+ end
95
+
96
+ def password?
97
+ !!password
98
+ end
99
+
100
+ def oauth_basic?
101
+ password == 'x-oauth-basic'
102
+ end
103
+
104
+ def token?
105
+ !user.nil? && password.nil?
106
+ end
107
+
108
+ def initialize_copy(original)
109
+ @parsed_uri = original.parsed_uri.clone
110
+ end
111
+ end
@@ -5,8 +5,8 @@
5
5
  # See LICENSE.txt for permissions.
6
6
  #++
7
7
 
8
- require 'rubygems/deprecate'
9
- require 'rubygems/text'
8
+ require_relative 'deprecate'
9
+ require_relative 'text'
10
10
 
11
11
  ##
12
12
  # Module that defines the default UserInteraction. Any class including this
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'rubygems/text'
2
+ require_relative '../text'
3
3
 
4
4
  class Gem::Licenses
5
5
  extend Gem::Text
@@ -5,8 +5,8 @@
5
5
  # See LICENSE.txt for permissions.
6
6
  #++
7
7
 
8
- require 'rubygems/package'
9
- require 'rubygems/installer'
8
+ require_relative 'package'
9
+ require_relative 'installer'
10
10
 
11
11
  ##
12
12
  # Validator performs various gem file and gem database validation
@@ -5,7 +5,7 @@
5
5
  # See LICENSE.txt for permissions.
6
6
  #++
7
7
 
8
- require 'rubygems'
8
+ require_relative '../rubygems'
9
9
 
10
10
  ##
11
11
  # Mixin methods for --version and --platform Gem::Command options.
data/lib/rubygems.rb CHANGED
@@ -8,15 +8,15 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = "3.2.24".freeze
11
+ VERSION = "3.2.28".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
15
- require 'rubygems/compatibility'
15
+ require_relative 'rubygems/compatibility'
16
16
 
17
- require 'rubygems/defaults'
18
- require 'rubygems/deprecate'
19
- require 'rubygems/errors'
17
+ require_relative 'rubygems/defaults'
18
+ require_relative 'rubygems/deprecate'
19
+ require_relative 'rubygems/errors'
20
20
 
21
21
  ##
22
22
  # RubyGems is the Ruby standard for publishing and managing third party
@@ -249,9 +249,6 @@ module Gem
249
249
  # you to specify specific gem versions.
250
250
 
251
251
  def self.bin_path(name, exec_name = nil, *requirements)
252
- # TODO: fails test_self_bin_path_bin_file_gone_in_latest
253
- # Gem::Specification.find_by_name(name, *requirements).bin_file exec_name
254
-
255
252
  requirements = Gem::Requirement.default if
256
253
  requirements.empty?
257
254
 
@@ -562,7 +559,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
562
559
  # => [#<Gem::Specification:0x1013b4528 @name="minitest", ...>]
563
560
 
564
561
  def self.install(name, version = Gem::Requirement.default, *options)
565
- require "rubygems/dependency_installer"
562
+ require_relative "rubygems/dependency_installer"
566
563
  inst = Gem::DependencyInstaller.new(*options)
567
564
  inst.install name, version
568
565
  inst.installed_gems
@@ -628,22 +625,12 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
628
625
  rescue ::LoadError
629
626
  # If we can't load psych, that's fine, go on.
630
627
  else
631
- # If 'yaml' has already been required, then we have to
632
- # be sure to switch it over to the newly loaded psych.
633
- if defined?(YAML::ENGINE) && YAML::ENGINE.yamler != "psych"
634
- YAML::ENGINE.yamler = "psych"
635
- end
636
-
637
- require 'rubygems/psych_additions'
638
- require 'rubygems/psych_tree'
628
+ require_relative 'rubygems/psych_additions'
629
+ require_relative 'rubygems/psych_tree'
639
630
  end
640
631
 
641
632
  require 'yaml'
642
- require 'rubygems/safe_yaml'
643
-
644
- # Now that we're sure some kind of yaml library is loaded, pull
645
- # in our hack to deal with Syck's DefaultKey ugliness.
646
- require 'rubygems/syck_hack'
633
+ require_relative 'rubygems/safe_yaml'
647
634
 
648
635
  @yaml_loaded = true
649
636
  end
@@ -1003,7 +990,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1003
990
  # Lazily loads DefaultUserInteraction and returns the default UI.
1004
991
 
1005
992
  def self.ui
1006
- require 'rubygems/user_interaction'
993
+ require_relative 'rubygems/user_interaction'
1007
994
 
1008
995
  Gem::DefaultUserInteraction.ui
1009
996
  end
@@ -1063,7 +1050,9 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1063
1050
  # Find rubygems plugin files in the standard location and load them
1064
1051
 
1065
1052
  def self.load_plugins
1066
- load_plugin_files Gem::Util.glob_files_in_dir("*#{Gem.plugin_suffix_pattern}", plugindir)
1053
+ Gem.path.each do |gem_path|
1054
+ load_plugin_files Gem::Util.glob_files_in_dir("*#{Gem.plugin_suffix_pattern}", plugindir(gem_path))
1055
+ end
1067
1056
  end
1068
1057
 
1069
1058
  ##
@@ -1121,27 +1110,22 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1121
1110
  end
1122
1111
 
1123
1112
  ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path)
1124
- require 'rubygems/user_interaction'
1125
- Gem::DefaultUserInteraction.use_ui(ui) do
1126
- require "bundler"
1127
- begin
1128
- Bundler.ui.silence do
1129
- @gemdeps = Bundler.setup
1113
+ require_relative 'rubygems/user_interaction'
1114
+ require "bundler"
1115
+ begin
1116
+ Gem::DefaultUserInteraction.use_ui(ui) do
1117
+ begin
1118
+ Bundler.ui.silence do
1119
+ @gemdeps = Bundler.setup
1120
+ end
1121
+ ensure
1122
+ Gem::DefaultUserInteraction.ui.close
1130
1123
  end
1131
- ensure
1132
- Gem::DefaultUserInteraction.ui.close
1133
1124
  end
1134
- @gemdeps.requested_specs.map(&:to_spec).sort_by(&:name)
1135
- end
1136
-
1137
- rescue => e
1138
- case e
1139
- when Gem::LoadError, Gem::UnsatisfiableDependencyError, (defined?(Bundler::GemNotFound) ? Bundler::GemNotFound : Gem::LoadError)
1125
+ rescue Bundler::BundlerError => e
1140
1126
  warn e.message
1141
- warn "You may need to `gem install -g` to install missing gems"
1127
+ warn "You may need to `bundle install` to install missing gems"
1142
1128
  warn ""
1143
- else
1144
- raise
1145
1129
  end
1146
1130
  end
1147
1131
 
@@ -1338,7 +1322,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1338
1322
  autoload :Version, File.expand_path('rubygems/version', __dir__)
1339
1323
  end
1340
1324
 
1341
- require 'rubygems/exceptions'
1325
+ require_relative 'rubygems/exceptions'
1342
1326
 
1343
1327
  # REFACTOR: This should be pulled out into some kind of hacks file.
1344
1328
  begin
@@ -1347,6 +1331,14 @@ begin
1347
1331
 
1348
1332
  require 'rubygems/defaults/operating_system'
1349
1333
  rescue LoadError
1334
+ # Ignored
1335
+ rescue StandardError => e
1336
+ msg = "#{e.message}\n" \
1337
+ "Loading the rubygems/defaults/operating_system.rb file caused an error. " \
1338
+ "This file is owned by your OS, not by rubygems upstream. " \
1339
+ "Please find out which OS package this file belongs to and follow the guidelines from your OS to report " \
1340
+ "the problem and ask for help."
1341
+ raise e.class, msg
1350
1342
  end
1351
1343
 
1352
1344
  begin
@@ -1361,8 +1353,6 @@ end
1361
1353
  # Loads the default specs.
1362
1354
  Gem::Specification.load_defaults
1363
1355
 
1364
- require 'rubygems/core_ext/kernel_gem'
1365
- require 'rubygems/core_ext/kernel_require'
1366
- require 'rubygems/core_ext/kernel_warn'
1367
-
1368
- Gem.use_gemdeps
1356
+ require_relative 'rubygems/core_ext/kernel_gem'
1357
+ require_relative 'rubygems/core_ext/kernel_require'
1358
+ require_relative 'rubygems/core_ext/kernel_warn'
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.2.24"
5
+ s.version = "3.2.28"
6
6
  s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
7
7
  s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
8
8
 
@@ -52,32 +52,28 @@ require 'rubygems/mock_gem_ui'
52
52
  module Gem
53
53
 
54
54
  ##
55
- # Allows setting the gem path searcher. This method is available when
56
- # requiring 'rubygems/test_case'
55
+ # Allows setting the gem path searcher.
57
56
 
58
57
  def self.searcher=(searcher)
59
58
  @searcher = searcher
60
59
  end
61
60
 
62
61
  ##
63
- # Allows toggling Windows behavior. This method is available when requiring
64
- # 'rubygems/test_case'
62
+ # Allows toggling Windows behavior.
65
63
 
66
64
  def self.win_platform=(val)
67
65
  @@win_platform = val
68
66
  end
69
67
 
70
68
  ##
71
- # Allows setting path to Ruby. This method is available when requiring
72
- # 'rubygems/test_case'
69
+ # Allows setting path to Ruby.
73
70
 
74
71
  def self.ruby=(ruby)
75
72
  @ruby = ruby
76
73
  end
77
74
 
78
75
  ##
79
- # When rubygems/test_case is required the default user interaction is a
80
- # MockGemUi.
76
+ # Sets the default user interaction to a MockGemUi.
81
77
 
82
78
  module DefaultUserInteraction
83
79
  @ui = Gem::MockGemUi.new
@@ -88,8 +84,7 @@ require "rubygems/command"
88
84
 
89
85
  class Gem::Command
90
86
  ##
91
- # Allows resetting the hash of specific args per command. This method is
92
- # available when requiring 'rubygems/test_case'
87
+ # Allows resetting the hash of specific args per command.
93
88
 
94
89
  def self.specific_extra_args_hash=(value)
95
90
  @specific_extra_args_hash = value
@@ -111,8 +106,6 @@ class Gem::TestCase < Test::Unit::TestCase
111
106
 
112
107
  attr_accessor :uri # :nodoc:
113
108
 
114
- TEST_PATH = ENV.fetch('RUBYGEMS_TEST_PATH', File.expand_path('../../../test/rubygems', __FILE__))
115
-
116
109
  def assert_activate(expected, *specs)
117
110
  specs.each do |spec|
118
111
  case spec
@@ -1304,7 +1297,11 @@ Also, a list:
1304
1297
  end
1305
1298
 
1306
1299
  def ruby_with_rubygems_in_load_path
1307
- [Gem.ruby, "-I", File.expand_path("..", __dir__)]
1300
+ [Gem.ruby, "-I", rubygems_path]
1301
+ end
1302
+
1303
+ def rubygems_path
1304
+ $LOAD_PATH.find{|p| p == File.dirname($LOADED_FEATURES.find{|f| f.end_with?("/rubygems.rb") }) }
1308
1305
  end
1309
1306
 
1310
1307
  def with_clean_path_to_ruby
@@ -1335,8 +1332,8 @@ Also, a list:
1335
1332
  end
1336
1333
  end
1337
1334
 
1338
- @@good_rake = "#{rubybin} #{escape_path(TEST_PATH, 'good_rake.rb')}"
1339
- @@bad_rake = "#{rubybin} #{escape_path(TEST_PATH, 'bad_rake.rb')}"
1335
+ @@good_rake = "#{rubybin} #{escape_path(__dir__, 'good_rake.rb')}"
1336
+ @@bad_rake = "#{rubybin} #{escape_path(__dir__, 'bad_rake.rb')}"
1340
1337
 
1341
1338
  ##
1342
1339
  # Construct a new Gem::Dependency.
@@ -1523,12 +1520,12 @@ Also, a list:
1523
1520
 
1524
1521
  def self.cert_path(cert_name)
1525
1522
  if 32 == (Time.at(2**32) rescue 32)
1526
- cert_file = "#{TEST_PATH}/#{cert_name}_cert_32.pem"
1523
+ cert_file = "#{__dir__}/#{cert_name}_cert_32.pem"
1527
1524
 
1528
1525
  return cert_file if File.exist? cert_file
1529
1526
  end
1530
1527
 
1531
- "#{TEST_PATH}/#{cert_name}_cert.pem"
1528
+ "#{__dir__}/#{cert_name}_cert.pem"
1532
1529
  end
1533
1530
 
1534
1531
  ##
@@ -1546,7 +1543,7 @@ Also, a list:
1546
1543
  # Returns the path to the key named +key_name+ from <tt>test/rubygems</tt>
1547
1544
 
1548
1545
  def self.key_path(key_name)
1549
- "#{TEST_PATH}/#{key_name}_key.pem"
1546
+ "#{__dir__}/#{key_name}_key.pem"
1550
1547
  end
1551
1548
 
1552
1549
  # :stopdoc:
@@ -1607,4 +1604,4 @@ class Object
1607
1604
  end
1608
1605
  end
1609
1606
 
1610
- require 'rubygems/test_utilities'
1607
+ require_relative 'utilities'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'rubygems/test_case'
2
+ require_relative 'helper'
3
3
  require 'rubygems/installer'
4
4
 
5
5
  class Gem::Installer
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'rubygems/test_case'
2
+ require_relative '../helper'
3
3
  require 'rubygems/package'
4
4
 
5
5
  ##
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'rubygems/test_case'
2
+ require_relative 'helper'
3
3
  require 'net/http'
4
4
  require 'rubygems/openssl'
5
5
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'rubygems/test_case'
2
+ require_relative 'helper'
3
3
  require 'rubygems'
4
4
  require 'shellwords'
5
5