rubygems-update 2.6.0 → 3.4.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (804) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +5802 -0
  3. data/CODE_OF_CONDUCT.md +76 -35
  4. data/CONTRIBUTING.md +231 -0
  5. data/MAINTAINERS.txt +8 -0
  6. data/Manifest.txt +441 -42
  7. data/POLICIES.md +135 -0
  8. data/README.md +114 -0
  9. data/UPGRADING.md +15 -0
  10. data/bundler/CHANGELOG.md +4666 -0
  11. data/bundler/LICENSE.md +22 -0
  12. data/bundler/README.md +58 -0
  13. data/bundler/UPGRADING.md +222 -0
  14. data/bundler/bundler.gemspec +44 -0
  15. data/bundler/exe/bundle +38 -0
  16. data/bundler/exe/bundler +4 -0
  17. data/bundler/lib/bundler/.document +1 -0
  18. data/bundler/lib/bundler/build_metadata.rb +45 -0
  19. data/bundler/lib/bundler/capistrano.rb +22 -0
  20. data/bundler/lib/bundler/cli/add.rb +47 -0
  21. data/bundler/lib/bundler/cli/binstubs.rb +57 -0
  22. data/bundler/lib/bundler/cli/cache.rb +43 -0
  23. data/bundler/lib/bundler/cli/check.rb +40 -0
  24. data/bundler/lib/bundler/cli/clean.rb +25 -0
  25. data/bundler/lib/bundler/cli/common.rb +130 -0
  26. data/bundler/lib/bundler/cli/config.rb +203 -0
  27. data/bundler/lib/bundler/cli/console.rb +43 -0
  28. data/bundler/lib/bundler/cli/doctor.rb +157 -0
  29. data/bundler/lib/bundler/cli/exec.rb +88 -0
  30. data/bundler/lib/bundler/cli/fund.rb +36 -0
  31. data/bundler/lib/bundler/cli/gem.rb +466 -0
  32. data/bundler/lib/bundler/cli/info.rb +94 -0
  33. data/bundler/lib/bundler/cli/init.rb +51 -0
  34. data/bundler/lib/bundler/cli/inject.rb +60 -0
  35. data/bundler/lib/bundler/cli/install.rb +189 -0
  36. data/bundler/lib/bundler/cli/issue.rb +41 -0
  37. data/bundler/lib/bundler/cli/list.rb +66 -0
  38. data/bundler/lib/bundler/cli/lock.rb +73 -0
  39. data/bundler/lib/bundler/cli/open.rb +29 -0
  40. data/bundler/lib/bundler/cli/outdated.rb +297 -0
  41. data/bundler/lib/bundler/cli/platform.rb +48 -0
  42. data/bundler/lib/bundler/cli/plugin.rb +41 -0
  43. data/bundler/lib/bundler/cli/pristine.rb +52 -0
  44. data/bundler/lib/bundler/cli/remove.rb +17 -0
  45. data/bundler/lib/bundler/cli/show.rb +75 -0
  46. data/bundler/lib/bundler/cli/update.rb +123 -0
  47. data/bundler/lib/bundler/cli/viz.rb +31 -0
  48. data/bundler/lib/bundler/cli.rb +894 -0
  49. data/bundler/lib/bundler/compact_index_client/cache.rb +101 -0
  50. data/bundler/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  51. data/bundler/lib/bundler/compact_index_client/updater.rb +117 -0
  52. data/bundler/lib/bundler/compact_index_client.rb +119 -0
  53. data/bundler/lib/bundler/constants.rb +7 -0
  54. data/bundler/lib/bundler/current_ruby.rb +108 -0
  55. data/bundler/lib/bundler/definition.rb +978 -0
  56. data/bundler/lib/bundler/dependency.rb +97 -0
  57. data/bundler/lib/bundler/deployment.rb +69 -0
  58. data/bundler/lib/bundler/deprecate.rb +44 -0
  59. data/bundler/lib/bundler/digest.rb +71 -0
  60. data/bundler/lib/bundler/dsl.rb +583 -0
  61. data/bundler/lib/bundler/endpoint_specification.rb +143 -0
  62. data/bundler/lib/bundler/env.rb +150 -0
  63. data/bundler/lib/bundler/environment_preserver.rb +86 -0
  64. data/bundler/lib/bundler/errors.rb +190 -0
  65. data/bundler/lib/bundler/feature_flag.rb +53 -0
  66. data/bundler/lib/bundler/fetcher/base.rb +50 -0
  67. data/bundler/lib/bundler/fetcher/compact_index.rb +129 -0
  68. data/bundler/lib/bundler/fetcher/dependency.rb +78 -0
  69. data/bundler/lib/bundler/fetcher/downloader.rb +89 -0
  70. data/bundler/lib/bundler/fetcher/index.rb +25 -0
  71. data/bundler/lib/bundler/fetcher.rb +321 -0
  72. data/bundler/lib/bundler/force_platform.rb +18 -0
  73. data/bundler/lib/bundler/friendly_errors.rb +126 -0
  74. data/bundler/lib/bundler/gem_helper.rb +237 -0
  75. data/bundler/lib/bundler/gem_helpers.rb +124 -0
  76. data/bundler/lib/bundler/gem_tasks.rb +7 -0
  77. data/bundler/lib/bundler/gem_version_promoter.rb +145 -0
  78. data/bundler/lib/bundler/graph.rb +152 -0
  79. data/bundler/lib/bundler/index.rb +206 -0
  80. data/bundler/lib/bundler/injector.rb +287 -0
  81. data/bundler/lib/bundler/inline.rb +73 -0
  82. data/bundler/lib/bundler/installer/gem_installer.rb +84 -0
  83. data/bundler/lib/bundler/installer/parallel_installer.rb +194 -0
  84. data/bundler/lib/bundler/installer/standalone.rb +117 -0
  85. data/bundler/lib/bundler/installer.rb +267 -0
  86. data/bundler/lib/bundler/lazy_specification.rb +163 -0
  87. data/bundler/lib/bundler/lockfile_generator.rb +95 -0
  88. data/bundler/lib/bundler/lockfile_parser.rb +218 -0
  89. data/bundler/lib/bundler/man/.document +1 -0
  90. data/bundler/lib/bundler/man/bundle-add.1 +82 -0
  91. data/bundler/lib/bundler/man/bundle-add.1.ronn +58 -0
  92. data/bundler/lib/bundler/man/bundle-binstubs.1 +42 -0
  93. data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +41 -0
  94. data/bundler/lib/bundler/man/bundle-cache.1 +61 -0
  95. data/bundler/lib/bundler/man/bundle-cache.1.ronn +79 -0
  96. data/bundler/lib/bundler/man/bundle-check.1 +31 -0
  97. data/bundler/lib/bundler/man/bundle-check.1.ronn +26 -0
  98. data/bundler/lib/bundler/man/bundle-clean.1 +24 -0
  99. data/bundler/lib/bundler/man/bundle-clean.1.ronn +18 -0
  100. data/bundler/lib/bundler/man/bundle-config.1 +512 -0
  101. data/bundler/lib/bundler/man/bundle-config.1.ronn +405 -0
  102. data/bundler/lib/bundler/man/bundle-console.1 +53 -0
  103. data/bundler/lib/bundler/man/bundle-console.1.ronn +44 -0
  104. data/bundler/lib/bundler/man/bundle-doctor.1 +44 -0
  105. data/bundler/lib/bundler/man/bundle-doctor.1.ronn +33 -0
  106. data/bundler/lib/bundler/man/bundle-exec.1 +165 -0
  107. data/bundler/lib/bundler/man/bundle-exec.1.ronn +151 -0
  108. data/bundler/lib/bundler/man/bundle-gem.1 +105 -0
  109. data/bundler/lib/bundler/man/bundle-gem.1.ronn +117 -0
  110. data/bundler/lib/bundler/man/bundle-help.1 +13 -0
  111. data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
  112. data/bundler/lib/bundler/man/bundle-info.1 +20 -0
  113. data/bundler/lib/bundler/man/bundle-info.1.ronn +17 -0
  114. data/bundler/lib/bundler/man/bundle-init.1 +29 -0
  115. data/bundler/lib/bundler/man/bundle-init.1.ronn +31 -0
  116. data/bundler/lib/bundler/man/bundle-inject.1 +36 -0
  117. data/bundler/lib/bundler/man/bundle-inject.1.ronn +24 -0
  118. data/bundler/lib/bundler/man/bundle-install.1 +313 -0
  119. data/bundler/lib/bundler/man/bundle-install.1.ronn +382 -0
  120. data/bundler/lib/bundler/man/bundle-list.1 +50 -0
  121. data/bundler/lib/bundler/man/bundle-list.1.ronn +33 -0
  122. data/bundler/lib/bundler/man/bundle-lock.1 +84 -0
  123. data/bundler/lib/bundler/man/bundle-lock.1.ronn +94 -0
  124. data/bundler/lib/bundler/man/bundle-open.1 +52 -0
  125. data/bundler/lib/bundler/man/bundle-open.1.ronn +27 -0
  126. data/bundler/lib/bundler/man/bundle-outdated.1 +152 -0
  127. data/bundler/lib/bundler/man/bundle-outdated.1.ronn +105 -0
  128. data/bundler/lib/bundler/man/bundle-platform.1 +71 -0
  129. data/bundler/lib/bundler/man/bundle-platform.1.ronn +49 -0
  130. data/bundler/lib/bundler/man/bundle-plugin.1 +81 -0
  131. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +59 -0
  132. data/bundler/lib/bundler/man/bundle-pristine.1 +34 -0
  133. data/bundler/lib/bundler/man/bundle-pristine.1.ronn +34 -0
  134. data/bundler/lib/bundler/man/bundle-remove.1 +31 -0
  135. data/bundler/lib/bundler/man/bundle-remove.1.ronn +23 -0
  136. data/bundler/lib/bundler/man/bundle-show.1 +23 -0
  137. data/bundler/lib/bundler/man/bundle-show.1.ronn +21 -0
  138. data/bundler/lib/bundler/man/bundle-update.1 +394 -0
  139. data/bundler/lib/bundler/man/bundle-update.1.ronn +351 -0
  140. data/bundler/lib/bundler/man/bundle-version.1 +35 -0
  141. data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
  142. data/bundler/lib/bundler/man/bundle-viz.1 +42 -0
  143. data/bundler/lib/bundler/man/bundle-viz.1.ronn +32 -0
  144. data/bundler/lib/bundler/man/bundle.1 +141 -0
  145. data/bundler/lib/bundler/man/bundle.1.ronn +116 -0
  146. data/bundler/lib/bundler/man/gemfile.5 +747 -0
  147. data/bundler/lib/bundler/man/gemfile.5.ronn +548 -0
  148. data/bundler/lib/bundler/man/index.txt +29 -0
  149. data/bundler/lib/bundler/match_metadata.rb +13 -0
  150. data/bundler/lib/bundler/match_platform.rb +23 -0
  151. data/bundler/lib/bundler/match_remote_metadata.rb +29 -0
  152. data/bundler/lib/bundler/mirror.rb +221 -0
  153. data/bundler/lib/bundler/plugin/api/source.rb +320 -0
  154. data/bundler/lib/bundler/plugin/api.rb +81 -0
  155. data/bundler/lib/bundler/plugin/dsl.rb +53 -0
  156. data/bundler/lib/bundler/plugin/events.rb +61 -0
  157. data/bundler/lib/bundler/plugin/index.rb +193 -0
  158. data/bundler/lib/bundler/plugin/installer/git.rb +34 -0
  159. data/bundler/lib/bundler/plugin/installer/rubygems.rb +19 -0
  160. data/bundler/lib/bundler/plugin/installer.rb +112 -0
  161. data/bundler/lib/bundler/plugin/source_list.rb +31 -0
  162. data/bundler/lib/bundler/plugin.rb +359 -0
  163. data/bundler/lib/bundler/process_lock.rb +24 -0
  164. data/bundler/lib/bundler/remote_specification.rb +117 -0
  165. data/bundler/lib/bundler/resolver/base.rb +107 -0
  166. data/bundler/lib/bundler/resolver/candidate.rb +94 -0
  167. data/bundler/lib/bundler/resolver/incompatibility.rb +15 -0
  168. data/bundler/lib/bundler/resolver/package.rb +77 -0
  169. data/bundler/lib/bundler/resolver/root.rb +25 -0
  170. data/bundler/lib/bundler/resolver/spec_group.rb +82 -0
  171. data/bundler/lib/bundler/resolver.rb +462 -0
  172. data/bundler/lib/bundler/retry.rb +66 -0
  173. data/bundler/lib/bundler/ruby_dsl.rb +45 -0
  174. data/bundler/lib/bundler/ruby_version.rb +131 -0
  175. data/bundler/lib/bundler/rubygems_ext.rb +354 -0
  176. data/bundler/lib/bundler/rubygems_gem_installer.rb +187 -0
  177. data/bundler/lib/bundler/rubygems_integration.rb +562 -0
  178. data/bundler/lib/bundler/runtime.rb +307 -0
  179. data/bundler/lib/bundler/safe_marshal.rb +31 -0
  180. data/bundler/lib/bundler/self_manager.rb +170 -0
  181. data/bundler/lib/bundler/settings/validator.rb +102 -0
  182. data/bundler/lib/bundler/settings.rb +568 -0
  183. data/bundler/lib/bundler/setup.rb +30 -0
  184. data/bundler/lib/bundler/shared_helpers.rb +358 -0
  185. data/bundler/lib/bundler/similarity_detector.rb +63 -0
  186. data/bundler/lib/bundler/source/gemspec.rb +18 -0
  187. data/bundler/lib/bundler/source/git/git_proxy.rb +455 -0
  188. data/bundler/lib/bundler/source/git.rb +379 -0
  189. data/bundler/lib/bundler/source/metadata.rb +62 -0
  190. data/bundler/lib/bundler/source/path/installer.rb +53 -0
  191. data/bundler/lib/bundler/source/path.rb +260 -0
  192. data/bundler/lib/bundler/source/rubygems/remote.rb +68 -0
  193. data/bundler/lib/bundler/source/rubygems.rb +509 -0
  194. data/bundler/lib/bundler/source/rubygems_aggregate.rb +68 -0
  195. data/bundler/lib/bundler/source.rb +114 -0
  196. data/bundler/lib/bundler/source_list.rb +227 -0
  197. data/bundler/lib/bundler/source_map.rb +71 -0
  198. data/bundler/lib/bundler/spec_set.rb +219 -0
  199. data/bundler/lib/bundler/stub_specification.rb +118 -0
  200. data/bundler/lib/bundler/templates/.document +1 -0
  201. data/bundler/lib/bundler/templates/Executable +27 -0
  202. data/bundler/lib/bundler/templates/Executable.bundler +109 -0
  203. data/bundler/lib/bundler/templates/Executable.standalone +14 -0
  204. data/bundler/lib/bundler/templates/Gemfile +5 -0
  205. data/bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
  206. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +84 -0
  207. data/bundler/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
  208. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +26 -0
  209. data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
  210. data/bundler/lib/bundler/templates/newgem/README.md.tt +45 -0
  211. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +71 -0
  212. data/bundler/lib/bundler/templates/newgem/bin/console.tt +11 -0
  213. data/bundler/lib/bundler/templates/newgem/bin/setup.tt +8 -0
  214. data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
  215. data/bundler/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  216. data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
  217. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
  218. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  219. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
  220. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
  221. data/bundler/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
  222. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
  223. data/bundler/lib/bundler/templates/newgem/gitignore.tt +23 -0
  224. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
  225. data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +9 -0
  226. data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +15 -0
  227. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +51 -0
  228. data/bundler/lib/bundler/templates/newgem/rspec.tt +3 -0
  229. data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
  230. data/bundler/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  231. data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +11 -0
  232. data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -0
  233. data/bundler/lib/bundler/templates/newgem/standard.yml.tt +3 -0
  234. data/bundler/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
  235. data/bundler/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +13 -0
  236. data/bundler/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  237. data/bundler/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  238. data/bundler/lib/bundler/ui/rg_proxy.rb +19 -0
  239. data/bundler/lib/bundler/ui/shell.rb +165 -0
  240. data/bundler/lib/bundler/ui/silent.rb +85 -0
  241. data/bundler/lib/bundler/ui.rb +9 -0
  242. data/bundler/lib/bundler/uri_credentials_filter.rb +43 -0
  243. data/bundler/lib/bundler/uri_normalizer.rb +23 -0
  244. data/bundler/lib/bundler/vendor/.document +1 -0
  245. data/bundler/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  246. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +174 -0
  247. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
  248. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
  249. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +128 -0
  250. data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
  251. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +2706 -0
  252. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  253. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +41 -0
  254. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +65 -0
  255. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
  256. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1073 -0
  257. data/bundler/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  258. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  259. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
  260. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  261. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
  262. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  263. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  264. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  265. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  266. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +60 -0
  267. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  268. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  269. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
  270. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
  271. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +248 -0
  272. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  273. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  274. data/bundler/lib/bundler/vendor/thor/LICENSE.md +20 -0
  275. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +105 -0
  276. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +61 -0
  277. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +108 -0
  278. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
  279. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +373 -0
  280. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +130 -0
  281. data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +340 -0
  282. data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +825 -0
  283. data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +151 -0
  284. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +107 -0
  285. data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +106 -0
  286. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
  287. data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
  288. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
  289. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
  290. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
  291. data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  292. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +89 -0
  293. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +195 -0
  294. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +178 -0
  295. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +293 -0
  296. data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
  297. data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +72 -0
  298. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +335 -0
  299. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +388 -0
  300. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +115 -0
  301. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
  302. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +84 -0
  303. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/lcs_diff.rb +49 -0
  304. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +134 -0
  305. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
  306. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
  307. data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
  308. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +285 -0
  309. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
  310. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +663 -0
  311. data/bundler/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  312. data/bundler/lib/bundler/vendor/tsort/lib/tsort.rb +452 -0
  313. data/bundler/lib/bundler/vendor/uri/LICENSE.txt +22 -0
  314. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +729 -0
  315. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +100 -0
  316. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  317. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +1587 -0
  318. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +125 -0
  319. data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  320. data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  321. data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +22 -0
  322. data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
  323. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +539 -0
  324. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +119 -0
  325. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  326. data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
  327. data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
  328. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  329. data/bundler/lib/bundler/vendored_fileutils.rb +4 -0
  330. data/bundler/lib/bundler/vendored_persistent.rb +15 -0
  331. data/bundler/lib/bundler/vendored_pub_grub.rb +4 -0
  332. data/bundler/lib/bundler/vendored_thor.rb +8 -0
  333. data/bundler/lib/bundler/vendored_tsort.rb +4 -0
  334. data/bundler/lib/bundler/vendored_uri.rb +4 -0
  335. data/bundler/lib/bundler/version.rb +13 -0
  336. data/bundler/lib/bundler/vlad.rb +17 -0
  337. data/bundler/lib/bundler/worker.rb +117 -0
  338. data/bundler/lib/bundler/yaml_serializer.rb +93 -0
  339. data/bundler/lib/bundler.rb +654 -0
  340. data/{test/rubygems/bogussources.rb → exe/gem} +5 -2
  341. data/exe/update_rubygems +38 -0
  342. data/hide_lib_for_update/note.txt +0 -4
  343. data/lib/rubygems/available_set.rb +9 -9
  344. data/lib/rubygems/basic_specification.rb +56 -37
  345. data/lib/rubygems/bundler_version_finder.rb +77 -0
  346. data/lib/rubygems/command.rb +142 -67
  347. data/lib/rubygems/command_manager.rb +61 -25
  348. data/lib/rubygems/commands/build_command.rb +88 -17
  349. data/lib/rubygems/commands/cert_command.rb +131 -82
  350. data/lib/rubygems/commands/check_command.rb +27 -24
  351. data/lib/rubygems/commands/cleanup_command.rb +56 -37
  352. data/lib/rubygems/commands/contents_command.rb +33 -35
  353. data/lib/rubygems/commands/dependency_command.rb +52 -63
  354. data/lib/rubygems/commands/environment_command.rb +31 -13
  355. data/lib/rubygems/commands/exec_command.rb +249 -0
  356. data/lib/rubygems/commands/fetch_command.rb +36 -19
  357. data/lib/rubygems/commands/generate_index_command.rb +21 -20
  358. data/lib/rubygems/commands/help_command.rb +21 -21
  359. data/lib/rubygems/commands/info_command.rb +38 -0
  360. data/lib/rubygems/commands/install_command.rb +65 -133
  361. data/lib/rubygems/commands/list_command.rb +10 -9
  362. data/lib/rubygems/commands/lock_command.rb +11 -13
  363. data/lib/rubygems/commands/mirror_command.rb +4 -4
  364. data/lib/rubygems/commands/open_command.rb +28 -26
  365. data/lib/rubygems/commands/outdated_command.rb +6 -6
  366. data/lib/rubygems/commands/owner_command.rb +50 -26
  367. data/lib/rubygems/commands/pristine_command.rb +96 -66
  368. data/lib/rubygems/commands/push_command.rb +52 -45
  369. data/lib/rubygems/commands/query_command.rb +22 -328
  370. data/lib/rubygems/commands/rdoc_command.rb +31 -31
  371. data/lib/rubygems/commands/search_command.rb +9 -9
  372. data/lib/rubygems/commands/server_command.rb +15 -76
  373. data/lib/rubygems/commands/setup_command.rb +375 -188
  374. data/lib/rubygems/commands/signin_command.rb +34 -0
  375. data/lib/rubygems/commands/signout_command.rb +32 -0
  376. data/lib/rubygems/commands/sources_command.rb +51 -35
  377. data/lib/rubygems/commands/specification_command.rb +39 -29
  378. data/lib/rubygems/commands/stale_command.rb +5 -4
  379. data/lib/rubygems/commands/uninstall_command.rb +94 -59
  380. data/lib/rubygems/commands/unpack_command.rb +43 -52
  381. data/lib/rubygems/commands/update_command.rb +154 -96
  382. data/lib/rubygems/commands/which_command.rb +13 -16
  383. data/lib/rubygems/commands/yank_command.rb +27 -31
  384. data/lib/rubygems/compatibility.rb +8 -26
  385. data/lib/rubygems/config_file.rb +214 -119
  386. data/lib/rubygems/core_ext/kernel_gem.rb +10 -14
  387. data/lib/rubygems/core_ext/kernel_require.rb +119 -88
  388. data/lib/rubygems/core_ext/kernel_warn.rb +49 -0
  389. data/lib/rubygems/core_ext/tcpsocket_init.rb +54 -0
  390. data/lib/rubygems/defaults.rb +174 -56
  391. data/lib/rubygems/dependency.rb +66 -51
  392. data/lib/rubygems/dependency_installer.rb +70 -225
  393. data/lib/rubygems/dependency_list.rb +32 -33
  394. data/lib/rubygems/deprecate.rb +112 -17
  395. data/lib/rubygems/doctor.rb +30 -30
  396. data/lib/rubygems/errors.rb +51 -9
  397. data/lib/rubygems/exceptions.rb +64 -35
  398. data/lib/rubygems/ext/build_error.rb +3 -1
  399. data/lib/rubygems/ext/builder.rb +96 -75
  400. data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +27 -0
  401. data/lib/rubygems/ext/cargo_builder.rb +360 -0
  402. data/lib/rubygems/ext/cmake_builder.rb +6 -7
  403. data/lib/rubygems/ext/configure_builder.rb +6 -9
  404. data/lib/rubygems/ext/ext_conf_builder.rb +41 -60
  405. data/lib/rubygems/ext/rake_builder.rb +18 -21
  406. data/lib/rubygems/ext.rb +8 -7
  407. data/lib/rubygems/gem_runner.rb +22 -24
  408. data/lib/rubygems/gemcutter_utilities/webauthn_listener/response.rb +163 -0
  409. data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +105 -0
  410. data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +78 -0
  411. data/lib/rubygems/gemcutter_utilities.rb +244 -40
  412. data/lib/rubygems/indexer.rb +49 -55
  413. data/lib/rubygems/install_default_message.rb +3 -3
  414. data/lib/rubygems/install_message.rb +3 -3
  415. data/lib/rubygems/install_update_options.rb +103 -96
  416. data/lib/rubygems/installer.rb +370 -214
  417. data/lib/rubygems/installer_uninstaller_utils.rb +29 -0
  418. data/lib/rubygems/local_remote_options.rb +27 -27
  419. data/lib/rubygems/mock_gem_ui.rb +6 -9
  420. data/lib/rubygems/name_tuple.rb +16 -19
  421. data/lib/rubygems/openssl.rb +7 -0
  422. data/lib/rubygems/optparse/.document +1 -0
  423. data/lib/rubygems/optparse/COPYING +56 -0
  424. data/lib/rubygems/optparse/lib/optionparser.rb +2 -0
  425. data/lib/rubygems/optparse/lib/optparse/ac.rb +54 -0
  426. data/lib/rubygems/optparse/lib/optparse/date.rb +18 -0
  427. data/lib/rubygems/optparse/lib/optparse/kwargs.rb +22 -0
  428. data/lib/rubygems/optparse/lib/optparse/shellwords.rb +7 -0
  429. data/lib/rubygems/optparse/lib/optparse/time.rb +11 -0
  430. data/lib/rubygems/optparse/lib/optparse/uri.rb +7 -0
  431. data/lib/rubygems/optparse/lib/optparse/version.rb +71 -0
  432. data/lib/rubygems/optparse/lib/optparse.rb +2308 -0
  433. data/lib/rubygems/optparse.rb +3 -0
  434. data/lib/rubygems/package/digest_io.rb +5 -7
  435. data/lib/rubygems/package/file_source.rb +6 -8
  436. data/lib/rubygems/package/io_source.rb +6 -4
  437. data/lib/rubygems/package/old.rb +18 -27
  438. data/lib/rubygems/package/source.rb +1 -1
  439. data/lib/rubygems/package/tar_header.rb +86 -71
  440. data/lib/rubygems/package/tar_reader/entry.rb +113 -20
  441. data/lib/rubygems/package/tar_reader.rb +13 -37
  442. data/lib/rubygems/package/tar_writer.rb +28 -44
  443. data/lib/rubygems/package.rb +234 -135
  444. data/lib/rubygems/package_task.rb +6 -12
  445. data/lib/rubygems/path_support.rb +18 -12
  446. data/lib/rubygems/platform.rb +123 -77
  447. data/lib/rubygems/psych_tree.rb +3 -2
  448. data/lib/rubygems/query_utils.rb +351 -0
  449. data/lib/rubygems/rdoc.rb +4 -326
  450. data/lib/rubygems/remote_fetcher.rb +89 -171
  451. data/lib/rubygems/request/connection_pools.rb +30 -23
  452. data/lib/rubygems/request/http_pool.rb +6 -7
  453. data/lib/rubygems/request/https_pool.rb +2 -3
  454. data/lib/rubygems/request.rb +88 -41
  455. data/lib/rubygems/request_set/gem_dependency_api.rb +171 -176
  456. data/lib/rubygems/request_set/lockfile/parser.rb +39 -49
  457. data/lib/rubygems/request_set/lockfile/tokenizer.rb +15 -13
  458. data/lib/rubygems/request_set/lockfile.rb +34 -32
  459. data/lib/rubygems/request_set.rb +115 -71
  460. data/lib/rubygems/requirement.rb +72 -63
  461. data/lib/rubygems/resolver/activation_request.rb +35 -60
  462. data/lib/rubygems/resolver/api_set/gem_parser.rb +20 -0
  463. data/lib/rubygems/resolver/api_set.rb +40 -32
  464. data/lib/rubygems/resolver/api_specification.rb +37 -18
  465. data/lib/rubygems/resolver/best_set.rb +15 -17
  466. data/lib/rubygems/resolver/composed_set.rb +9 -11
  467. data/lib/rubygems/resolver/conflict.rb +18 -24
  468. data/lib/rubygems/resolver/current_set.rb +2 -4
  469. data/lib/rubygems/resolver/dependency_request.rb +8 -9
  470. data/lib/rubygems/resolver/git_set.rb +8 -10
  471. data/lib/rubygems/resolver/git_specification.rb +11 -13
  472. data/lib/rubygems/resolver/index_set.rb +10 -12
  473. data/lib/rubygems/resolver/index_specification.rb +42 -11
  474. data/lib/rubygems/resolver/installed_specification.rb +9 -11
  475. data/lib/rubygems/resolver/installer_set.rb +93 -46
  476. data/lib/rubygems/resolver/local_specification.rb +5 -7
  477. data/lib/rubygems/resolver/lock_set.rb +13 -15
  478. data/lib/rubygems/resolver/lock_specification.rb +13 -15
  479. data/lib/rubygems/resolver/molinillo/LICENSE +9 -0
  480. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
  481. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +88 -0
  482. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
  483. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
  484. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
  485. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
  486. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
  487. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
  488. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
  489. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
  490. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +164 -0
  491. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +110 -146
  492. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +83 -9
  493. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +2 -1
  494. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +13 -1
  495. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +3 -1
  496. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +552 -172
  497. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +3 -2
  498. data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +12 -6
  499. data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +6 -5
  500. data/lib/rubygems/resolver/molinillo.rb +2 -1
  501. data/lib/rubygems/resolver/requirement_list.rb +2 -2
  502. data/lib/rubygems/resolver/set.rb +3 -5
  503. data/lib/rubygems/resolver/source_set.rb +6 -7
  504. data/lib/rubygems/resolver/spec_specification.rb +16 -4
  505. data/lib/rubygems/resolver/specification.rb +25 -10
  506. data/lib/rubygems/resolver/stats.rb +1 -0
  507. data/lib/rubygems/resolver/vendor_set.rb +6 -8
  508. data/lib/rubygems/resolver/vendor_specification.rb +6 -8
  509. data/lib/rubygems/resolver.rb +120 -64
  510. data/lib/rubygems/s3_uri_signer.rb +177 -0
  511. data/lib/rubygems/safe_yaml.rb +59 -0
  512. data/lib/rubygems/security/policies.rb +49 -49
  513. data/lib/rubygems/security/policy.rb +44 -47
  514. data/lib/rubygems/security/signer.rb +86 -29
  515. data/lib/rubygems/security/trust_dir.rb +21 -23
  516. data/lib/rubygems/security.rb +111 -78
  517. data/lib/rubygems/security_option.rb +43 -0
  518. data/lib/rubygems/shellwords.rb +3 -0
  519. data/lib/rubygems/source/git.rb +40 -40
  520. data/lib/rubygems/source/installed.rb +5 -7
  521. data/lib/rubygems/source/local.rb +30 -30
  522. data/lib/rubygems/source/lock.rb +9 -7
  523. data/lib/rubygems/source/specific_file.rb +7 -8
  524. data/lib/rubygems/source/vendor.rb +3 -5
  525. data/lib/rubygems/source.rb +73 -63
  526. data/lib/rubygems/source_list.rb +14 -18
  527. data/lib/rubygems/spec_fetcher.rb +66 -78
  528. data/lib/rubygems/specification.rb +823 -1092
  529. data/lib/rubygems/specification_policy.rb +508 -0
  530. data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +21 -0
  531. data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
  532. data/lib/rubygems/stub_specification.rb +52 -53
  533. data/lib/rubygems/text.rb +40 -27
  534. data/lib/rubygems/tsort/.document +1 -0
  535. data/lib/rubygems/tsort/LICENSE.txt +22 -0
  536. data/lib/rubygems/tsort/lib/tsort.rb +452 -0
  537. data/lib/rubygems/tsort.rb +3 -0
  538. data/lib/rubygems/uninstaller.rb +149 -84
  539. data/lib/rubygems/unknown_command_spell_checker.rb +21 -0
  540. data/lib/rubygems/update_suggestion.rb +69 -0
  541. data/lib/rubygems/uri.rb +126 -0
  542. data/lib/rubygems/uri_formatter.rb +3 -6
  543. data/lib/rubygems/user_interaction.rb +95 -143
  544. data/lib/rubygems/util/licenses.rb +679 -314
  545. data/lib/rubygems/util/list.rb +2 -1
  546. data/lib/rubygems/util.rb +58 -73
  547. data/lib/rubygems/validator.rb +23 -47
  548. data/lib/rubygems/version.rb +92 -48
  549. data/lib/rubygems/version_option.rb +20 -9
  550. data/lib/rubygems/yaml_serializer.rb +93 -0
  551. data/lib/rubygems.rb +434 -346
  552. data/rubygems-update.gemspec +38 -0
  553. data/setup.rb +13 -27
  554. data/test/rubygems/alternate_cert.pem +15 -14
  555. data/test/rubygems/alternate_cert_32.pem +16 -15
  556. data/test/rubygems/alternate_key.pem +25 -25
  557. data/test/rubygems/bad_rake.rb +1 -0
  558. data/test/rubygems/bundler_test_gem.rb +424 -0
  559. data/test/rubygems/ca_cert.pem +74 -65
  560. data/test/rubygems/child_cert.pem +16 -15
  561. data/test/rubygems/child_cert_32.pem +16 -15
  562. data/test/rubygems/child_key.pem +25 -25
  563. data/test/rubygems/client.pem +103 -45
  564. data/test/rubygems/data/excon-0.7.7.gemspec.rz +0 -0
  565. data/test/rubygems/data/null-required-ruby-version.gemspec.rz +0 -0
  566. data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
  567. data/test/rubygems/data/pry-0.4.7.gemspec.rz +0 -0
  568. data/test/rubygems/encrypted_private_key.pem +26 -26
  569. data/test/rubygems/expired_cert.pem +15 -14
  570. data/test/rubygems/fake_certlib/openssl.rb +1 -0
  571. data/test/rubygems/future_cert.pem +15 -14
  572. data/test/rubygems/future_cert_32.pem +15 -14
  573. data/test/rubygems/good_rake.rb +1 -0
  574. data/test/rubygems/grandchild_cert.pem +16 -15
  575. data/test/rubygems/grandchild_cert_32.pem +16 -15
  576. data/test/rubygems/grandchild_key.pem +25 -25
  577. data/{lib/rubygems/test_case.rb → test/rubygems/helper.rb} +643 -490
  578. data/{lib → test}/rubygems/installer_test_case.rb +118 -64
  579. data/test/rubygems/invalid_issuer_cert.pem +17 -15
  580. data/test/rubygems/invalid_issuer_cert_32.pem +17 -15
  581. data/test/rubygems/invalid_key.pem +25 -25
  582. data/test/rubygems/invalid_signer_cert.pem +16 -15
  583. data/test/rubygems/invalid_signer_cert_32.pem +16 -15
  584. data/test/rubygems/invalidchild_cert.pem +16 -15
  585. data/test/rubygems/invalidchild_cert_32.pem +16 -15
  586. data/test/rubygems/invalidchild_key.pem +25 -25
  587. data/test/rubygems/multifactor_auth_utilities.rb +111 -0
  588. data/{lib → test}/rubygems/package/tar_test_case.rb +54 -26
  589. data/test/rubygems/packages/Bluebie-legs-0.6.2.gem +0 -0
  590. data/test/rubygems/packages/ascii_binder-0.1.10.1.gem +0 -0
  591. data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
  592. data/test/rubygems/plugin/exception/rubygems_plugin.rb +2 -1
  593. data/test/rubygems/plugin/load/rubygems_plugin.rb +1 -0
  594. data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +2 -1
  595. data/test/rubygems/private3072_key.pem +40 -0
  596. data/test/rubygems/private_ec_key.pem +9 -0
  597. data/test/rubygems/private_key.pem +25 -25
  598. data/test/rubygems/public3072_cert.pem +25 -0
  599. data/test/rubygems/public_cert.pem +17 -15
  600. data/test/rubygems/public_cert_32.pem +16 -15
  601. data/test/rubygems/public_key.pem +7 -7
  602. data/test/rubygems/rubygems/commands/crash_command.rb +1 -2
  603. data/test/rubygems/rubygems_plugin.rb +7 -5
  604. data/test/rubygems/simple_gem.rb +1 -0
  605. data/test/rubygems/specifications/bar-0.0.2.gemspec +1 -1
  606. data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +14 -0
  607. data/test/rubygems/ssl_cert.pem +78 -17
  608. data/test/rubygems/ssl_key.pem +25 -13
  609. data/test/rubygems/test_bundled_ca.rb +45 -43
  610. data/test/rubygems/test_config.rb +13 -9
  611. data/test/rubygems/test_deprecate.rb +91 -10
  612. data/test/rubygems/test_exit.rb +17 -0
  613. data/test/rubygems/test_gem.rb +917 -797
  614. data/test/rubygems/test_gem_available_set.rb +25 -25
  615. data/test/rubygems/test_gem_bundler_version_finder.rb +127 -0
  616. data/test/rubygems/test_gem_command.rb +195 -40
  617. data/test/rubygems/test_gem_command_manager.rb +182 -46
  618. data/test/rubygems/test_gem_commands_build_command.rb +646 -28
  619. data/test/rubygems/test_gem_commands_cert_command.rb +321 -126
  620. data/test/rubygems/test_gem_commands_check_command.rb +11 -12
  621. data/test/rubygems/test_gem_commands_cleanup_command.rb +147 -52
  622. data/test/rubygems/test_gem_commands_contents_command.rb +75 -44
  623. data/test/rubygems/test_gem_commands_dependency_command.rb +61 -63
  624. data/test/rubygems/test_gem_commands_environment_command.rb +62 -47
  625. data/test/rubygems/test_gem_commands_exec_command.rb +857 -0
  626. data/test/rubygems/test_gem_commands_fetch_command.rb +164 -33
  627. data/test/rubygems/test_gem_commands_generate_index_command.rb +39 -9
  628. data/test/rubygems/test_gem_commands_help_command.rb +36 -17
  629. data/test/rubygems/test_gem_commands_info_command.rb +70 -0
  630. data/test/rubygems/test_gem_commands_install_command.rb +736 -150
  631. data/test/rubygems/test_gem_commands_list_command.rb +6 -7
  632. data/test/rubygems/test_gem_commands_lock_command.rb +12 -14
  633. data/test/rubygems/test_gem_commands_mirror.rb +4 -4
  634. data/test/rubygems/test_gem_commands_open_command.rb +47 -16
  635. data/test/rubygems/test_gem_commands_outdated_command.rb +25 -8
  636. data/test/rubygems/test_gem_commands_owner_command.rb +368 -70
  637. data/test/rubygems/test_gem_commands_pristine_command.rb +318 -101
  638. data/test/rubygems/test_gem_commands_push_command.rb +331 -58
  639. data/test/rubygems/test_gem_commands_query_command.rb +329 -128
  640. data/test/rubygems/test_gem_commands_search_command.rb +3 -5
  641. data/test/rubygems/test_gem_commands_server_command.rb +7 -47
  642. data/test/rubygems/test_gem_commands_setup_command.rb +404 -66
  643. data/test/rubygems/test_gem_commands_signin_command.rb +259 -0
  644. data/test/rubygems/test_gem_commands_signout_command.rb +30 -0
  645. data/test/rubygems/test_gem_commands_sources_command.rb +316 -31
  646. data/test/rubygems/test_gem_commands_specification_command.rb +82 -56
  647. data/test/rubygems/test_gem_commands_stale_command.rb +9 -9
  648. data/test/rubygems/test_gem_commands_uninstall_command.rb +347 -88
  649. data/test/rubygems/test_gem_commands_unpack_command.rb +49 -34
  650. data/test/rubygems/test_gem_commands_update_command.rb +429 -107
  651. data/test/rubygems/test_gem_commands_which_command.rb +13 -15
  652. data/test/rubygems/test_gem_commands_yank_command.rb +227 -28
  653. data/test/rubygems/test_gem_config_file.rb +168 -108
  654. data/test/rubygems/test_gem_dependency.rb +112 -76
  655. data/test/rubygems/test_gem_dependency_installer.rb +346 -391
  656. data/test/rubygems/test_gem_dependency_list.rb +68 -63
  657. data/test/rubygems/test_gem_dependency_resolution_error.rb +6 -8
  658. data/test/rubygems/test_gem_doctor.rb +75 -49
  659. data/test/rubygems/test_gem_ext_builder.rb +121 -125
  660. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/.gitignore +1 -0
  661. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/custom_name.gemspec +10 -0
  662. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.lock +249 -0
  663. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.toml +10 -0
  664. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/src/lib.rs +27 -0
  665. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/lib/custom_name.rb +3 -0
  666. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/.gitignore +1 -0
  667. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +249 -0
  668. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +10 -0
  669. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/rust_ruby_example.gemspec +10 -0
  670. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +51 -0
  671. data/test/rubygems/test_gem_ext_cargo_builder.rb +167 -0
  672. data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +34 -0
  673. data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +60 -0
  674. data/test/rubygems/test_gem_ext_cmake_builder.rb +33 -36
  675. data/test/rubygems/test_gem_ext_configure_builder.rb +25 -32
  676. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +94 -76
  677. data/test/rubygems/test_gem_ext_rake_builder.rb +79 -31
  678. data/test/rubygems/test_gem_gem_runner.rb +59 -9
  679. data/test/rubygems/test_gem_gemcutter_utilities.rb +210 -84
  680. data/test/rubygems/test_gem_impossible_dependencies_error.rb +5 -7
  681. data/test/rubygems/test_gem_indexer.rb +121 -107
  682. data/test/rubygems/test_gem_install_update_options.rb +65 -54
  683. data/test/rubygems/test_gem_installer.rb +1517 -557
  684. data/test/rubygems/test_gem_local_remote_options.rb +14 -15
  685. data/test/rubygems/test_gem_name_tuple.rb +5 -7
  686. data/test/rubygems/test_gem_package.rb +673 -243
  687. data/test/rubygems/test_gem_package_old.rb +58 -57
  688. data/test/rubygems/test_gem_package_tar_header.rb +129 -50
  689. data/test/rubygems/test_gem_package_tar_reader.rb +71 -11
  690. data/test/rubygems/test_gem_package_tar_reader_entry.rb +229 -21
  691. data/test/rubygems/test_gem_package_tar_writer.rb +168 -101
  692. data/test/rubygems/test_gem_package_task.rb +59 -25
  693. data/test/rubygems/test_gem_path_support.rb +49 -31
  694. data/test/rubygems/test_gem_platform.rb +393 -204
  695. data/test/rubygems/test_gem_rdoc.rb +23 -156
  696. data/test/rubygems/test_gem_remote_fetcher.rb +580 -404
  697. data/test/rubygems/test_gem_request.rb +270 -86
  698. data/test/rubygems/test_gem_request_connection_pools.rb +57 -35
  699. data/test/rubygems/test_gem_request_set.rb +192 -115
  700. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +300 -278
  701. data/test/rubygems/test_gem_request_set_lockfile.rb +95 -96
  702. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +73 -78
  703. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +138 -137
  704. data/test/rubygems/test_gem_requirement.rb +175 -57
  705. data/test/rubygems/test_gem_resolver.rb +257 -113
  706. data/test/rubygems/test_gem_resolver_activation_request.rb +10 -41
  707. data/test/rubygems/test_gem_resolver_api_set.rb +80 -79
  708. data/test/rubygems/test_gem_resolver_api_specification.rb +64 -42
  709. data/test/rubygems/test_gem_resolver_best_set.rb +44 -23
  710. data/test/rubygems/test_gem_resolver_composed_set.rb +2 -4
  711. data/test/rubygems/test_gem_resolver_conflict.rb +13 -19
  712. data/test/rubygems/test_gem_resolver_dependency_request.rb +16 -18
  713. data/test/rubygems/test_gem_resolver_git_set.rb +23 -25
  714. data/test/rubygems/test_gem_resolver_git_specification.rb +23 -23
  715. data/test/rubygems/test_gem_resolver_index_set.rb +15 -17
  716. data/test/rubygems/test_gem_resolver_index_specification.rb +22 -19
  717. data/test/rubygems/test_gem_resolver_installed_specification.rb +6 -9
  718. data/test/rubygems/test_gem_resolver_installer_set.rb +110 -48
  719. data/test/rubygems/test_gem_resolver_local_specification.rb +8 -10
  720. data/test/rubygems/test_gem_resolver_lock_set.rb +16 -18
  721. data/test/rubygems/test_gem_resolver_lock_specification.rb +18 -20
  722. data/test/rubygems/test_gem_resolver_requirement_list.rb +2 -4
  723. data/test/rubygems/test_gem_resolver_specification.rb +10 -12
  724. data/test/rubygems/test_gem_resolver_vendor_set.rb +10 -12
  725. data/test/rubygems/test_gem_resolver_vendor_specification.rb +11 -13
  726. data/test/rubygems/test_gem_security.rb +116 -82
  727. data/test/rubygems/test_gem_security_policy.rb +128 -134
  728. data/test/rubygems/test_gem_security_signer.rb +58 -49
  729. data/test/rubygems/test_gem_security_trust_dir.rb +19 -21
  730. data/test/rubygems/test_gem_silent_ui.rb +48 -42
  731. data/test/rubygems/test_gem_source.rb +73 -61
  732. data/test/rubygems/test_gem_source_fetch_problem.rb +23 -6
  733. data/test/rubygems/test_gem_source_git.rb +79 -78
  734. data/test/rubygems/test_gem_source_installed.rb +17 -19
  735. data/test/rubygems/test_gem_source_list.rb +6 -5
  736. data/test/rubygems/test_gem_source_local.rb +16 -16
  737. data/test/rubygems/test_gem_source_lock.rb +32 -34
  738. data/test/rubygems/test_gem_source_specific_file.rb +19 -19
  739. data/test/rubygems/test_gem_source_subpath_problem.rb +50 -0
  740. data/test/rubygems/test_gem_source_vendor.rb +14 -16
  741. data/test/rubygems/test_gem_spec_fetcher.rb +89 -62
  742. data/test/rubygems/test_gem_specification.rb +1441 -1104
  743. data/test/rubygems/test_gem_stream_ui.rb +71 -55
  744. data/test/rubygems/test_gem_stub_specification.rb +102 -41
  745. data/test/rubygems/test_gem_text.rb +27 -1
  746. data/test/rubygems/test_gem_uninstaller.rb +289 -99
  747. data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +4 -6
  748. data/test/rubygems/test_gem_update_suggestion.rb +209 -0
  749. data/test/rubygems/test_gem_uri.rb +41 -0
  750. data/test/rubygems/test_gem_uri_formatter.rb +15 -17
  751. data/test/rubygems/test_gem_util.rb +68 -17
  752. data/test/rubygems/test_gem_validator.rb +12 -16
  753. data/test/rubygems/test_gem_version.rb +123 -40
  754. data/test/rubygems/test_gem_version_option.rb +30 -17
  755. data/test/rubygems/test_kernel.rb +75 -37
  756. data/test/rubygems/test_project_sanity.rb +49 -0
  757. data/test/rubygems/test_remote_fetch_error.rb +20 -0
  758. data/test/rubygems/test_require.rb +527 -117
  759. data/test/rubygems/test_rubygems.rb +76 -0
  760. data/test/rubygems/test_webauthn_listener.rb +143 -0
  761. data/test/rubygems/test_webauthn_listener_response.rb +93 -0
  762. data/test/rubygems/test_webauthn_poller.rb +124 -0
  763. data/{lib/rubygems/test_utilities.rb → test/rubygems/utilities.rb} +135 -83
  764. data/test/rubygems/wrong_key_cert.pem +16 -15
  765. data/test/rubygems/wrong_key_cert_32.pem +16 -15
  766. data/test/test_changelog_generator.rb +17 -0
  767. metadata +513 -189
  768. data/.autotest +0 -71
  769. data/.document +0 -5
  770. data/.travis.yml +0 -46
  771. data/CONTRIBUTING.rdoc +0 -129
  772. data/CVE-2013-4287.txt +0 -35
  773. data/CVE-2013-4363.txt +0 -45
  774. data/CVE-2015-3900.txt +0 -40
  775. data/History.txt +0 -3094
  776. data/MAINTAINERS.md +0 -5
  777. data/POLICIES.rdoc +0 -61
  778. data/README.rdoc +0 -54
  779. data/Rakefile +0 -449
  780. data/UPGRADING.rdoc +0 -92
  781. data/appveyor.yml +0 -36
  782. data/bin/gem +0 -25
  783. data/bin/update_rubygems +0 -37
  784. data/lib/gauntlet_rubygems.rb +0 -51
  785. data/lib/rubygems/psych_additions.rb +0 -10
  786. data/lib/rubygems/server.rb +0 -869
  787. data/lib/rubygems/source_local.rb +0 -6
  788. data/lib/rubygems/source_specific_file.rb +0 -5
  789. data/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
  790. data/lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem +0 -32
  791. data/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
  792. data/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
  793. data/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
  794. data/lib/rubygems/ssl_certs/GeoTrustGlobalCA.pem +0 -20
  795. data/lib/rubygems/syck_hack.rb +0 -77
  796. data/lib/ubygems.rb +0 -11
  797. data/test/rubygems/data/null-type.gemspec.rz +0 -0
  798. data/test/rubygems/fix_openssl_warnings.rb +0 -13
  799. data/test/rubygems/test_gem_server.rb +0 -409
  800. data/util/CL2notes +0 -56
  801. data/util/create_certs.rb +0 -157
  802. data/util/create_encrypted_key.rb +0 -17
  803. data/util/generate_spdx_license_list.rb +0 -51
  804. data/util/update_bundled_ca_certificates.rb +0 -118
@@ -0,0 +1,508 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "user_interaction"
4
+
5
+ class Gem::SpecificationPolicy
6
+ include Gem::UserInteraction
7
+
8
+ VALID_NAME_PATTERN = /\A[a-zA-Z0-9\.\-\_]+\z/.freeze # :nodoc:
9
+
10
+ SPECIAL_CHARACTERS = /\A[#{Regexp.escape('.-_')}]+/.freeze # :nodoc:
11
+
12
+ VALID_URI_PATTERN = %r{\Ahttps?:\/\/([^\s:@]+:[^\s:@]*@)?[A-Za-z\d\-]+(\.[A-Za-z\d\-]+)+\.?(:\d{1,5})?([\/?]\S*)?\z}.freeze # :nodoc:
13
+
14
+ METADATA_LINK_KEYS = %w[
15
+ bug_tracker_uri
16
+ changelog_uri
17
+ documentation_uri
18
+ homepage_uri
19
+ mailing_list_uri
20
+ source_code_uri
21
+ wiki_uri
22
+ funding_uri
23
+ ].freeze # :nodoc:
24
+
25
+ def initialize(specification)
26
+ @warnings = 0
27
+
28
+ @specification = specification
29
+ end
30
+
31
+ ##
32
+ # If set to true, run packaging-specific checks, as well.
33
+
34
+ attr_accessor :packaging
35
+
36
+ ##
37
+ # Does a sanity check on the specification.
38
+ #
39
+ # Raises InvalidSpecificationException if the spec does not pass the
40
+ # checks.
41
+ #
42
+ # It also performs some validations that do not raise but print warning
43
+ # messages instead.
44
+
45
+ def validate(strict = false)
46
+ validate_required!
47
+
48
+ validate_optional(strict) if packaging || strict
49
+
50
+ true
51
+ end
52
+
53
+ ##
54
+ # Does a sanity check on the specification.
55
+ #
56
+ # Raises InvalidSpecificationException if the spec does not pass the
57
+ # checks.
58
+ #
59
+ # Only runs checks that are considered necessary for the specification to be
60
+ # functional.
61
+
62
+ def validate_required!
63
+ validate_nil_attributes
64
+
65
+ validate_rubygems_version
66
+
67
+ validate_required_attributes
68
+
69
+ validate_name
70
+
71
+ validate_require_paths
72
+
73
+ @specification.keep_only_files_and_directories
74
+
75
+ validate_non_files
76
+
77
+ validate_self_inclusion_in_files_list
78
+
79
+ validate_specification_version
80
+
81
+ validate_platform
82
+
83
+ validate_array_attributes
84
+
85
+ validate_authors_field
86
+
87
+ validate_metadata
88
+
89
+ validate_licenses_length
90
+
91
+ validate_lazy_metadata
92
+
93
+ validate_duplicate_dependencies
94
+ end
95
+
96
+ def validate_optional(strict)
97
+ validate_licenses
98
+
99
+ validate_permissions
100
+
101
+ validate_values
102
+
103
+ validate_dependencies
104
+
105
+ validate_extensions
106
+
107
+ validate_removed_attributes
108
+
109
+ if @warnings > 0
110
+ if strict
111
+ error "specification has warnings"
112
+ else
113
+ alert_warning help_text
114
+ end
115
+ end
116
+ end
117
+
118
+ ##
119
+ # Implementation for Specification#validate_metadata
120
+
121
+ def validate_metadata
122
+ metadata = @specification.metadata
123
+
124
+ unless Hash === metadata
125
+ error "metadata must be a hash"
126
+ end
127
+
128
+ metadata.each do |key, value|
129
+ entry = "metadata['#{key}']"
130
+ unless key.is_a?(String)
131
+ error "metadata keys must be a String"
132
+ end
133
+
134
+ if key.size > 128
135
+ error "metadata key is too large (#{key.size} > 128)"
136
+ end
137
+
138
+ unless value.is_a?(String)
139
+ error "#{entry} value must be a String"
140
+ end
141
+
142
+ if value.size > 1024
143
+ error "#{entry} value is too large (#{value.size} > 1024)"
144
+ end
145
+
146
+ next unless METADATA_LINK_KEYS.include? key
147
+ unless VALID_URI_PATTERN.match?(value)
148
+ error "#{entry} has invalid link: #{value.inspect}"
149
+ end
150
+ end
151
+ end
152
+
153
+ ##
154
+ # Checks that no duplicate dependencies are specified.
155
+
156
+ def validate_duplicate_dependencies # :nodoc:
157
+ # NOTE: see REFACTOR note in Gem::Dependency about types - this might be brittle
158
+ seen = Gem::Dependency::TYPES.inject({}) {|types, type| types.merge({ type => {} }) }
159
+
160
+ error_messages = []
161
+ @specification.dependencies.each do |dep|
162
+ if prev = seen[dep.type][dep.name]
163
+ error_messages << <<-MESSAGE
164
+ duplicate dependency on #{dep}, (#{prev.requirement}) use:
165
+ add_#{dep.type}_dependency '#{dep.name}', '#{dep.requirement}', '#{prev.requirement}'
166
+ MESSAGE
167
+ end
168
+
169
+ seen[dep.type][dep.name] = dep
170
+ end
171
+ if error_messages.any?
172
+ error error_messages.join
173
+ end
174
+ end
175
+
176
+ ##
177
+ # Checks that the gem does not depend on itself.
178
+ # Checks that dependencies use requirements as we recommend. Warnings are
179
+ # issued when dependencies are open-ended or overly strict for semantic
180
+ # versioning.
181
+
182
+ def validate_dependencies # :nodoc:
183
+ warning_messages = []
184
+ @specification.dependencies.each do |dep|
185
+ if dep.name == @specification.name # warn on self reference
186
+ warning_messages << "Self referencing dependency is unnecessary and strongly discouraged."
187
+ end
188
+
189
+ prerelease_dep = dep.requirements_list.any? do |req|
190
+ Gem::Requirement.new(req).prerelease?
191
+ end
192
+
193
+ warning_messages << "prerelease dependency on #{dep} is not recommended" if
194
+ prerelease_dep && !@specification.version.prerelease?
195
+
196
+ open_ended = dep.requirement.requirements.all? do |op, version|
197
+ !version.prerelease? && (op == ">" || op == ">=")
198
+ end
199
+
200
+ next unless open_ended
201
+ op, dep_version = dep.requirement.requirements.first
202
+
203
+ segments = dep_version.segments
204
+
205
+ base = segments.first 2
206
+
207
+ recommendation = if (op == ">" || op == ">=") && segments == [0]
208
+ " use a bounded requirement, such as '~> x.y'"
209
+ else
210
+ bugfix = if op == ">"
211
+ ", '> #{dep_version}'"
212
+ elsif op == ">=" && base != segments
213
+ ", '>= #{dep_version}'"
214
+ end
215
+
216
+ " if #{dep.name} is semantically versioned, use:\n" \
217
+ " add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join "."}'#{bugfix}"
218
+ end
219
+
220
+ warning_messages << ["open-ended dependency on #{dep} is not recommended", recommendation].join("\n") + "\n"
221
+ end
222
+ if warning_messages.any?
223
+ warning_messages.each {|warning_message| warning warning_message }
224
+ end
225
+ end
226
+
227
+ ##
228
+ # Issues a warning for each file to be packaged which is world-readable.
229
+ #
230
+ # Implementation for Specification#validate_permissions
231
+
232
+ def validate_permissions
233
+ return if Gem.win_platform?
234
+
235
+ @specification.files.each do |file|
236
+ next unless File.file?(file)
237
+ next if File.stat(file).mode & 0o444 == 0o444
238
+ warning "#{file} is not world-readable"
239
+ end
240
+
241
+ @specification.executables.each do |name|
242
+ exec = File.join @specification.bindir, name
243
+ next unless File.file?(exec)
244
+ next if File.stat(exec).executable?
245
+ warning "#{exec} is not executable"
246
+ end
247
+ end
248
+
249
+ private
250
+
251
+ def validate_nil_attributes
252
+ nil_attributes = Gem::Specification.non_nil_attributes.select do |attrname|
253
+ @specification.instance_variable_get("@#{attrname}").nil?
254
+ end
255
+ return if nil_attributes.empty?
256
+ error "#{nil_attributes.join ", "} must not be nil"
257
+ end
258
+
259
+ def validate_rubygems_version
260
+ return unless packaging
261
+
262
+ rubygems_version = @specification.rubygems_version
263
+
264
+ return if rubygems_version == Gem::VERSION
265
+
266
+ error "expected RubyGems version #{Gem::VERSION}, was #{rubygems_version}"
267
+ end
268
+
269
+ def validate_required_attributes
270
+ Gem::Specification.required_attributes.each do |symbol|
271
+ unless @specification.send symbol
272
+ error "missing value for attribute #{symbol}"
273
+ end
274
+ end
275
+ end
276
+
277
+ def validate_name
278
+ name = @specification.name
279
+
280
+ if !name.is_a?(String)
281
+ error "invalid value for attribute name: \"#{name.inspect}\" must be a string"
282
+ elsif !/[a-zA-Z]/.match?(name)
283
+ error "invalid value for attribute name: #{name.dump} must include at least one letter"
284
+ elsif !VALID_NAME_PATTERN.match?(name)
285
+ error "invalid value for attribute name: #{name.dump} can only include letters, numbers, dashes, and underscores"
286
+ elsif SPECIAL_CHARACTERS.match?(name)
287
+ error "invalid value for attribute name: #{name.dump} can not begin with a period, dash, or underscore"
288
+ end
289
+ end
290
+
291
+ def validate_require_paths
292
+ return unless @specification.raw_require_paths.empty?
293
+
294
+ error "specification must have at least one require_path"
295
+ end
296
+
297
+ def validate_non_files
298
+ return unless packaging
299
+
300
+ non_files = @specification.files.reject {|x| File.file?(x) || File.symlink?(x) }
301
+
302
+ unless non_files.empty?
303
+ error "[\"#{non_files.join '", "'}\"] are not files"
304
+ end
305
+ end
306
+
307
+ def validate_self_inclusion_in_files_list
308
+ file_name = @specification.file_name
309
+
310
+ return unless @specification.files.include?(file_name)
311
+
312
+ error "#{@specification.full_name} contains itself (#{file_name}), check your files list"
313
+ end
314
+
315
+ def validate_specification_version
316
+ return if @specification.specification_version.is_a?(Integer)
317
+
318
+ error "specification_version must be an Integer (did you mean version?)"
319
+ end
320
+
321
+ def validate_platform
322
+ platform = @specification.platform
323
+
324
+ case platform
325
+ when Gem::Platform, Gem::Platform::RUBY # ok
326
+ else
327
+ error "invalid platform #{platform.inspect}, see Gem::Platform"
328
+ end
329
+ end
330
+
331
+ def validate_array_attributes
332
+ Gem::Specification.array_attributes.each do |field|
333
+ validate_array_attribute(field)
334
+ end
335
+ end
336
+
337
+ def validate_array_attribute(field)
338
+ val = @specification.send(field)
339
+ klass = case field
340
+ when :dependencies then
341
+ Gem::Dependency
342
+ else
343
+ String
344
+ end
345
+
346
+ unless Array === val && val.all? {|x| x.is_a?(klass) || (field == :licenses && x.nil?) }
347
+ error "#{field} must be an Array of #{klass}"
348
+ end
349
+ end
350
+
351
+ def validate_authors_field
352
+ return unless @specification.authors.empty?
353
+
354
+ error "authors may not be empty"
355
+ end
356
+
357
+ def validate_licenses_length
358
+ licenses = @specification.licenses
359
+
360
+ licenses.each do |license|
361
+ next if license.nil?
362
+
363
+ if license.length > 64
364
+ error "each license must be 64 characters or less"
365
+ end
366
+ end
367
+ end
368
+
369
+ def validate_licenses
370
+ licenses = @specification.licenses
371
+
372
+ licenses.each do |license|
373
+ next if Gem::Licenses.match?(license) || license.nil?
374
+ suggestions = Gem::Licenses.suggestions(license)
375
+ message = <<-WARNING
376
+ license value '#{license}' is invalid. Use a license identifier from
377
+ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard license,
378
+ or set it to nil if you don't want to specify a license.
379
+ WARNING
380
+ message += "Did you mean #{suggestions.map {|s| "'#{s}'" }.join(", ")}?\n" unless suggestions.nil?
381
+ warning(message)
382
+ end
383
+
384
+ warning <<-WARNING if licenses.empty?
385
+ licenses is empty, but is recommended. Use a license identifier from
386
+ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard license,
387
+ or set it to nil if you don't want to specify a license.
388
+ WARNING
389
+ end
390
+
391
+ LAZY = '"FIxxxXME" or "TOxxxDO"'.gsub(/xxx/, "")
392
+ LAZY_PATTERN = /\AFI XME|\ATO DO/x.freeze
393
+ HOMEPAGE_URI_PATTERN = /\A[a-z][a-z\d+.-]*:/i.freeze
394
+
395
+ def validate_lazy_metadata
396
+ unless @specification.authors.grep(LAZY_PATTERN).empty?
397
+ error "#{LAZY} is not an author"
398
+ end
399
+
400
+ unless Array(@specification.email).grep(LAZY_PATTERN).empty?
401
+ error "#{LAZY} is not an email"
402
+ end
403
+
404
+ if LAZY_PATTERN.match?(@specification.description)
405
+ error "#{LAZY} is not a description"
406
+ end
407
+
408
+ if LAZY_PATTERN.match?(@specification.summary)
409
+ error "#{LAZY} is not a summary"
410
+ end
411
+
412
+ homepage = @specification.homepage
413
+
414
+ # Make sure a homepage is valid HTTP/HTTPS URI
415
+ if homepage && !homepage.empty?
416
+ require "uri"
417
+ begin
418
+ homepage_uri = URI.parse(homepage)
419
+ unless [URI::HTTP, URI::HTTPS].member? homepage_uri.class
420
+ error "\"#{homepage}\" is not a valid HTTP URI"
421
+ end
422
+ rescue URI::InvalidURIError
423
+ error "\"#{homepage}\" is not a valid HTTP URI"
424
+ end
425
+ end
426
+ end
427
+
428
+ def validate_values
429
+ %w[author homepage summary files].each do |attribute|
430
+ validate_attribute_present(attribute)
431
+ end
432
+
433
+ if @specification.description == @specification.summary
434
+ warning "description and summary are identical"
435
+ end
436
+
437
+ # TODO: raise at some given date
438
+ warning "deprecated autorequire specified" if @specification.autorequire
439
+
440
+ @specification.executables.each do |executable|
441
+ validate_shebang_line_in(executable)
442
+ end
443
+
444
+ @specification.files.select {|f| File.symlink?(f) }.each do |file|
445
+ warning "#{file} is a symlink, which is not supported on all platforms"
446
+ end
447
+ end
448
+
449
+ def validate_attribute_present(attribute)
450
+ value = @specification.send attribute
451
+ warning("no #{attribute} specified") if value.nil? || value.empty?
452
+ end
453
+
454
+ def validate_shebang_line_in(executable)
455
+ executable_path = File.join(@specification.bindir, executable)
456
+ return if File.read(executable_path, 2) == "#!"
457
+
458
+ warning "#{executable_path} is missing #! line"
459
+ end
460
+
461
+ def validate_removed_attributes # :nodoc:
462
+ @specification.removed_method_calls.each do |attr|
463
+ warning("#{attr} is deprecated and ignored. Please remove this from your gemspec to ensure that your gem continues to build in the future.")
464
+ end
465
+ end
466
+
467
+ def validate_extensions # :nodoc:
468
+ require_relative "ext"
469
+ builder = Gem::Ext::Builder.new(@specification)
470
+
471
+ validate_rake_extensions(builder)
472
+ validate_rust_extensions(builder)
473
+ end
474
+
475
+ def validate_rust_extensions(builder) # :nodoc:
476
+ rust_extension = @specification.extensions.any? {|s| builder.builder_for(s).is_a? Gem::Ext::CargoBuilder }
477
+ missing_cargo_lock = !@specification.files.any? {|f| f.end_with?("Cargo.lock") }
478
+
479
+ error <<-ERROR if rust_extension && missing_cargo_lock
480
+ 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.
481
+ ERROR
482
+ end
483
+
484
+ def validate_rake_extensions(builder) # :nodoc:
485
+ rake_extension = @specification.extensions.any? {|s| builder.builder_for(s) == Gem::Ext::RakeBuilder }
486
+ rake_dependency = @specification.dependencies.any? {|d| d.name == "rake" }
487
+
488
+ warning <<-WARNING if rake_extension && !rake_dependency
489
+ You have specified rake based extension, but rake is not added as dependency. It is recommended to add rake as a dependency in gemspec since there's no guarantee rake will be already installed.
490
+ WARNING
491
+ end
492
+
493
+ def warning(statement) # :nodoc:
494
+ @warnings += 1
495
+
496
+ alert_warning statement
497
+ end
498
+
499
+ def error(statement) # :nodoc:
500
+ raise Gem::InvalidSpecificationException, statement
501
+ ensure
502
+ alert_warning help_text
503
+ end
504
+
505
+ def help_text # :nodoc:
506
+ "See https://guides.rubygems.org/specification-reference/ for help"
507
+ end
508
+ end
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
3
+ A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
4
+ b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
5
+ MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
6
+ YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
7
+ aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
8
+ jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
9
+ xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
10
+ 1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
11
+ snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
12
+ U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
13
+ 9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
14
+ BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
15
+ AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
16
+ yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
17
+ 38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
18
+ AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
19
+ DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
20
+ HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
21
+ -----END CERTIFICATE-----
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
3
+ A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
4
+ Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
5
+ MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
6
+ A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
7
+ hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
8
+ RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
9
+ gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
10
+ KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
11
+ QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
12
+ XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
13
+ DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
14
+ LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
15
+ RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
16
+ jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
17
+ 6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
18
+ mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
19
+ Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
20
+ WD9f
21
+ -----END CERTIFICATE-----