rubygems-update 3.3.26 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (272) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -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 +59 -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 +43 -2
  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 +1 -1
  55. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  56. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  57. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  58. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  59. data/bundler/lib/bundler/man/bundle-gem.1 +27 -37
  60. data/bundler/lib/bundler/man/bundle-gem.1.ronn +5 -5
  61. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  62. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  63. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  64. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  65. data/bundler/lib/bundler/man/bundle-install.1 +1 -30
  66. data/bundler/lib/bundler/man/bundle-install.1.ronn +0 -29
  67. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  68. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  69. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  70. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  71. data/bundler/lib/bundler/man/bundle-platform.1 +2 -2
  72. data/bundler/lib/bundler/man/bundle-platform.1.ronn +1 -1
  73. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  74. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  75. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  76. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  77. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  78. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  79. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  80. data/bundler/lib/bundler/man/bundle.1 +1 -1
  81. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  82. data/bundler/lib/bundler/mirror.rb +5 -7
  83. data/bundler/lib/bundler/plugin/index.rb +4 -4
  84. data/bundler/lib/bundler/plugin/installer/rubygems.rb +0 -4
  85. data/bundler/lib/bundler/resolver/base.rb +7 -11
  86. data/bundler/lib/bundler/resolver/candidate.rb +92 -0
  87. data/bundler/lib/bundler/resolver/incompatibility.rb +15 -0
  88. data/bundler/lib/bundler/resolver/package.rb +63 -0
  89. data/bundler/lib/bundler/resolver/root.rb +25 -0
  90. data/bundler/lib/bundler/resolver/spec_group.rb +26 -36
  91. data/bundler/lib/bundler/resolver.rb +294 -277
  92. data/bundler/lib/bundler/rubygems_ext.rb +11 -6
  93. data/bundler/lib/bundler/rubygems_gem_installer.rb +4 -2
  94. data/bundler/lib/bundler/rubygems_integration.rb +1 -9
  95. data/bundler/lib/bundler/runtime.rb +1 -5
  96. data/bundler/lib/bundler/settings.rb +0 -6
  97. data/bundler/lib/bundler/shared_helpers.rb +1 -0
  98. data/bundler/lib/bundler/source/git/git_proxy.rb +193 -67
  99. data/bundler/lib/bundler/source/git.rb +15 -17
  100. data/bundler/lib/bundler/source/metadata.rb +0 -1
  101. data/bundler/lib/bundler/source/path/installer.rb +1 -22
  102. data/bundler/lib/bundler/source/path.rb +5 -5
  103. data/bundler/lib/bundler/source/rubygems.rb +13 -67
  104. data/bundler/lib/bundler/source_list.rb +8 -2
  105. data/bundler/lib/bundler/spec_set.rb +7 -9
  106. data/bundler/lib/bundler/templates/Executable +1 -1
  107. data/bundler/lib/bundler/templates/Executable.bundler +4 -9
  108. data/bundler/lib/bundler/templates/Executable.standalone +2 -0
  109. data/bundler/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
  110. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +3 -0
  111. data/bundler/lib/bundler/templates/newgem/README.md.tt +6 -4
  112. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +2 -1
  113. data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
  114. data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
  115. data/bundler/lib/bundler/templates/newgem/ext/newgem/{extconf.rb.tt → extconf-c.rb.tt} +0 -0
  116. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  117. data/bundler/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
  118. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +10 -0
  119. data/bundler/lib/bundler/templates/newgem/gitignore.tt +3 -0
  120. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +8 -0
  121. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -2
  122. data/bundler/lib/bundler/ui/shell.rb +35 -12
  123. data/bundler/lib/bundler/ui/silent.rb +21 -5
  124. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +3 -3
  125. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -1
  126. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +3 -1
  127. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -408
  128. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  129. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
  130. data/bundler/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  131. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  132. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
  133. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  134. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +151 -0
  135. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  136. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  137. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  138. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  139. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +53 -0
  140. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  141. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  142. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +124 -0
  143. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +409 -0
  144. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +240 -0
  145. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  146. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  147. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +1 -1
  148. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +64 -16
  149. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
  150. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -1
  151. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +27 -7
  152. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +40 -2
  153. data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +2 -1
  154. data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
  155. data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
  156. data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -2
  157. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +13 -7
  158. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +10 -5
  159. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  160. data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +1 -2
  161. data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +2 -1
  162. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +3 -2
  163. data/bundler/lib/bundler/vendored_persistent.rb +1 -33
  164. data/bundler/lib/bundler/{vendored_tmpdir.rb → vendored_pub_grub.rb} +1 -1
  165. data/bundler/lib/bundler/version.rb +5 -1
  166. data/bundler/lib/bundler/worker.rb +5 -7
  167. data/bundler/lib/bundler.rb +20 -64
  168. data/lib/rubygems/command_manager.rb +2 -2
  169. data/lib/rubygems/commands/fetch_command.rb +1 -1
  170. data/lib/rubygems/commands/install_command.rb +7 -3
  171. data/lib/rubygems/commands/rdoc_command.rb +3 -2
  172. data/lib/rubygems/commands/setup_command.rb +2 -2
  173. data/lib/rubygems/commands/unpack_command.rb +1 -1
  174. data/lib/rubygems/commands/update_command.rb +1 -7
  175. data/lib/rubygems/config_file.rb +33 -0
  176. data/lib/rubygems/core_ext/kernel_warn.rb +1 -2
  177. data/lib/rubygems/defaults.rb +15 -1
  178. data/lib/rubygems/dependency.rb +4 -1
  179. data/lib/rubygems/dependency_installer.rb +24 -24
  180. data/lib/rubygems/exceptions.rb +1 -3
  181. data/lib/rubygems/ext/builder.rb +3 -3
  182. data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +9 -5
  183. data/lib/rubygems/ext/cargo_builder.rb +15 -20
  184. data/lib/rubygems/ext/ext_conf_builder.rb +2 -0
  185. data/lib/rubygems/indexer.rb +1 -1
  186. data/lib/rubygems/installer.rb +5 -5
  187. data/lib/rubygems/optparse/lib/optparse.rb +20 -15
  188. data/lib/rubygems/package/tar_header.rb +11 -11
  189. data/lib/rubygems/platform.rb +0 -2
  190. data/lib/rubygems/request_set/gem_dependency_api.rb +104 -104
  191. data/lib/rubygems/requirement.rb +7 -7
  192. data/lib/rubygems/resolver/installer_set.rb +1 -1
  193. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +1 -1
  194. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +32 -26
  195. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  196. data/lib/rubygems/security/policies.rb +40 -40
  197. data/lib/rubygems/security/trust_dir.rb +1 -1
  198. data/lib/rubygems/security.rb +3 -16
  199. data/lib/rubygems/source.rb +2 -2
  200. data/lib/rubygems/specification.rb +37 -49
  201. data/lib/rubygems/specification_policy.rb +14 -0
  202. data/lib/rubygems/stub_specification.rb +2 -2
  203. data/lib/rubygems/text.rb +1 -1
  204. data/lib/rubygems/tsort/lib/tsort.rb +308 -310
  205. data/lib/rubygems/update_suggestion.rb +69 -0
  206. data/lib/rubygems/util.rb +1 -5
  207. data/lib/rubygems/validator.rb +1 -1
  208. data/lib/rubygems.rb +8 -3
  209. data/rubygems-update.gemspec +2 -2
  210. data/test/rubygems/helper.rb +7 -3
  211. data/test/rubygems/test_bundled_ca.rb +1 -1
  212. data/test/rubygems/test_exit.rb +6 -0
  213. data/test/rubygems/test_gem.rb +4 -9
  214. data/test/rubygems/test_gem_bundler_version_finder.rb +2 -1
  215. data/test/rubygems/test_gem_command_manager.rb +1 -1
  216. data/test/rubygems/test_gem_commands_install_command.rb +19 -0
  217. data/test/rubygems/test_gem_commands_setup_command.rb +1 -8
  218. data/test/rubygems/test_gem_commands_update_command.rb +6 -6
  219. data/test/rubygems/test_gem_config_file.rb +1 -1
  220. data/test/rubygems/test_gem_dependency.rb +2 -0
  221. data/test/rubygems/test_gem_ext_builder.rb +3 -3
  222. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +22 -32
  223. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
  224. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +22 -32
  225. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
  226. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +12 -0
  227. data/test/rubygems/test_gem_ext_cargo_builder.rb +22 -27
  228. data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +16 -16
  229. data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +0 -10
  230. data/test/rubygems/test_gem_indexer.rb +39 -20
  231. data/test/rubygems/test_gem_installer.rb +68 -2
  232. data/test/rubygems/test_gem_package_tar_header.rb +13 -13
  233. data/test/rubygems/test_gem_platform.rb +59 -60
  234. data/test/rubygems/test_gem_remote_fetcher.rb +4 -4
  235. data/test/rubygems/test_gem_request_set.rb +2 -2
  236. data/test/rubygems/test_gem_requirement.rb +1 -1
  237. data/test/rubygems/test_gem_resolver_api_set.rb +12 -12
  238. data/test/rubygems/test_gem_resolver_api_specification.rb +19 -19
  239. data/test/rubygems/test_gem_resolver_git_specification.rb +1 -1
  240. data/test/rubygems/test_gem_security_policy.rb +10 -10
  241. data/test/rubygems/test_gem_security_trust_dir.rb +2 -2
  242. data/test/rubygems/test_gem_specification.rb +50 -37
  243. data/test/rubygems/test_gem_uninstaller.rb +1 -1
  244. data/test/rubygems/test_gem_update_suggestion.rb +208 -0
  245. data/test/rubygems/test_kernel.rb +10 -8
  246. data/test/rubygems/test_require.rb +70 -55
  247. metadata +34 -31
  248. data/bundler/lib/bundler/templates/newgem/travis.yml.tt +0 -6
  249. data/bundler/lib/bundler/vendor/molinillo/LICENSE +0 -9
  250. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  251. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
  252. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
  253. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
  254. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
  255. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
  256. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
  257. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
  258. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
  259. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
  260. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
  261. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
  262. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -149
  263. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  264. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
  265. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
  266. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
  267. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
  268. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
  269. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -11
  270. data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
  271. data/bundler/lib/bundler/vendored_molinillo.rb +0 -4
  272. data/bundler/lib/bundler/version_ranges.rb +0 -122
@@ -6,12 +6,12 @@ module Gem::Security
6
6
 
7
7
  NoSecurity = Policy.new(
8
8
  "No Security",
9
- :verify_data => false,
10
- :verify_signer => false,
11
- :verify_chain => false,
12
- :verify_root => false,
13
- :only_trusted => false,
14
- :only_signed => false
9
+ :verify_data => false,
10
+ :verify_signer => false,
11
+ :verify_chain => false,
12
+ :verify_root => false,
13
+ :only_trusted => false,
14
+ :only_signed => false
15
15
  )
16
16
 
17
17
  ##
@@ -24,12 +24,12 @@ module Gem::Security
24
24
 
25
25
  AlmostNoSecurity = Policy.new(
26
26
  "Almost No Security",
27
- :verify_data => true,
28
- :verify_signer => false,
29
- :verify_chain => false,
30
- :verify_root => false,
31
- :only_trusted => false,
32
- :only_signed => false
27
+ :verify_data => true,
28
+ :verify_signer => false,
29
+ :verify_chain => false,
30
+ :verify_root => false,
31
+ :only_trusted => false,
32
+ :only_signed => false
33
33
  )
34
34
 
35
35
  ##
@@ -41,12 +41,12 @@ module Gem::Security
41
41
 
42
42
  LowSecurity = Policy.new(
43
43
  "Low Security",
44
- :verify_data => true,
45
- :verify_signer => true,
46
- :verify_chain => false,
47
- :verify_root => false,
48
- :only_trusted => false,
49
- :only_signed => false
44
+ :verify_data => true,
45
+ :verify_signer => true,
46
+ :verify_chain => false,
47
+ :verify_root => false,
48
+ :only_trusted => false,
49
+ :only_signed => false
50
50
  )
51
51
 
52
52
  ##
@@ -60,12 +60,12 @@ module Gem::Security
60
60
 
61
61
  MediumSecurity = Policy.new(
62
62
  "Medium Security",
63
- :verify_data => true,
64
- :verify_signer => true,
65
- :verify_chain => true,
66
- :verify_root => true,
67
- :only_trusted => true,
68
- :only_signed => false
63
+ :verify_data => true,
64
+ :verify_signer => true,
65
+ :verify_chain => true,
66
+ :verify_root => true,
67
+ :only_trusted => true,
68
+ :only_signed => false
69
69
  )
70
70
 
71
71
  ##
@@ -79,12 +79,12 @@ module Gem::Security
79
79
 
80
80
  HighSecurity = Policy.new(
81
81
  "High Security",
82
- :verify_data => true,
83
- :verify_signer => true,
84
- :verify_chain => true,
85
- :verify_root => true,
86
- :only_trusted => true,
87
- :only_signed => true
82
+ :verify_data => true,
83
+ :verify_signer => true,
84
+ :verify_chain => true,
85
+ :verify_root => true,
86
+ :only_trusted => true,
87
+ :only_signed => true
88
88
  )
89
89
 
90
90
  ##
@@ -92,23 +92,23 @@ module Gem::Security
92
92
 
93
93
  SigningPolicy = Policy.new(
94
94
  "Signing Policy",
95
- :verify_data => false,
96
- :verify_signer => true,
97
- :verify_chain => true,
98
- :verify_root => true,
99
- :only_trusted => false,
100
- :only_signed => false
95
+ :verify_data => false,
96
+ :verify_signer => true,
97
+ :verify_chain => true,
98
+ :verify_root => true,
99
+ :only_trusted => false,
100
+ :only_signed => false
101
101
  )
102
102
 
103
103
  ##
104
104
  # Hash of configured security policies
105
105
 
106
106
  Policies = {
107
- "NoSecurity" => NoSecurity,
107
+ "NoSecurity" => NoSecurity,
108
108
  "AlmostNoSecurity" => AlmostNoSecurity,
109
- "LowSecurity" => LowSecurity,
110
- "MediumSecurity" => MediumSecurity,
111
- "HighSecurity" => HighSecurity,
109
+ "LowSecurity" => LowSecurity,
110
+ "MediumSecurity" => MediumSecurity,
111
+ "HighSecurity" => HighSecurity,
112
112
  # SigningPolicy is not intended for use by `gem -P` so do not list it
113
113
  }.freeze
114
114
 
@@ -8,7 +8,7 @@ class Gem::Security::TrustDir
8
8
  # Default permissions for the trust directory and its contents
9
9
 
10
10
  DEFAULT_PERMISSIONS = {
11
- :trust_dir => 0700,
11
+ :trust_dir => 0700,
12
12
  :trusted_cert => 0600,
13
13
  }.freeze
14
14
 
@@ -376,8 +376,8 @@ module Gem::Security
376
376
  # * The certificate contains a subject key identifier
377
377
 
378
378
  EXTENSIONS = {
379
- "basicConstraints" => "CA:FALSE",
380
- "keyUsage" =>
379
+ "basicConstraints" => "CA:FALSE",
380
+ "keyUsage" =>
381
381
  "keyEncipherment,dataEncipherment,digitalSignature",
382
382
  "subjectKeyIdentifier" => "hash",
383
383
  }.freeze
@@ -433,13 +433,6 @@ module Gem::Security
433
433
  ec_key
434
434
  end
435
435
 
436
- ##
437
- # In Ruby 2.3 EC doesn't implement the private_key? but not the private? method
438
-
439
- if defined?(OpenSSL::PKey::EC) && Gem::Version.new(String.new(RUBY_VERSION)) < Gem::Version.new("2.4.0")
440
- OpenSSL::PKey::EC.send(:alias_method, :private?, :private_key?)
441
- end
442
-
443
436
  ##
444
437
  # Creates a self-signed certificate with an issuer and subject from +email+,
445
438
  # a subject alternative name of +email+ and the given +extensions+ for the
@@ -492,13 +485,7 @@ module Gem::Security
492
485
  when "rsa"
493
486
  OpenSSL::PKey::RSA.new(RSA_DSA_KEY_LENGTH)
494
487
  when "ec"
495
- if RUBY_VERSION >= "2.4.0"
496
- OpenSSL::PKey::EC.generate(EC_NAME)
497
- else
498
- domain_key = OpenSSL::PKey::EC.new(EC_NAME)
499
- domain_key.generate_key
500
- domain_key
501
- end
488
+ OpenSSL::PKey::EC.generate(EC_NAME)
502
489
  else
503
490
  raise Gem::Security::Exception,
504
491
  "#{algorithm} algorithm not found. RSA, DSA, and EC algorithms are supported."
@@ -12,8 +12,8 @@ class Gem::Source
12
12
  include Gem::Text
13
13
 
14
14
  FILES = { # :nodoc:
15
- :released => "specs",
16
- :latest => "latest_specs",
15
+ :released => "specs",
16
+ :latest => "latest_specs",
17
17
  :prerelease => "prerelease_specs",
18
18
  }.freeze
19
19
 
@@ -75,7 +75,7 @@ class Gem::Specification < Gem::BasicSpecification
75
75
 
76
76
  SPECIFICATION_VERSION_HISTORY = { # :nodoc:
77
77
  -1 => ["(RubyGems versions up to and including 0.7 did not have versioned specifications)"],
78
- 1 => [
78
+ 1 => [
79
79
  'Deprecated "test_suite_file" in favor of the new, but equivalent, "test_files"',
80
80
  '"test_file=x" is a shortcut for "test_files=[x]"',
81
81
  ],
@@ -93,10 +93,10 @@ class Gem::Specification < Gem::BasicSpecification
93
93
 
94
94
  MARSHAL_FIELDS = { # :nodoc:
95
95
  -1 => 16,
96
- 1 => 16,
97
- 2 => 16,
98
- 3 => 17,
99
- 4 => 18,
96
+ 1 => 16,
97
+ 2 => 16,
98
+ 3 => 17,
99
+ 4 => 18,
100
100
  }.freeze
101
101
 
102
102
  today = Time.now.utc
@@ -124,35 +124,35 @@ class Gem::Specification < Gem::BasicSpecification
124
124
  # Map of attribute names to default values.
125
125
 
126
126
  @@default_value = {
127
- :authors => [],
128
- :autorequire => nil,
129
- :bindir => "bin",
130
- :cert_chain => [],
131
- :date => nil,
132
- :dependencies => [],
133
- :description => nil,
134
- :email => nil,
135
- :executables => [],
136
- :extensions => [],
137
- :extra_rdoc_files => [],
138
- :files => [],
139
- :homepage => nil,
140
- :licenses => [],
141
- :metadata => {},
142
- :name => nil,
143
- :platform => Gem::Platform::RUBY,
144
- :post_install_message => nil,
145
- :rdoc_options => [],
146
- :require_paths => ["lib"],
147
- :required_ruby_version => Gem::Requirement.default,
127
+ :authors => [],
128
+ :autorequire => nil,
129
+ :bindir => "bin",
130
+ :cert_chain => [],
131
+ :date => nil,
132
+ :dependencies => [],
133
+ :description => nil,
134
+ :email => nil,
135
+ :executables => [],
136
+ :extensions => [],
137
+ :extra_rdoc_files => [],
138
+ :files => [],
139
+ :homepage => nil,
140
+ :licenses => [],
141
+ :metadata => {},
142
+ :name => nil,
143
+ :platform => Gem::Platform::RUBY,
144
+ :post_install_message => nil,
145
+ :rdoc_options => [],
146
+ :require_paths => ["lib"],
147
+ :required_ruby_version => Gem::Requirement.default,
148
148
  :required_rubygems_version => Gem::Requirement.default,
149
- :requirements => [],
150
- :rubygems_version => Gem::VERSION,
151
- :signing_key => nil,
152
- :specification_version => CURRENT_SPECIFICATION_VERSION,
153
- :summary => nil,
154
- :test_files => [],
155
- :version => nil,
149
+ :requirements => [],
150
+ :rubygems_version => Gem::VERSION,
151
+ :signing_key => nil,
152
+ :specification_version => CURRENT_SPECIFICATION_VERSION,
153
+ :summary => nil,
154
+ :test_files => [],
155
+ :version => nil,
156
156
  }.freeze
157
157
 
158
158
  # rubocop:disable Style/MutableConstant
@@ -1265,8 +1265,7 @@ class Gem::Specification < Gem::BasicSpecification
1265
1265
  clear_load_cache
1266
1266
  unresolved = unresolved_deps
1267
1267
  unless unresolved.empty?
1268
- w = "W" + "ARN"
1269
- warn "#{w}: Unresolved or ambiguous specs during Gem::Specification.reset:"
1268
+ warn "WARN: Unresolved or ambiguous specs during Gem::Specification.reset:"
1270
1269
  unresolved.values.each do |dep|
1271
1270
  warn " #{dep}"
1272
1271
 
@@ -1276,7 +1275,7 @@ class Gem::Specification < Gem::BasicSpecification
1276
1275
  versions.each {|s| warn " - #{s.version}" }
1277
1276
  end
1278
1277
  end
1279
- warn "#{w}: Clearing out unresolved specs. Try 'gem cleanup <gem>'"
1278
+ warn "WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'"
1280
1279
  warn "Please report a bug if this causes problems."
1281
1280
  unresolved.clear
1282
1281
  end
@@ -2519,25 +2518,14 @@ class Gem::Specification < Gem::BasicSpecification
2519
2518
 
2520
2519
  unless dependencies.empty?
2521
2520
  result << nil
2522
- result << " if s.respond_to? :specification_version then"
2523
- result << " s.specification_version = #{specification_version}"
2524
- result << " end"
2521
+ result << " s.specification_version = #{specification_version}"
2525
2522
  result << nil
2526
2523
 
2527
- result << " if s.respond_to? :add_runtime_dependency then"
2528
-
2529
2524
  dependencies.each do |dep|
2530
2525
  req = dep.requirements_list.inspect
2531
2526
  dep.instance_variable_set :@type, :runtime if dep.type.nil? # HACK
2532
- result << " s.add_#{dep.type}_dependency(%q<#{dep.name}>.freeze, #{req})"
2533
- end
2534
-
2535
- result << " else"
2536
- dependencies.each do |dep|
2537
- version_reqs_param = dep.requirements_list.inspect
2538
- result << " s.add_dependency(%q<#{dep.name}>.freeze, #{version_reqs_param})"
2527
+ result << " s.add_#{dep.type}_dependency(%q<#{dep.name}>.freeze, #{req})"
2539
2528
  end
2540
- result << " end"
2541
2529
  end
2542
2530
 
2543
2531
  result << "end"
@@ -460,6 +460,20 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
460
460
  require_relative "ext"
461
461
  builder = Gem::Ext::Builder.new(@specification)
462
462
 
463
+ validate_rake_extensions(builder)
464
+ validate_rust_extensions(builder)
465
+ end
466
+
467
+ def validate_rust_extensions(builder) # :nodoc:
468
+ rust_extension = @specification.extensions.any? {|s| builder.builder_for(s).is_a? Gem::Ext::CargoBuilder }
469
+ missing_cargo_lock = !@specification.files.include?("Cargo.lock")
470
+
471
+ error <<-ERROR if rust_extension && missing_cargo_lock
472
+ You have specified rust based extension, but Cargo.lock is not part of the gem files. Please run `cargo generate-lockfile` or any other command to generate Cargo.lock and ensure it is added to your gem files section in gemspec.
473
+ ERROR
474
+ end
475
+
476
+ def validate_rake_extensions(builder) # :nodoc:
463
477
  rake_extension = @specification.extensions.any? {|s| builder.builder_for(s) == Gem::Ext::RakeBuilder }
464
478
  rake_dependency = @specification.dependencies.any? {|d| d.name == "rake" }
465
479
 
@@ -19,9 +19,9 @@ class Gem::StubSpecification < Gem::BasicSpecification
19
19
 
20
20
  # These are common require paths.
21
21
  REQUIRE_PATHS = { # :nodoc:
22
- "lib" => "lib".freeze,
22
+ "lib" => "lib".freeze,
23
23
  "test" => "test".freeze,
24
- "ext" => "ext".freeze,
24
+ "ext" => "ext".freeze,
25
25
  }.freeze
26
26
 
27
27
  # These are common require path lists. This hash is used to optimize
data/lib/rubygems/text.rb CHANGED
@@ -51,7 +51,7 @@ module Gem::Text
51
51
 
52
52
  # Returns a value representing the "cost" of transforming str1 into str2
53
53
  # Vendored version of DidYouMean::Levenshtein.distance from the ruby/did_you_mean gem @ 1.4.0
54
- # https://git.io/JJgZI
54
+ # https://github.com/ruby/did_you_mean/blob/2ddf39b874808685965dbc47d344cf6c7651807c/lib/did_you_mean/levenshtein.rb#L7-L37
55
55
  def levenshtein_distance(str1, str2)
56
56
  n = str1.length
57
57
  m = str2.length