rubygems-update 3.3.25 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (273) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/CONTRIBUTING.md +24 -1
  4. data/Manifest.txt +30 -27
  5. data/POLICIES.md +10 -8
  6. data/README.md +2 -2
  7. data/bin/gem +1 -4
  8. data/bin/update_rubygems +1 -1
  9. data/bundler/CHANGELOG.md +58 -0
  10. data/bundler/README.md +2 -2
  11. data/bundler/bundler.gemspec +2 -2
  12. data/bundler/exe/bundle +1 -4
  13. data/bundler/lib/bundler/build_metadata.rb +2 -2
  14. data/bundler/lib/bundler/cli/add.rb +1 -1
  15. data/bundler/lib/bundler/cli/check.rb +1 -1
  16. data/bundler/lib/bundler/cli/common.rb +1 -0
  17. data/bundler/lib/bundler/cli/console.rb +2 -2
  18. data/bundler/lib/bundler/cli/doctor.rb +4 -6
  19. data/bundler/lib/bundler/cli/gem.rb +62 -40
  20. data/bundler/lib/bundler/cli/install.rb +2 -3
  21. data/bundler/lib/bundler/cli/lock.rb +8 -5
  22. data/bundler/lib/bundler/cli/outdated.rb +1 -3
  23. data/bundler/lib/bundler/cli/viz.rb +1 -1
  24. data/bundler/lib/bundler/cli.rb +44 -3
  25. data/bundler/lib/bundler/compact_index_client/cache.rb +1 -1
  26. data/bundler/lib/bundler/compact_index_client/updater.rb +40 -39
  27. data/bundler/lib/bundler/constants.rb +1 -1
  28. data/bundler/lib/bundler/definition.rb +61 -31
  29. data/bundler/lib/bundler/dependency.rb +12 -11
  30. data/bundler/lib/bundler/digest.rb +1 -1
  31. data/bundler/lib/bundler/dsl.rb +1 -1
  32. data/bundler/lib/bundler/env.rb +1 -1
  33. data/bundler/lib/bundler/environment_preserver.rb +1 -0
  34. data/bundler/lib/bundler/errors.rb +1 -11
  35. data/bundler/lib/bundler/fetcher/compact_index.rb +9 -11
  36. data/bundler/lib/bundler/fetcher/dependency.rb +1 -1
  37. data/bundler/lib/bundler/fetcher/downloader.rb +2 -5
  38. data/bundler/lib/bundler/fetcher.rb +2 -6
  39. data/bundler/lib/bundler/force_platform.rb +18 -0
  40. data/bundler/lib/bundler/friendly_errors.rb +0 -3
  41. data/bundler/lib/bundler/gem_version_promoter.rb +52 -86
  42. data/bundler/lib/bundler/graph.rb +3 -3
  43. data/bundler/lib/bundler/index.rb +5 -13
  44. data/bundler/lib/bundler/injector.rb +1 -1
  45. data/bundler/lib/bundler/inline.rb +2 -2
  46. data/bundler/lib/bundler/installer/parallel_installer.rb +0 -31
  47. data/bundler/lib/bundler/installer.rb +6 -16
  48. data/bundler/lib/bundler/lazy_specification.rb +5 -1
  49. data/bundler/lib/bundler/lockfile_parser.rb +5 -5
  50. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  54. data/bundler/lib/bundler/man/bundle-clean.1 +2 -2
  55. data/bundler/lib/bundler/man/bundle-clean.1.ronn +1 -1
  56. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  57. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  58. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  59. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  60. data/bundler/lib/bundler/man/bundle-gem.1 +27 -37
  61. data/bundler/lib/bundler/man/bundle-gem.1.ronn +5 -5
  62. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  63. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  64. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  65. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  66. data/bundler/lib/bundler/man/bundle-install.1 +1 -30
  67. data/bundler/lib/bundler/man/bundle-install.1.ronn +0 -29
  68. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  69. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  70. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  71. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  72. data/bundler/lib/bundler/man/bundle-platform.1 +2 -2
  73. data/bundler/lib/bundler/man/bundle-platform.1.ronn +1 -1
  74. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  75. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  76. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  77. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  78. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  79. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  80. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  81. data/bundler/lib/bundler/man/bundle.1 +1 -1
  82. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  83. data/bundler/lib/bundler/mirror.rb +5 -7
  84. data/bundler/lib/bundler/plugin/index.rb +4 -4
  85. data/bundler/lib/bundler/plugin/installer/rubygems.rb +0 -4
  86. data/bundler/lib/bundler/resolver/base.rb +7 -11
  87. data/bundler/lib/bundler/resolver/candidate.rb +92 -0
  88. data/bundler/lib/bundler/resolver/incompatibility.rb +15 -0
  89. data/bundler/lib/bundler/resolver/package.rb +63 -0
  90. data/bundler/lib/bundler/resolver/root.rb +25 -0
  91. data/bundler/lib/bundler/resolver/spec_group.rb +26 -36
  92. data/bundler/lib/bundler/resolver.rb +285 -277
  93. data/bundler/lib/bundler/rubygems_ext.rb +33 -6
  94. data/bundler/lib/bundler/rubygems_gem_installer.rb +4 -2
  95. data/bundler/lib/bundler/rubygems_integration.rb +1 -9
  96. data/bundler/lib/bundler/runtime.rb +1 -5
  97. data/bundler/lib/bundler/settings.rb +0 -6
  98. data/bundler/lib/bundler/shared_helpers.rb +1 -0
  99. data/bundler/lib/bundler/source/git/git_proxy.rb +190 -67
  100. data/bundler/lib/bundler/source/git.rb +15 -17
  101. data/bundler/lib/bundler/source/metadata.rb +0 -1
  102. data/bundler/lib/bundler/source/path/installer.rb +1 -22
  103. data/bundler/lib/bundler/source/path.rb +5 -5
  104. data/bundler/lib/bundler/source/rubygems.rb +13 -67
  105. data/bundler/lib/bundler/source_list.rb +8 -2
  106. data/bundler/lib/bundler/spec_set.rb +7 -9
  107. data/bundler/lib/bundler/templates/Executable +1 -1
  108. data/bundler/lib/bundler/templates/Executable.bundler +4 -9
  109. data/bundler/lib/bundler/templates/Executable.standalone +2 -0
  110. data/bundler/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
  111. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +3 -0
  112. data/bundler/lib/bundler/templates/newgem/README.md.tt +6 -4
  113. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +2 -1
  114. data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
  115. data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
  116. data/bundler/lib/bundler/templates/newgem/ext/newgem/{extconf.rb.tt → extconf-c.rb.tt} +0 -0
  117. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  118. data/bundler/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
  119. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +10 -0
  120. data/bundler/lib/bundler/templates/newgem/gitignore.tt +3 -0
  121. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +8 -0
  122. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -2
  123. data/bundler/lib/bundler/ui/shell.rb +35 -12
  124. data/bundler/lib/bundler/ui/silent.rb +21 -5
  125. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +3 -3
  126. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -1
  127. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +3 -1
  128. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -408
  129. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  130. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
  131. data/bundler/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  132. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  133. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
  134. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  135. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +151 -0
  136. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  137. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  138. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  139. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  140. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +53 -0
  141. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  142. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  143. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +124 -0
  144. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +409 -0
  145. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +240 -0
  146. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  147. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  148. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +1 -1
  149. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +64 -16
  150. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
  151. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -1
  152. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +27 -7
  153. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +40 -2
  154. data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +2 -1
  155. data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
  156. data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
  157. data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -2
  158. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +13 -7
  159. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +10 -5
  160. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  161. data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +1 -2
  162. data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +2 -1
  163. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +3 -2
  164. data/bundler/lib/bundler/vendored_persistent.rb +1 -33
  165. data/bundler/lib/bundler/{vendored_tmpdir.rb → vendored_pub_grub.rb} +1 -1
  166. data/bundler/lib/bundler/version.rb +5 -1
  167. data/bundler/lib/bundler/worker.rb +5 -7
  168. data/bundler/lib/bundler.rb +20 -64
  169. data/lib/rubygems/command_manager.rb +2 -2
  170. data/lib/rubygems/commands/fetch_command.rb +1 -1
  171. data/lib/rubygems/commands/install_command.rb +7 -3
  172. data/lib/rubygems/commands/rdoc_command.rb +3 -2
  173. data/lib/rubygems/commands/setup_command.rb +2 -2
  174. data/lib/rubygems/commands/unpack_command.rb +1 -1
  175. data/lib/rubygems/commands/update_command.rb +1 -7
  176. data/lib/rubygems/config_file.rb +33 -0
  177. data/lib/rubygems/core_ext/kernel_warn.rb +1 -2
  178. data/lib/rubygems/defaults.rb +15 -1
  179. data/lib/rubygems/dependency.rb +4 -1
  180. data/lib/rubygems/dependency_installer.rb +24 -24
  181. data/lib/rubygems/exceptions.rb +1 -3
  182. data/lib/rubygems/ext/builder.rb +3 -3
  183. data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +9 -5
  184. data/lib/rubygems/ext/cargo_builder.rb +18 -19
  185. data/lib/rubygems/ext/ext_conf_builder.rb +2 -0
  186. data/lib/rubygems/indexer.rb +1 -1
  187. data/lib/rubygems/installer.rb +5 -5
  188. data/lib/rubygems/optparse/lib/optparse.rb +20 -15
  189. data/lib/rubygems/package/tar_header.rb +11 -11
  190. data/lib/rubygems/platform.rb +0 -2
  191. data/lib/rubygems/request_set/gem_dependency_api.rb +104 -104
  192. data/lib/rubygems/requirement.rb +7 -7
  193. data/lib/rubygems/resolver/installer_set.rb +1 -1
  194. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +1 -1
  195. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +32 -26
  196. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  197. data/lib/rubygems/security/policies.rb +40 -40
  198. data/lib/rubygems/security/trust_dir.rb +1 -1
  199. data/lib/rubygems/security.rb +3 -16
  200. data/lib/rubygems/source.rb +2 -2
  201. data/lib/rubygems/specification.rb +37 -49
  202. data/lib/rubygems/specification_policy.rb +14 -0
  203. data/lib/rubygems/stub_specification.rb +2 -2
  204. data/lib/rubygems/text.rb +1 -1
  205. data/lib/rubygems/tsort/lib/tsort.rb +308 -310
  206. data/lib/rubygems/update_suggestion.rb +69 -0
  207. data/lib/rubygems/util.rb +1 -5
  208. data/lib/rubygems/validator.rb +1 -1
  209. data/lib/rubygems.rb +8 -3
  210. data/rubygems-update.gemspec +2 -2
  211. data/test/rubygems/helper.rb +7 -3
  212. data/test/rubygems/test_bundled_ca.rb +1 -1
  213. data/test/rubygems/test_exit.rb +6 -0
  214. data/test/rubygems/test_gem.rb +4 -9
  215. data/test/rubygems/test_gem_bundler_version_finder.rb +2 -1
  216. data/test/rubygems/test_gem_command_manager.rb +1 -1
  217. data/test/rubygems/test_gem_commands_install_command.rb +19 -0
  218. data/test/rubygems/test_gem_commands_setup_command.rb +1 -8
  219. data/test/rubygems/test_gem_commands_update_command.rb +6 -6
  220. data/test/rubygems/test_gem_config_file.rb +1 -1
  221. data/test/rubygems/test_gem_dependency.rb +2 -0
  222. data/test/rubygems/test_gem_ext_builder.rb +3 -3
  223. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +22 -32
  224. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
  225. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +22 -32
  226. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
  227. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +12 -0
  228. data/test/rubygems/test_gem_ext_cargo_builder.rb +22 -27
  229. data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +16 -16
  230. data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +0 -10
  231. data/test/rubygems/test_gem_indexer.rb +39 -20
  232. data/test/rubygems/test_gem_installer.rb +68 -2
  233. data/test/rubygems/test_gem_package_tar_header.rb +13 -13
  234. data/test/rubygems/test_gem_platform.rb +59 -60
  235. data/test/rubygems/test_gem_remote_fetcher.rb +4 -4
  236. data/test/rubygems/test_gem_request_set.rb +2 -2
  237. data/test/rubygems/test_gem_requirement.rb +1 -1
  238. data/test/rubygems/test_gem_resolver_api_set.rb +12 -12
  239. data/test/rubygems/test_gem_resolver_api_specification.rb +19 -19
  240. data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
  241. data/test/rubygems/test_gem_security_policy.rb +10 -10
  242. data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
  243. data/test/rubygems/test_gem_specification.rb +50 -37
  244. data/test/rubygems/test_gem_uninstaller.rb +1 -1
  245. data/test/rubygems/test_gem_update_suggestion.rb +208 -0
  246. data/test/rubygems/test_kernel.rb +10 -8
  247. data/test/rubygems/test_require.rb +70 -55
  248. metadata +34 -31
  249. data/bundler/lib/bundler/templates/newgem/travis.yml.tt +0 -6
  250. data/bundler/lib/bundler/vendor/molinillo/LICENSE +0 -9
  251. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  252. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
  253. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
  254. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
  255. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
  256. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
  257. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
  258. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
  259. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
  260. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
  261. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
  262. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
  263. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -149
  264. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  265. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
  266. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
  267. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
  268. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
  269. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
  270. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -11
  271. data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
  272. data/bundler/lib/bundler/vendored_molinillo.rb +0 -4
  273. data/bundler/lib/bundler/version_ranges.rb +0 -122
@@ -85,66 +85,65 @@ class TestGemPlatform < Gem::TestCase
85
85
 
86
86
  def test_initialize
87
87
  test_cases = {
88
- "amd64-freebsd6" => ["amd64", "freebsd", "6"],
89
- "hppa2.0w-hpux11.31" => ["hppa2.0w", "hpux", "11"],
90
- "java" => [nil, "java", nil],
91
- "jruby" => [nil, "java", nil],
92
- "universal-dotnet" => ["universal", "dotnet", nil],
93
- "universal-dotnet2.0" => ["universal", "dotnet", "2.0"],
94
- "universal-dotnet4.0" => ["universal", "dotnet", "4.0"],
95
- "powerpc-aix5.3.0.0" => ["powerpc", "aix", "5"],
96
- "powerpc-darwin7" => ["powerpc", "darwin", "7"],
97
- "powerpc-darwin8" => ["powerpc", "darwin", "8"],
98
- "powerpc-linux" => ["powerpc", "linux", nil],
99
- "powerpc64-linux" => ["powerpc64", "linux", nil],
100
- "sparc-solaris2.10" => ["sparc", "solaris", "2.10"],
101
- "sparc-solaris2.8" => ["sparc", "solaris", "2.8"],
102
- "sparc-solaris2.9" => ["sparc", "solaris", "2.9"],
103
- "universal-darwin8" => ["universal", "darwin", "8"],
104
- "universal-darwin9" => ["universal", "darwin", "9"],
105
- "universal-macruby" => ["universal", "macruby", nil],
106
- "i386-cygwin" => ["x86", "cygwin", nil],
107
- "i686-darwin" => ["x86", "darwin", nil],
108
- "i686-darwin8.4.1" => ["x86", "darwin", "8"],
109
- "i386-freebsd4.11" => ["x86", "freebsd", "4"],
110
- "i386-freebsd5" => ["x86", "freebsd", "5"],
111
- "i386-freebsd6" => ["x86", "freebsd", "6"],
112
- "i386-freebsd7" => ["x86", "freebsd", "7"],
113
- "i386-freebsd" => ["x86", "freebsd", nil],
114
- "universal-freebsd" => ["universal", "freebsd", nil],
115
- "i386-java1.5" => ["x86", "java", "1.5"],
116
- "x86-java1.6" => ["x86", "java", "1.6"],
117
- "i386-java1.6" => ["x86", "java", "1.6"],
118
- "i686-linux" => ["x86", "linux", nil],
119
- "i586-linux" => ["x86", "linux", nil],
120
- "i486-linux" => ["x86", "linux", nil],
121
- "i386-linux" => ["x86", "linux", nil],
122
- "i586-linux-gnu" => ["x86", "linux", "gnu"],
123
- "i386-linux-gnu" => ["x86", "linux", "gnu"],
124
- "i386-mingw32" => ["x86", "mingw32", nil],
125
- "x64-mingw-ucrt" => ["x64", "mingw", "ucrt"],
126
- "i386-mswin32" => ["x86", "mswin32", nil],
127
- "i386-mswin32_80" => ["x86", "mswin32", "80"],
128
- "i386-mswin32-80" => ["x86", "mswin32", "80"],
129
- "x86-mswin32" => ["x86", "mswin32", nil],
130
- "x86-mswin32_60" => ["x86", "mswin32", "60"],
131
- "x86-mswin32-60" => ["x86", "mswin32", "60"],
132
- "i386-netbsdelf" => ["x86", "netbsdelf", nil],
133
- "i386-openbsd4.0" => ["x86", "openbsd", "4.0"],
134
- "i386-solaris2.10" => ["x86", "solaris", "2.10"],
135
- "i386-solaris2.8" => ["x86", "solaris", "2.8"],
136
- "mswin32" => ["x86", "mswin32", nil],
137
- "x86_64-linux" => ["x86_64", "linux", nil],
138
- "x86_64-linux-gnu" => ["x86_64", "linux", "gnu"],
139
- "x86_64-linux-musl" => ["x86_64", "linux", "musl"],
140
- "x86_64-linux-uclibc" => ["x86_64", "linux", "uclibc"],
141
- "arm-linux-eabi" => ["arm", "linux", "eabi"],
142
- "arm-linux-gnueabi" => ["arm", "linux", "gnueabi"],
143
- "arm-linux-musleabi" => ["arm", "linux", "musleabi"],
144
- "arm-linux-uclibceabi" => ["arm", "linux", "uclibceabi"],
145
- "x86_64-openbsd3.9" => ["x86_64", "openbsd", "3.9"],
146
- "x86_64-openbsd4.0" => ["x86_64", "openbsd", "4.0"],
147
- "x86_64-openbsd" => ["x86_64", "openbsd", nil],
88
+ "amd64-freebsd6" => ["amd64", "freebsd", "6"],
89
+ "java" => [nil, "java", nil],
90
+ "jruby" => [nil, "java", nil],
91
+ "universal-dotnet" => ["universal", "dotnet", nil],
92
+ "universal-dotnet2.0" => ["universal", "dotnet", "2.0"],
93
+ "universal-dotnet4.0" => ["universal", "dotnet", "4.0"],
94
+ "powerpc-aix5.3.0.0" => ["powerpc", "aix", "5"],
95
+ "powerpc-darwin7" => ["powerpc", "darwin", "7"],
96
+ "powerpc-darwin8" => ["powerpc", "darwin", "8"],
97
+ "powerpc-linux" => ["powerpc", "linux", nil],
98
+ "powerpc64-linux" => ["powerpc64", "linux", nil],
99
+ "sparc-solaris2.10" => ["sparc", "solaris", "2.10"],
100
+ "sparc-solaris2.8" => ["sparc", "solaris", "2.8"],
101
+ "sparc-solaris2.9" => ["sparc", "solaris", "2.9"],
102
+ "universal-darwin8" => ["universal", "darwin", "8"],
103
+ "universal-darwin9" => ["universal", "darwin", "9"],
104
+ "universal-macruby" => ["universal", "macruby", nil],
105
+ "i386-cygwin" => ["x86", "cygwin", nil],
106
+ "i686-darwin" => ["x86", "darwin", nil],
107
+ "i686-darwin8.4.1" => ["x86", "darwin", "8"],
108
+ "i386-freebsd4.11" => ["x86", "freebsd", "4"],
109
+ "i386-freebsd5" => ["x86", "freebsd", "5"],
110
+ "i386-freebsd6" => ["x86", "freebsd", "6"],
111
+ "i386-freebsd7" => ["x86", "freebsd", "7"],
112
+ "i386-freebsd" => ["x86", "freebsd", nil],
113
+ "universal-freebsd" => ["universal", "freebsd", nil],
114
+ "i386-java1.5" => ["x86", "java", "1.5"],
115
+ "x86-java1.6" => ["x86", "java", "1.6"],
116
+ "i386-java1.6" => ["x86", "java", "1.6"],
117
+ "i686-linux" => ["x86", "linux", nil],
118
+ "i586-linux" => ["x86", "linux", nil],
119
+ "i486-linux" => ["x86", "linux", nil],
120
+ "i386-linux" => ["x86", "linux", nil],
121
+ "i586-linux-gnu" => ["x86", "linux", "gnu"],
122
+ "i386-linux-gnu" => ["x86", "linux", "gnu"],
123
+ "i386-mingw32" => ["x86", "mingw32", nil],
124
+ "x64-mingw-ucrt" => ["x64", "mingw", "ucrt"],
125
+ "i386-mswin32" => ["x86", "mswin32", nil],
126
+ "i386-mswin32_80" => ["x86", "mswin32", "80"],
127
+ "i386-mswin32-80" => ["x86", "mswin32", "80"],
128
+ "x86-mswin32" => ["x86", "mswin32", nil],
129
+ "x86-mswin32_60" => ["x86", "mswin32", "60"],
130
+ "x86-mswin32-60" => ["x86", "mswin32", "60"],
131
+ "i386-netbsdelf" => ["x86", "netbsdelf", nil],
132
+ "i386-openbsd4.0" => ["x86", "openbsd", "4.0"],
133
+ "i386-solaris2.10" => ["x86", "solaris", "2.10"],
134
+ "i386-solaris2.8" => ["x86", "solaris", "2.8"],
135
+ "mswin32" => ["x86", "mswin32", nil],
136
+ "x86_64-linux" => ["x86_64", "linux", nil],
137
+ "x86_64-linux-gnu" => ["x86_64", "linux", "gnu"],
138
+ "x86_64-linux-musl" => ["x86_64", "linux", "musl"],
139
+ "x86_64-linux-uclibc" => ["x86_64", "linux", "uclibc"],
140
+ "arm-linux-eabi" => ["arm", "linux", "eabi"],
141
+ "arm-linux-gnueabi" => ["arm", "linux", "gnueabi"],
142
+ "arm-linux-musleabi" => ["arm", "linux", "musleabi"],
143
+ "arm-linux-uclibceabi" => ["arm", "linux", "uclibceabi"],
144
+ "x86_64-openbsd3.9" => ["x86_64", "openbsd", "3.9"],
145
+ "x86_64-openbsd4.0" => ["x86_64", "openbsd", "4.0"],
146
+ "x86_64-openbsd" => ["x86_64", "openbsd", nil],
148
147
  }
149
148
 
150
149
  test_cases.each do |arch, expected|
@@ -1174,10 +1174,10 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
1174
1174
  def start_server(data)
1175
1175
  null_logger = NilLog.new
1176
1176
  s = WEBrick::HTTPServer.new(
1177
- :Port => 0,
1178
- :DocumentRoot => nil,
1179
- :Logger => null_logger,
1180
- :AccessLog => null_logger
1177
+ :Port => 0,
1178
+ :DocumentRoot => nil,
1179
+ :Logger => null_logger,
1180
+ :AccessLog => null_logger
1181
1181
  )
1182
1182
  s.mount_proc("/kill") {|req, res| s.shutdown }
1183
1183
  s.mount_proc("/yaml") do |req, res|
@@ -110,7 +110,7 @@ Gems to install:
110
110
  end
111
111
 
112
112
  options = {
113
- :gemdeps => "gem.deps.rb",
113
+ :gemdeps => "gem.deps.rb",
114
114
  :install_dir => "#{@gemhome}2",
115
115
  }
116
116
 
@@ -575,7 +575,7 @@ ruby "0"
575
575
  rs.resolve
576
576
 
577
577
  options = {
578
- :development => true,
578
+ :development => true,
579
579
  :development_shallow => true,
580
580
  }
581
581
 
@@ -83,7 +83,7 @@ class TestGemRequirement < Gem::TestCase
83
83
  Gem::Requirement.parse(Gem::Version.new("2"))
84
84
  end
85
85
 
86
- if RUBY_VERSION >= "2.5" && !(Gem.java_platform? && ENV["JRUBY_OPTS"] =~ /--debug/)
86
+ if !(Gem.java_platform? && ENV["JRUBY_OPTS"].to_s.include?("--debug"))
87
87
  def test_parse_deduplication
88
88
  assert_same "~>", Gem::Requirement.parse("~> 1").first
89
89
  end
@@ -36,9 +36,9 @@ class TestGemResolverAPISet < Gem::TestCase
36
36
  spec_fetcher
37
37
 
38
38
  data = [
39
- { :name => "a",
40
- :number => "1",
41
- :platform => "ruby",
39
+ { :name => "a",
40
+ :number => "1",
41
+ :platform => "ruby",
42
42
  :dependencies => [] },
43
43
  ]
44
44
 
@@ -59,13 +59,13 @@ class TestGemResolverAPISet < Gem::TestCase
59
59
  spec_fetcher
60
60
 
61
61
  data = [
62
- { :name => "a",
63
- :number => "1",
64
- :platform => "ruby",
62
+ { :name => "a",
63
+ :number => "1",
64
+ :platform => "ruby",
65
65
  :dependencies => [] },
66
- { :name => "a",
67
- :number => "2.a",
68
- :platform => "ruby",
66
+ { :name => "a",
67
+ :number => "2.a",
68
+ :platform => "ruby",
69
69
  :dependencies => [] },
70
70
  ]
71
71
 
@@ -88,9 +88,9 @@ class TestGemResolverAPISet < Gem::TestCase
88
88
  spec_fetcher
89
89
 
90
90
  data = [
91
- { :name => "a",
92
- :number => "1",
93
- :platform => "ruby",
91
+ { :name => "a",
92
+ :number => "1",
93
+ :platform => "ruby",
94
94
  :dependencies => [] },
95
95
  ]
96
96
 
@@ -5,8 +5,8 @@ class TestGemResolverAPISpecification < Gem::TestCase
5
5
  def test_initialize
6
6
  set = Gem::Resolver::APISet.new
7
7
  data = {
8
- :name => "rails",
9
- :number => "3.0.3",
8
+ :name => "rails",
9
+ :number => "3.0.3",
10
10
  :platform => Gem::Platform.local.to_s,
11
11
  :dependencies => [
12
12
  ["bundler", "~> 1.0"],
@@ -44,8 +44,8 @@ class TestGemResolverAPISpecification < Gem::TestCase
44
44
  set = Gem::Resolver::APISet.new repo
45
45
 
46
46
  data = {
47
- :name => "rails",
48
- :number => "3.0.3",
47
+ :name => "rails",
48
+ :number => "3.0.3",
49
49
  :platform => "ruby",
50
50
  :dependencies => [
51
51
  ["bundler", "~> 1.0"],
@@ -71,8 +71,8 @@ class TestGemResolverAPISpecification < Gem::TestCase
71
71
  def test_installable_platform_eh
72
72
  set = Gem::Resolver::APISet.new
73
73
  data = {
74
- :name => "a",
75
- :number => "1",
74
+ :name => "a",
75
+ :number => "1",
76
76
  :platform => "ruby",
77
77
  :dependencies => [],
78
78
  }
@@ -82,8 +82,8 @@ class TestGemResolverAPISpecification < Gem::TestCase
82
82
  assert a_spec.installable_platform?
83
83
 
84
84
  data = {
85
- :name => "b",
86
- :number => "1",
85
+ :name => "b",
86
+ :number => "1",
87
87
  :platform => "cpu-other_platform-1",
88
88
  :dependencies => [],
89
89
  }
@@ -93,8 +93,8 @@ class TestGemResolverAPISpecification < Gem::TestCase
93
93
  refute b_spec.installable_platform?
94
94
 
95
95
  data = {
96
- :name => "c",
97
- :number => "1",
96
+ :name => "c",
97
+ :number => "1",
98
98
  :platform => Gem::Platform.local.to_s,
99
99
  :dependencies => [],
100
100
  }
@@ -107,9 +107,9 @@ class TestGemResolverAPISpecification < Gem::TestCase
107
107
  def test_source
108
108
  set = Gem::Resolver::APISet.new
109
109
  data = {
110
- :name => "a",
111
- :number => "1",
112
- :platform => "ruby",
110
+ :name => "a",
111
+ :number => "1",
112
+ :platform => "ruby",
113
113
  :dependencies => [],
114
114
  }
115
115
 
@@ -126,9 +126,9 @@ class TestGemResolverAPISpecification < Gem::TestCase
126
126
  dep_uri = URI(@gem_repo) + "info"
127
127
  set = Gem::Resolver::APISet.new dep_uri
128
128
  data = {
129
- :name => "a",
130
- :number => "1",
131
- :platform => "ruby",
129
+ :name => "a",
130
+ :number => "1",
131
+ :platform => "ruby",
132
132
  :dependencies => [],
133
133
  }
134
134
 
@@ -150,9 +150,9 @@ class TestGemResolverAPISpecification < Gem::TestCase
150
150
  dep_uri = URI(@gem_repo) + "info"
151
151
  set = Gem::Resolver::APISet.new dep_uri
152
152
  data = {
153
- :name => "j",
154
- :number => "1",
155
- :platform => "jruby",
153
+ :name => "j",
154
+ :number => "1",
155
+ :platform => "jruby",
156
156
  :dependencies => [],
157
157
  }
158
158
 
@@ -63,7 +63,7 @@ class TestGemResolverGitSpecification < Gem::TestCase
63
63
 
64
64
  def test_install_extension
65
65
  pend if Gem.java_platform?
66
- pend if /mswin/ =~ RUBY_PLATFORM && ENV.key?("GITHUB_ACTIONS") # not working from the beginning
66
+ pend if RUBY_PLATFORM.include?("mswin") && ENV.key?("GITHUB_ACTIONS") # not working from the beginning
67
67
  name, _, repository, = git_gem "a", 1 do |s|
68
68
  s.extensions << "ext/extconf.rb"
69
69
  end
@@ -43,22 +43,22 @@ class TestGemSecurityPolicy < Gem::TestCase
43
43
 
44
44
  @chain = Gem::Security::Policy.new(
45
45
  "Chain",
46
- :verify_data => true,
46
+ :verify_data => true,
47
47
  :verify_signer => true,
48
- :verify_chain => true,
49
- :verify_root => false,
50
- :only_trusted => false,
51
- :only_signed => false
48
+ :verify_chain => true,
49
+ :verify_root => false,
50
+ :only_trusted => false,
51
+ :only_signed => false
52
52
  )
53
53
 
54
54
  @root = Gem::Security::Policy.new(
55
55
  "Root",
56
- :verify_data => true,
56
+ :verify_data => true,
57
57
  :verify_signer => true,
58
- :verify_chain => true,
59
- :verify_root => true,
60
- :only_trusted => false,
61
- :only_signed => false
58
+ :verify_chain => true,
59
+ :verify_root => true,
60
+ :only_trusted => false,
61
+ :only_signed => false
62
62
  )
63
63
  end
64
64
 
@@ -70,7 +70,7 @@ class TestGemSecurityTrustDir < Gem::TestCase
70
70
  assert_path_exist @dest_dir
71
71
 
72
72
  mask = 040700 & (~File.umask)
73
- mask |= 0200000 if /aix/ =~ RUBY_PLATFORM
73
+ mask |= 0200000 if RUBY_PLATFORM.include?("aix")
74
74
 
75
75
  assert_equal mask, File.stat(@dest_dir).mode unless win_platform?
76
76
  end
@@ -91,7 +91,7 @@ class TestGemSecurityTrustDir < Gem::TestCase
91
91
  @trust_dir.verify
92
92
 
93
93
  mask = 040700 & (~File.umask)
94
- mask |= 0200000 if /aix/ =~ RUBY_PLATFORM
94
+ mask |= 0200000 if RUBY_PLATFORM.include?("aix")
95
95
 
96
96
  assert_equal mask, File.stat(@dest_dir).mode unless win_platform?
97
97
  end
@@ -1866,9 +1866,9 @@ dependencies: []
1866
1866
 
1867
1867
  def test_full_name_windows
1868
1868
  test_cases = {
1869
- "i386-mswin32" => "a-1-x86-mswin32-60",
1870
- "i386-mswin32_80" => "a-1-x86-mswin32-80",
1871
- "i386-mingw32" => "a-1-x86-mingw32",
1869
+ "i386-mswin32" => "a-1-x86-mswin32-60",
1870
+ "i386-mswin32_80" => "a-1-x86-mswin32-80",
1871
+ "i386-mingw32" => "a-1-x86-mingw32",
1872
1872
  }
1873
1873
 
1874
1874
  test_cases.each do |arch, expected|
@@ -1969,10 +1969,10 @@ dependencies: []
1969
1969
  assert_equal Gem::Platform::RUBY, @a1.platform
1970
1970
 
1971
1971
  test_cases = {
1972
- "i386-mswin32" => ["x86", "mswin32", "60"],
1972
+ "i386-mswin32" => ["x86", "mswin32", "60"],
1973
1973
  "i386-mswin32_80" => ["x86", "mswin32", "80"],
1974
- "i386-mingw32" => ["x86", "mingw32", nil ],
1975
- "x86-darwin8" => ["x86", "darwin", "8" ],
1974
+ "i386-mingw32" => ["x86", "mingw32", nil ],
1975
+ "x86-darwin8" => ["x86", "darwin", "8" ],
1976
1976
  }
1977
1977
 
1978
1978
  test_cases.each do |arch, expected|
@@ -2276,15 +2276,9 @@ Gem::Specification.new do |s|
2276
2276
  s.rubygems_version = "#{Gem::VERSION}".freeze
2277
2277
  s.summary = "this is a summary".freeze
2278
2278
 
2279
- if s.respond_to? :specification_version then
2280
- s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
2281
- end
2279
+ s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
2282
2280
 
2283
- if s.respond_to? :add_runtime_dependency then
2284
- s.add_runtime_dependency(%q<b>.freeze, [\"= 1\"])
2285
- else
2286
- s.add_dependency(%q<b>.freeze, [\"= 1\"])
2287
- end
2281
+ s.add_runtime_dependency(%q<b>.freeze, [\"= 1\"])
2288
2282
  end
2289
2283
  SPEC
2290
2284
 
@@ -2356,15 +2350,9 @@ Gem::Specification.new do |s|
2356
2350
 
2357
2351
  s.installed_by_version = "#{Gem::VERSION}" if s.respond_to? :installed_by_version
2358
2352
 
2359
- if s.respond_to? :specification_version then
2360
- s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
2361
- end
2353
+ s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
2362
2354
 
2363
- if s.respond_to? :add_runtime_dependency then
2364
- s.add_runtime_dependency(%q<b>.freeze, [\"= 1\"])
2365
- else
2366
- s.add_dependency(%q<b>.freeze, [\"= 1\"])
2367
- end
2355
+ s.add_runtime_dependency(%q<b>.freeze, [\"= 1\"])
2368
2356
  end
2369
2357
  SPEC
2370
2358
 
@@ -2415,19 +2403,11 @@ Gem::Specification.new do |s|
2415
2403
  s.summary = "this is a summary".freeze
2416
2404
  s.test_files = ["test/suite.rb".freeze]
2417
2405
 
2418
- if s.respond_to? :specification_version then
2419
- s.specification_version = 4
2420
- end
2406
+ s.specification_version = 4
2421
2407
 
2422
- if s.respond_to? :add_runtime_dependency then
2423
- s.add_runtime_dependency(%q<rake>.freeze, [\"> 0.4\"])
2424
- s.add_runtime_dependency(%q<jabber4r>.freeze, [\"> 0.0.0\"])
2425
- s.add_runtime_dependency(%q<pqa>.freeze, [\"> 0.4\", \"<= 0.6\"])
2426
- else
2427
- s.add_dependency(%q<rake>.freeze, [\"> 0.4\"])
2428
- s.add_dependency(%q<jabber4r>.freeze, [\"> 0.0.0\"])
2429
- s.add_dependency(%q<pqa>.freeze, [\"> 0.4\", \"<= 0.6\"])
2430
- end
2408
+ s.add_runtime_dependency(%q<rake>.freeze, [\"> 0.4\"])
2409
+ s.add_runtime_dependency(%q<jabber4r>.freeze, [\"> 0.0.0\"])
2410
+ s.add_runtime_dependency(%q<pqa>.freeze, [\"> 0.4\", \"<= 0.6\"])
2431
2411
  end
2432
2412
  SPEC
2433
2413
 
@@ -2728,6 +2708,39 @@ duplicate dependency on c (>= 1.2.3, development), (~> 1.2) use:
2728
2708
  end
2729
2709
  end
2730
2710
 
2711
+ def test_validate_rust_extension_have_missing_cargo_toml_error
2712
+ util_setup_validate
2713
+
2714
+ Dir.chdir @tempdir do
2715
+ @a1.extensions = ["Cargo.toml"]
2716
+ File.write File.join(@tempdir, "Cargo.toml"), ""
2717
+
2718
+ e = assert_raise Gem::InvalidSpecificationException do
2719
+ use_ui @ui do
2720
+ @a1.validate
2721
+ end
2722
+ end
2723
+
2724
+ assert_match(/but Cargo.lock is not part of the gem files/, e.message)
2725
+ end
2726
+ end
2727
+
2728
+ def test_validate_rust_extension_have_no_missing_cargo_toml_error
2729
+ util_setup_validate
2730
+
2731
+ Dir.chdir @tempdir do
2732
+ @a1.extensions = ["Cargo.toml"]
2733
+ @a1.files << "Cargo.toml"
2734
+ @a1.files << "Cargo.lock"
2735
+ File.write File.join(@tempdir, "Cargo.toml"), ""
2736
+ File.write File.join(@tempdir, "Cargo.lock"), ""
2737
+
2738
+ use_ui @ui do
2739
+ @a1.validate
2740
+ end
2741
+ end
2742
+ end
2743
+
2731
2744
  def test_validate_description
2732
2745
  util_setup_validate
2733
2746
 
@@ -3469,10 +3482,10 @@ Did you mean 'Ruby'?
3469
3482
  @m1 = quick_gem "m", "1" do |s|
3470
3483
  s.files = %w[lib/code.rb]
3471
3484
  s.metadata = {
3472
- "one" => "two",
3473
- "home" => "three",
3485
+ "one" => "two",
3486
+ "home" => "three",
3474
3487
  "homepage_uri" => "https://example.com/user/repo",
3475
- "funding_uri" => "https://example.com/donate",
3488
+ "funding_uri" => "https://example.com/donate",
3476
3489
  }
3477
3490
  end
3478
3491
 
@@ -372,7 +372,7 @@ create_makefile '#{@spec.name}'
372
372
  @user_spec = Gem::Specification.find_by_name "b"
373
373
 
374
374
  uninstaller = Gem::Uninstaller.new(@user_spec.name,
375
- :executables => true,
375
+ :executables => true,
376
376
  :user_install => true)
377
377
 
378
378
  gem_dir = File.join @user_spec.gem_dir