rubygems-update 3.5.3 → 3.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (437) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1410 -686
  3. data/CODE_OF_CONDUCT.md +79 -28
  4. data/CONTRIBUTING.md +4 -226
  5. data/Manifest.txt +107 -83
  6. data/README.md +16 -11
  7. data/SECURITY.md +7 -0
  8. data/bundler/CHANGELOG.md +1525 -931
  9. data/bundler/README.md +9 -9
  10. data/bundler/bundler.gemspec +2 -2
  11. data/bundler/lib/bundler/build_metadata.rb +10 -11
  12. data/bundler/lib/bundler/checksum.rb +22 -12
  13. data/bundler/lib/bundler/cli/add.rb +3 -1
  14. data/bundler/lib/bundler/cli/binstubs.rb +1 -1
  15. data/bundler/lib/bundler/cli/check.rb +3 -3
  16. data/bundler/lib/bundler/cli/common.rb +1 -1
  17. data/bundler/lib/bundler/cli/config.rb +2 -2
  18. data/bundler/lib/bundler/cli/console.rb +8 -10
  19. data/bundler/lib/bundler/cli/doctor/diagnose.rb +167 -0
  20. data/bundler/lib/bundler/cli/doctor/ssl.rb +249 -0
  21. data/bundler/lib/bundler/cli/doctor.rb +27 -151
  22. data/bundler/lib/bundler/cli/exec.rb +1 -0
  23. data/bundler/lib/bundler/cli/fund.rb +1 -1
  24. data/bundler/lib/bundler/cli/gem.rb +74 -46
  25. data/bundler/lib/bundler/cli/info.rb +6 -6
  26. data/bundler/lib/bundler/cli/inject.rb +3 -3
  27. data/bundler/lib/bundler/cli/install.rb +19 -10
  28. data/bundler/lib/bundler/cli/issue.rb +3 -3
  29. data/bundler/lib/bundler/cli/lock.rb +32 -11
  30. data/bundler/lib/bundler/cli/outdated.rb +23 -23
  31. data/bundler/lib/bundler/cli/plugin.rb +3 -2
  32. data/bundler/lib/bundler/cli/pristine.rb +1 -1
  33. data/bundler/lib/bundler/cli/show.rb +3 -3
  34. data/bundler/lib/bundler/cli/update.rb +3 -3
  35. data/bundler/lib/bundler/cli.rb +75 -145
  36. data/bundler/lib/bundler/compact_index_client/cache.rb +48 -73
  37. data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -5
  38. data/bundler/lib/bundler/compact_index_client/parser.rb +84 -0
  39. data/bundler/lib/bundler/compact_index_client/updater.rb +6 -16
  40. data/bundler/lib/bundler/compact_index_client.rb +52 -85
  41. data/bundler/lib/bundler/constants.rb +8 -1
  42. data/bundler/lib/bundler/current_ruby.rb +48 -34
  43. data/bundler/lib/bundler/definition.rb +501 -328
  44. data/bundler/lib/bundler/dependency.rb +93 -47
  45. data/bundler/lib/bundler/dsl.rb +147 -103
  46. data/bundler/lib/bundler/endpoint_specification.rb +30 -3
  47. data/bundler/lib/bundler/env.rb +1 -1
  48. data/bundler/lib/bundler/environment_preserver.rb +5 -23
  49. data/bundler/lib/bundler/errors.rb +53 -5
  50. data/bundler/lib/bundler/feature_flag.rb +18 -18
  51. data/bundler/lib/bundler/fetcher/compact_index.rb +16 -25
  52. data/bundler/lib/bundler/fetcher/dependency.rb +2 -1
  53. data/bundler/lib/bundler/fetcher/downloader.rb +34 -8
  54. data/bundler/lib/bundler/fetcher.rb +63 -26
  55. data/bundler/lib/bundler/force_platform.rb +0 -2
  56. data/bundler/lib/bundler/friendly_errors.rb +3 -2
  57. data/bundler/lib/bundler/gem_helper.rb +1 -1
  58. data/bundler/lib/bundler/gem_version_promoter.rb +42 -40
  59. data/bundler/lib/bundler/index.rb +7 -2
  60. data/bundler/lib/bundler/injector.rb +14 -16
  61. data/bundler/lib/bundler/inline.rb +42 -17
  62. data/bundler/lib/bundler/installer/gem_installer.rb +4 -3
  63. data/bundler/lib/bundler/installer/parallel_installer.rb +3 -2
  64. data/bundler/lib/bundler/installer/standalone.rb +2 -5
  65. data/bundler/lib/bundler/installer.rb +22 -45
  66. data/bundler/lib/bundler/lazy_specification.rb +121 -48
  67. data/bundler/lib/bundler/lockfile_generator.rb +1 -1
  68. data/bundler/lib/bundler/lockfile_parser.rb +36 -9
  69. data/bundler/lib/bundler/man/bundle-add.1 +44 -27
  70. data/bundler/lib/bundler/man/bundle-add.1.ronn +52 -23
  71. data/bundler/lib/bundler/man/bundle-binstubs.1 +9 -6
  72. data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
  73. data/bundler/lib/bundler/man/bundle-cache.1 +32 -4
  74. data/bundler/lib/bundler/man/bundle-cache.1.ronn +31 -2
  75. data/bundler/lib/bundler/man/bundle-check.1 +7 -5
  76. data/bundler/lib/bundler/man/bundle-check.1.ronn +7 -2
  77. data/bundler/lib/bundler/man/bundle-clean.1 +3 -3
  78. data/bundler/lib/bundler/man/bundle-config.1 +180 -138
  79. data/bundler/lib/bundler/man/bundle-config.1.ronn +96 -99
  80. data/bundler/lib/bundler/man/bundle-console.1 +4 -6
  81. data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -7
  82. data/bundler/lib/bundler/man/bundle-doctor.1 +46 -7
  83. data/bundler/lib/bundler/man/bundle-doctor.1.ronn +49 -5
  84. data/bundler/lib/bundler/man/bundle-env.1 +9 -0
  85. data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
  86. data/bundler/lib/bundler/man/bundle-exec.1 +9 -6
  87. data/bundler/lib/bundler/man/bundle-exec.1.ronn +6 -3
  88. data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
  89. data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
  90. data/bundler/lib/bundler/man/bundle-gem.1 +69 -28
  91. data/bundler/lib/bundler/man/bundle-gem.1.ronn +42 -6
  92. data/bundler/lib/bundler/man/bundle-help.1 +3 -3
  93. data/bundler/lib/bundler/man/bundle-info.1 +7 -4
  94. data/bundler/lib/bundler/man/bundle-info.1.ronn +6 -2
  95. data/bundler/lib/bundler/man/bundle-init.1 +5 -5
  96. data/bundler/lib/bundler/man/bundle-init.1.ronn +3 -2
  97. data/bundler/lib/bundler/man/bundle-inject.1 +13 -5
  98. data/bundler/lib/bundler/man/bundle-inject.1.ronn +10 -2
  99. data/bundler/lib/bundler/man/bundle-install.1 +20 -17
  100. data/bundler/lib/bundler/man/bundle-install.1.ronn +26 -23
  101. data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
  102. data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
  103. data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
  104. data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  105. data/bundler/lib/bundler/man/bundle-list.1 +3 -3
  106. data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
  107. data/bundler/lib/bundler/man/bundle-lock.1 +23 -8
  108. data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
  109. data/bundler/lib/bundler/man/bundle-open.1 +4 -4
  110. data/bundler/lib/bundler/man/bundle-open.1.ronn +2 -1
  111. data/bundler/lib/bundler/man/bundle-outdated.1 +10 -7
  112. data/bundler/lib/bundler/man/bundle-outdated.1.ronn +8 -4
  113. data/bundler/lib/bundler/man/bundle-platform.1 +3 -3
  114. data/bundler/lib/bundler/man/bundle-plugin.1 +9 -6
  115. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +7 -3
  116. data/bundler/lib/bundler/man/bundle-pristine.1 +3 -3
  117. data/bundler/lib/bundler/man/bundle-pristine.1.ronn +1 -1
  118. data/bundler/lib/bundler/man/bundle-remove.1 +3 -3
  119. data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
  120. data/bundler/lib/bundler/man/bundle-show.1 +7 -4
  121. data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
  122. data/bundler/lib/bundler/man/bundle-update.1 +17 -11
  123. data/bundler/lib/bundler/man/bundle-update.1.ronn +17 -9
  124. data/bundler/lib/bundler/man/bundle-version.1 +3 -3
  125. data/bundler/lib/bundler/man/bundle-viz.1 +6 -6
  126. data/bundler/lib/bundler/man/bundle-viz.1.ronn +7 -3
  127. data/bundler/lib/bundler/man/bundle.1 +3 -3
  128. data/bundler/lib/bundler/man/gemfile.5 +7 -5
  129. data/bundler/lib/bundler/man/gemfile.5.ronn +8 -2
  130. data/bundler/lib/bundler/man/index.txt +4 -0
  131. data/bundler/lib/bundler/match_metadata.rb +13 -0
  132. data/bundler/lib/bundler/match_platform.rb +31 -12
  133. data/bundler/lib/bundler/materialization.rb +59 -0
  134. data/bundler/lib/bundler/mirror.rb +3 -3
  135. data/bundler/lib/bundler/plugin/api/source.rb +5 -4
  136. data/bundler/lib/bundler/plugin/events.rb +24 -0
  137. data/bundler/lib/bundler/plugin/index.rb +5 -1
  138. data/bundler/lib/bundler/plugin/installer/path.rb +26 -0
  139. data/bundler/lib/bundler/plugin/installer.rb +37 -17
  140. data/bundler/lib/bundler/plugin/source_list.rb +4 -4
  141. data/bundler/lib/bundler/plugin.rb +21 -2
  142. data/bundler/lib/bundler/process_lock.rb +10 -14
  143. data/bundler/lib/bundler/remote_specification.rb +6 -1
  144. data/bundler/lib/bundler/resolver/base.rb +14 -3
  145. data/bundler/lib/bundler/resolver/candidate.rb +18 -27
  146. data/bundler/lib/bundler/resolver/package.rb +20 -3
  147. data/bundler/lib/bundler/resolver/spec_group.rb +22 -27
  148. data/bundler/lib/bundler/resolver/strategy.rb +40 -0
  149. data/bundler/lib/bundler/resolver.rb +114 -52
  150. data/bundler/lib/bundler/retry.rb +1 -1
  151. data/bundler/lib/bundler/ruby_dsl.rb +12 -3
  152. data/bundler/lib/bundler/ruby_version.rb +7 -1
  153. data/bundler/lib/bundler/rubygems_ext.rb +303 -150
  154. data/bundler/lib/bundler/rubygems_gem_installer.rb +40 -5
  155. data/bundler/lib/bundler/rubygems_integration.rb +40 -73
  156. data/bundler/lib/bundler/runtime.rb +48 -35
  157. data/bundler/lib/bundler/self_manager.rb +36 -26
  158. data/bundler/lib/bundler/settings/validator.rb +0 -23
  159. data/bundler/lib/bundler/settings.rb +36 -27
  160. data/bundler/lib/bundler/setup.rb +6 -0
  161. data/bundler/lib/bundler/shared_helpers.rb +45 -25
  162. data/bundler/lib/bundler/source/gemspec.rb +1 -4
  163. data/bundler/lib/bundler/source/git/git_proxy.rb +26 -9
  164. data/bundler/lib/bundler/source/git.rb +113 -41
  165. data/bundler/lib/bundler/source/metadata.rb +4 -3
  166. data/bundler/lib/bundler/source/path.rb +14 -18
  167. data/bundler/lib/bundler/source/rubygems/remote.rb +12 -4
  168. data/bundler/lib/bundler/source/rubygems.rb +54 -48
  169. data/bundler/lib/bundler/source.rb +2 -0
  170. data/bundler/lib/bundler/source_list.rb +54 -12
  171. data/bundler/lib/bundler/source_map.rb +1 -1
  172. data/bundler/lib/bundler/spec_set.rb +227 -103
  173. data/bundler/lib/bundler/stub_specification.rb +29 -2
  174. data/bundler/lib/bundler/templates/Executable +0 -11
  175. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
  176. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +1 -3
  177. data/bundler/lib/bundler/templates/newgem/README.md.tt +7 -3
  178. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +17 -15
  179. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +14 -12
  180. data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
  181. data/bundler/lib/bundler/ui/shell.rb +26 -4
  182. data/bundler/lib/bundler/ui/silent.rb +12 -1
  183. data/bundler/lib/bundler/uri_credentials_filter.rb +3 -3
  184. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +53 -3
  185. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  186. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +11 -0
  187. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
  188. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  189. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
  190. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +134 -57
  191. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +4 -24
  192. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +1 -0
  193. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
  194. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +20 -8
  195. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +17 -29
  196. data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
  197. data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
  198. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
  199. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
  200. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
  201. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
  202. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
  203. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
  204. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
  205. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
  206. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  207. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  208. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +11 -0
  209. data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
  210. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +43 -16
  211. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
  212. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
  213. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +28 -37
  214. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
  215. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +16 -9
  216. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
  217. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  218. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +9 -9
  219. data/bundler/lib/bundler/vendored_net_http.rb +20 -5
  220. data/bundler/lib/bundler/vendored_securerandom.rb +12 -0
  221. data/bundler/lib/bundler/vendored_timeout.rb +7 -3
  222. data/bundler/lib/bundler/vendored_uri.rb +18 -1
  223. data/bundler/lib/bundler/version.rb +10 -2
  224. data/bundler/lib/bundler/worker.rb +1 -1
  225. data/bundler/lib/bundler/yaml_serializer.rb +12 -7
  226. data/bundler/lib/bundler.rb +101 -61
  227. data/{bundler → doc/bundler}/UPGRADING.md +132 -127
  228. data/doc/rubygems/CONTRIBUTING.md +227 -0
  229. data/{POLICIES.md → doc/rubygems/POLICIES.md} +86 -17
  230. data/exe/update_rubygems +1 -1
  231. data/lib/rubygems/basic_specification.rb +50 -10
  232. data/lib/rubygems/bundler_version_finder.rb +1 -1
  233. data/lib/rubygems/command.rb +1 -4
  234. data/lib/rubygems/command_manager.rb +5 -6
  235. data/lib/rubygems/commands/build_command.rb +2 -11
  236. data/lib/rubygems/commands/cleanup_command.rb +3 -13
  237. data/lib/rubygems/commands/contents_command.rb +17 -10
  238. data/lib/rubygems/commands/environment_command.rb +5 -0
  239. data/lib/rubygems/commands/exec_command.rb +18 -11
  240. data/lib/rubygems/commands/fetch_command.rb +14 -0
  241. data/lib/rubygems/commands/help_command.rb +2 -2
  242. data/lib/rubygems/commands/install_command.rb +0 -4
  243. data/lib/rubygems/commands/pristine_command.rb +29 -19
  244. data/lib/rubygems/commands/push_command.rb +31 -6
  245. data/lib/rubygems/commands/rdoc_command.rb +3 -10
  246. data/lib/rubygems/commands/rebuild_command.rb +262 -0
  247. data/lib/rubygems/commands/setup_command.rb +13 -18
  248. data/lib/rubygems/commands/sources_command.rb +2 -2
  249. data/lib/rubygems/commands/uninstall_command.rb +9 -4
  250. data/lib/rubygems/commands/unpack_command.rb +0 -6
  251. data/lib/rubygems/commands/update_command.rb +13 -22
  252. data/lib/rubygems/config_file.rb +45 -16
  253. data/lib/rubygems/core_ext/kernel_require.rb +15 -3
  254. data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
  255. data/lib/rubygems/defaults.rb +7 -7
  256. data/lib/rubygems/dependency.rb +12 -16
  257. data/lib/rubygems/dependency_list.rb +1 -1
  258. data/lib/rubygems/deprecate.rb +79 -77
  259. data/lib/rubygems/errors.rb +2 -1
  260. data/lib/rubygems/exceptions.rb +2 -9
  261. data/lib/rubygems/ext/builder.rb +21 -8
  262. data/lib/rubygems/ext/cargo_builder.rb +16 -26
  263. data/lib/rubygems/ext/cmake_builder.rb +7 -2
  264. data/lib/rubygems/ext/configure_builder.rb +7 -2
  265. data/lib/rubygems/ext/ext_conf_builder.rb +9 -5
  266. data/lib/rubygems/ext/rake_builder.rb +7 -4
  267. data/lib/rubygems/gem_runner.rb +9 -0
  268. data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +11 -4
  269. data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +3 -1
  270. data/lib/rubygems/gemcutter_utilities.rb +52 -26
  271. data/lib/rubygems/gemspec_helpers.rb +19 -0
  272. data/lib/rubygems/install_update_options.rb +5 -0
  273. data/lib/rubygems/installer.rb +76 -90
  274. data/lib/rubygems/local_remote_options.rb +8 -8
  275. data/lib/rubygems/package/tar_header.rb +31 -4
  276. data/lib/rubygems/package/tar_reader/entry.rb +1 -5
  277. data/lib/rubygems/package/tar_writer.rb +5 -4
  278. data/lib/rubygems/package.rb +13 -8
  279. data/lib/rubygems/platform.rb +148 -43
  280. data/lib/rubygems/psych_tree.rb +4 -0
  281. data/lib/rubygems/query_utils.rb +2 -2
  282. data/lib/rubygems/rdoc.rb +16 -3
  283. data/lib/rubygems/remote_fetcher.rb +6 -7
  284. data/lib/rubygems/request.rb +5 -5
  285. data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
  286. data/lib/rubygems/request_set.rb +4 -7
  287. data/lib/rubygems/requirement.rb +16 -12
  288. data/lib/rubygems/resolver/activation_request.rb +1 -1
  289. data/lib/rubygems/resolver/api_set/gem_parser.rb +2 -5
  290. data/lib/rubygems/resolver/api_set.rb +13 -8
  291. data/lib/rubygems/resolver/best_set.rb +1 -29
  292. data/lib/rubygems/resolver/composed_set.rb +3 -3
  293. data/lib/rubygems/resolver/git_set.rb +0 -1
  294. data/lib/rubygems/resolver/index_set.rb +2 -2
  295. data/lib/rubygems/resolver/source_set.rb +1 -1
  296. data/lib/rubygems/resolver/spec_specification.rb +7 -0
  297. data/lib/rubygems/resolver.rb +8 -8
  298. data/lib/rubygems/s3_uri_signer.rb +8 -6
  299. data/lib/rubygems/safe_marshal/reader.rb +31 -14
  300. data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +29 -16
  301. data/lib/rubygems/safe_yaml.rb +10 -1
  302. data/lib/rubygems/security.rb +1 -1
  303. data/lib/rubygems/source/git.rb +22 -17
  304. data/lib/rubygems/source/installed.rb +3 -1
  305. data/lib/rubygems/source/local.rb +8 -4
  306. data/lib/rubygems/source/specific_file.rb +5 -3
  307. data/lib/rubygems/source.rb +37 -29
  308. data/lib/rubygems/source_list.rb +1 -1
  309. data/lib/rubygems/spec_fetcher.rb +47 -15
  310. data/lib/rubygems/specification.rb +110 -183
  311. data/lib/rubygems/specification_policy.rb +33 -13
  312. data/lib/rubygems/specification_record.rb +212 -0
  313. data/lib/rubygems/stub_specification.rb +32 -10
  314. data/lib/rubygems/target_rbconfig.rb +50 -0
  315. data/lib/rubygems/uninstaller.rb +42 -22
  316. data/lib/rubygems/uri.rb +6 -6
  317. data/lib/rubygems/uri_formatter.rb +2 -1
  318. data/lib/rubygems/util/licenses.rb +118 -1
  319. data/lib/rubygems/util.rb +1 -1
  320. data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
  321. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/delegates/specification_provider.rb +11 -11
  322. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
  323. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
  324. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
  325. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
  326. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
  327. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/log.rb +1 -1
  328. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
  329. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
  330. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/vertex.rb +1 -1
  331. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph.rb +2 -2
  332. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/errors.rb +1 -1
  333. data/lib/rubygems/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
  334. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/specification_provider.rb +2 -2
  335. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/ui.rb +1 -1
  336. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolution.rb +4 -4
  337. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolver.rb +1 -1
  338. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/state.rb +1 -1
  339. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo.rb +2 -2
  340. data/lib/rubygems/vendor/net-http/COPYING +56 -0
  341. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/generic_request.rb +9 -9
  342. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/header.rb +3 -3
  343. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/request.rb +3 -3
  344. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/requests.rb +35 -30
  345. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/response.rb +2 -2
  346. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/responses.rb +6 -6
  347. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/status.rb +1 -1
  348. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http.rb +149 -70
  349. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/https.rb +1 -1
  350. data/lib/rubygems/vendor/optparse/COPYING +56 -0
  351. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/ac.rb +16 -0
  352. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/kwargs.rb +8 -3
  353. data/lib/rubygems/vendor/optparse/lib/optparse/uri.rb +7 -0
  354. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/version.rb +9 -0
  355. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse.rb +158 -62
  356. data/lib/rubygems/vendor/resolv/COPYING +56 -0
  357. data/lib/rubygems/{resolv → vendor/resolv}/lib/resolv.rb +165 -69
  358. data/lib/rubygems/vendor/securerandom/COPYING +56 -0
  359. data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +102 -0
  360. data/lib/rubygems/vendor/timeout/COPYING +56 -0
  361. data/lib/rubygems/{timeout → vendor/timeout}/lib/timeout.rb +10 -11
  362. data/lib/rubygems/{tsort → vendor/tsort}/lib/tsort.rb +2 -2
  363. data/lib/rubygems/vendor/uri/COPYING +56 -0
  364. data/lib/rubygems/vendor/uri/lib/uri/common.rb +880 -0
  365. data/lib/rubygems/vendor/uri/lib/uri/file.rb +100 -0
  366. data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +267 -0
  367. data/lib/rubygems/vendor/uri/lib/uri/generic.rb +1579 -0
  368. data/lib/rubygems/vendor/uri/lib/uri/http.rb +125 -0
  369. data/lib/rubygems/vendor/uri/lib/uri/https.rb +23 -0
  370. data/lib/rubygems/vendor/uri/lib/uri/ldap.rb +261 -0
  371. data/lib/rubygems/vendor/uri/lib/uri/ldaps.rb +22 -0
  372. data/lib/rubygems/vendor/uri/lib/uri/mailto.rb +293 -0
  373. data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  374. data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
  375. data/lib/rubygems/vendor/uri/lib/uri/version.rb +6 -0
  376. data/lib/rubygems/vendor/uri/lib/uri/ws.rb +83 -0
  377. data/lib/rubygems/vendor/uri/lib/uri/wss.rb +23 -0
  378. data/lib/rubygems/vendor/uri/lib/uri.rb +104 -0
  379. data/lib/rubygems/vendored_molinillo.rb +3 -0
  380. data/lib/rubygems/vendored_net_http.rb +5 -0
  381. data/lib/rubygems/vendored_optparse.rb +3 -0
  382. data/lib/rubygems/vendored_securerandom.rb +3 -0
  383. data/lib/rubygems/vendored_timeout.rb +5 -0
  384. data/lib/rubygems/vendored_tsort.rb +3 -0
  385. data/lib/rubygems/version.rb +26 -9
  386. data/lib/rubygems/yaml_serializer.rb +12 -7
  387. data/lib/rubygems.rb +160 -53
  388. data/rubygems-update.gemspec +11 -6
  389. data/setup.rb +1 -1
  390. metadata +124 -96
  391. data/bundler/lib/bundler/compact_index_client/gem_parser.rb +0 -32
  392. data/bundler/lib/bundler/gem_helpers.rb +0 -127
  393. data/bundler/lib/bundler/templates/Executable.bundler +0 -109
  394. data/bundler/lib/bundler/vendor/fileutils/.document +0 -1
  395. data/bundler/lib/bundler/vendor/net-http-persistent/.document +0 -1
  396. data/bundler/lib/bundler/vendor/pub_grub/.document +0 -1
  397. data/bundler/lib/bundler/vendor/thor/.document +0 -1
  398. data/bundler/lib/bundler/vendor/tsort/.document +0 -1
  399. data/bundler/lib/bundler/vendor/uri/.document +0 -1
  400. data/lib/rubygems/net/http.rb +0 -3
  401. data/lib/rubygems/net-http/.document +0 -1
  402. data/lib/rubygems/net-http/LICENSE.txt +0 -22
  403. data/lib/rubygems/net-http/lib/net/http/backward.rb +0 -40
  404. data/lib/rubygems/net-protocol/.document +0 -1
  405. data/lib/rubygems/net-protocol/LICENSE.txt +0 -22
  406. data/lib/rubygems/optparse/.document +0 -1
  407. data/lib/rubygems/optparse/lib/optparse/uri.rb +0 -7
  408. data/lib/rubygems/optparse.rb +0 -3
  409. data/lib/rubygems/resolv/.document +0 -1
  410. data/lib/rubygems/resolv/LICENSE.txt +0 -22
  411. data/lib/rubygems/resolver/molinillo/.document +0 -1
  412. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  413. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  414. data/lib/rubygems/resolver/molinillo.rb +0 -3
  415. data/lib/rubygems/shellwords.rb +0 -3
  416. data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +0 -21
  417. data/lib/rubygems/timeout/.document +0 -1
  418. data/lib/rubygems/timeout/LICENSE.txt +0 -22
  419. data/lib/rubygems/timeout.rb +0 -3
  420. data/lib/rubygems/tsort/.document +0 -1
  421. data/lib/rubygems/tsort/LICENSE.txt +0 -22
  422. data/lib/rubygems/tsort.rb +0 -3
  423. /data/{lib/rubygems/optparse → bundler/lib/bundler/vendor/fileutils}/COPYING +0 -0
  424. /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
  425. /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
  426. /data/lib/rubygems/ssl_certs/rubygems.org/{GlobalSignRootCA_R3.pem → GlobalSign.pem} +0 -0
  427. /data/{bundler/lib/bundler/vendor/connection_pool → lib/rubygems/vendor}/.document +0 -0
  428. /data/lib/rubygems/{resolver → vendor}/molinillo/LICENSE +0 -0
  429. /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/exceptions.rb +0 -0
  430. /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/proxy_delta.rb +0 -0
  431. /data/{bundler/lib/bundler/vendor/fileutils → lib/rubygems/vendor/net-protocol}/LICENSE.txt +0 -0
  432. /data/lib/rubygems/{net-protocol → vendor/net-protocol}/lib/net/protocol.rb +0 -0
  433. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optionparser.rb +0 -0
  434. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/date.rb +0 -0
  435. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/shellwords.rb +0 -0
  436. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/time.rb +0 -0
  437. /data/{bundler/lib/bundler/vendor/uri → lib/rubygems/vendor/tsort}/LICENSE.txt +0 -0
@@ -31,8 +31,6 @@ module Bundler
31
31
  @extension = options[:ext]
32
32
 
33
33
  validate_ext_name if @extension
34
- validate_rust_builder_rubygems_version if @extension == "rust"
35
- travis_removal_info
36
34
  end
37
35
 
38
36
  def run
@@ -49,13 +47,16 @@ module Bundler
49
47
  git_author_name = use_git ? `git config user.name`.chomp : ""
50
48
  git_username = use_git ? `git config github.user`.chomp : ""
51
49
  git_user_email = use_git ? `git config user.email`.chomp : ""
50
+ github_username = github_username(git_username)
52
51
 
53
- github_username = if options[:github_username].nil?
54
- git_username
55
- elsif options[:github_username] == false
56
- ""
52
+ if github_username.empty?
53
+ homepage_uri = "TODO: Put your gem's website or public repo URL here."
54
+ source_code_uri = "TODO: Put your gem's public repo URL here."
55
+ changelog_uri = "TODO: Put your gem's CHANGELOG.md URL here."
57
56
  else
58
- options[:github_username]
57
+ homepage_uri = "https://github.com/#{github_username}/#{name}"
58
+ source_code_uri = "https://github.com/#{github_username}/#{name}"
59
+ changelog_uri = "https://github.com/#{github_username}/#{name}/blob/main/CHANGELOG.md"
59
60
  end
60
61
 
61
62
  config = {
@@ -70,17 +71,22 @@ module Bundler
70
71
  test: options[:test],
71
72
  ext: extension,
72
73
  exe: options[:exe],
74
+ bundle: options[:bundle],
73
75
  bundler_version: bundler_dependency_version,
74
76
  git: use_git,
75
77
  github_username: github_username.empty? ? "[USERNAME]" : github_username,
76
78
  required_ruby_version: required_ruby_version,
77
79
  rust_builder_required_rubygems_version: rust_builder_required_rubygems_version,
78
80
  minitest_constant_name: minitest_constant_name,
81
+ ignore_paths: %w[bin/],
82
+ homepage_uri: homepage_uri,
83
+ source_code_uri: source_code_uri,
84
+ changelog_uri: changelog_uri,
79
85
  }
80
86
  ensure_safe_gem_name(name, constant_array)
81
87
 
82
88
  templates = {
83
- "#{Bundler.preferred_gemfile_name}.tt" => Bundler.preferred_gemfile_name,
89
+ "Gemfile.tt" => Bundler.preferred_gemfile_name,
84
90
  "lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
85
91
  "lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
86
92
  "sig/newgem.rbs.tt" => "sig/#{namespaced_path}.rbs",
@@ -96,7 +102,18 @@ module Bundler
96
102
  bin/setup
97
103
  ]
98
104
 
99
- templates.merge!("gitignore.tt" => ".gitignore") if use_git
105
+ case Bundler.preferred_gemfile_name
106
+ when "Gemfile"
107
+ config[:ignore_paths] << "Gemfile"
108
+ when "gems.rb"
109
+ config[:ignore_paths] << "gems.rb"
110
+ config[:ignore_paths] << "gems.locked"
111
+ end
112
+
113
+ if use_git
114
+ templates.merge!("gitignore.tt" => ".gitignore")
115
+ config[:ignore_paths] << ".gitignore"
116
+ end
100
117
 
101
118
  if test_framework = ask_and_set_test_framework
102
119
  config[:test] = test_framework
@@ -110,6 +127,8 @@ module Bundler
110
127
  "spec/newgem_spec.rb.tt" => "spec/#{namespaced_path}_spec.rb"
111
128
  )
112
129
  config[:test_task] = :spec
130
+ config[:ignore_paths] << ".rspec"
131
+ config[:ignore_paths] << "spec/"
113
132
  when "minitest"
114
133
  # Generate path for minitest target file (FileList["test/**/test_*.rb"])
115
134
  # foo => test/test_foo.rb
@@ -124,12 +143,14 @@ module Bundler
124
143
  "test/minitest/test_newgem.rb.tt" => "test/#{minitest_namespaced_path}.rb"
125
144
  )
126
145
  config[:test_task] = :test
146
+ config[:ignore_paths] << "test/"
127
147
  when "test-unit"
128
148
  templates.merge!(
129
149
  "test/test-unit/test_helper.rb.tt" => "test/test_helper.rb",
130
150
  "test/test-unit/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
131
151
  )
132
152
  config[:test_task] = :test
153
+ config[:ignore_paths] << "test/"
133
154
  end
134
155
  end
135
156
 
@@ -137,19 +158,19 @@ module Bundler
137
158
  case config[:ci]
138
159
  when "github"
139
160
  templates.merge!("github/workflows/main.yml.tt" => ".github/workflows/main.yml")
140
- config[:ci_config_path] = ".github "
161
+ config[:ignore_paths] << ".github/"
141
162
  when "gitlab"
142
163
  templates.merge!("gitlab-ci.yml.tt" => ".gitlab-ci.yml")
143
- config[:ci_config_path] = ".gitlab-ci.yml "
164
+ config[:ignore_paths] << ".gitlab-ci.yml"
144
165
  when "circle"
145
166
  templates.merge!("circleci/config.yml.tt" => ".circleci/config.yml")
146
- config[:ci_config_path] = ".circleci "
167
+ config[:ignore_paths] << ".circleci/"
147
168
  end
148
169
 
149
170
  if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
150
- "This means that any other developer or company will be legally allowed to use your code " \
151
- "for free as long as they admit you created it. You can read more about the MIT license " \
152
- "at https://choosealicense.com/licenses/mit.")
171
+ "Using a MIT license means that any other developer or company will be legally allowed " \
172
+ "to use your code for free as long as they admit you created it. You can read more about " \
173
+ "the MIT license at https://choosealicense.com/licenses/mit.")
153
174
  config[:mit] = true
154
175
  Bundler.ui.info "MIT License enabled in config"
155
176
  templates.merge!("LICENSE.txt.tt" => "LICENSE.txt")
@@ -186,13 +207,18 @@ module Bundler
186
207
  config[:linter_version] = rubocop_version
187
208
  Bundler.ui.info "RuboCop enabled in config"
188
209
  templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
210
+ config[:ignore_paths] << ".rubocop.yml"
189
211
  when "standard"
190
212
  config[:linter_version] = standard_version
191
213
  Bundler.ui.info "Standard enabled in config"
192
214
  templates.merge!("standard.yml.tt" => ".standard.yml")
215
+ config[:ignore_paths] << ".standard.yml"
193
216
  end
194
217
 
195
- templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
218
+ if config[:exe]
219
+ templates.merge!("exe/newgem.tt" => "exe/#{name}")
220
+ executables.push("exe/#{name}")
221
+ end
196
222
 
197
223
  if extension == "c"
198
224
  templates.merge!(
@@ -217,7 +243,7 @@ module Bundler
217
243
  end
218
244
 
219
245
  if use_git
220
- Bundler.ui.info "Initializing git repo in #{target}"
246
+ Bundler.ui.info "\nInitializing git repo in #{target}"
221
247
  require "shellwords"
222
248
  `git init #{target.to_s.shellescape}`
223
249
 
@@ -239,10 +265,17 @@ module Bundler
239
265
  IO.popen(%w[git add .], { chdir: target }, &:read)
240
266
  end
241
267
 
268
+ if config[:bundle]
269
+ Bundler.ui.info "Running bundle install in the new gem directory."
270
+ Dir.chdir(target) do
271
+ system("bundle install")
272
+ end
273
+ end
274
+
242
275
  # Open gemspec in editor
243
276
  open_editor(options["edit"], target.join("#{name}.gemspec")) if options[:edit]
244
277
 
245
- Bundler.ui.info "Gem '#{name}' was successfully created. " \
278
+ Bundler.ui.info "\nGem '#{name}' was successfully created. " \
246
279
  "For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html"
247
280
  end
248
281
 
@@ -252,13 +285,13 @@ module Bundler
252
285
  SharedHelpers.pwd.join(name).basename.to_s
253
286
  end
254
287
 
255
- def ask_and_set(key, header, message)
288
+ def ask_and_set(key, prompt, explanation)
256
289
  choice = options[key]
257
290
  choice = Bundler.settings["gem.#{key}"] if choice.nil?
258
291
 
259
292
  if choice.nil?
260
- Bundler.ui.confirm header
261
- choice = Bundler.ui.yes? "#{message} y/(n):"
293
+ Bundler.ui.info "\n#{explanation}"
294
+ choice = Bundler.ui.yes? "#{prompt} y/(n):"
262
295
  Bundler.settings.set_global("gem.#{key}", choice)
263
296
  end
264
297
 
@@ -276,10 +309,11 @@ module Bundler
276
309
  end
277
310
 
278
311
  def ask_and_set_test_framework
312
+ return if skip?(:test)
279
313
  test_framework = options[:test] || Bundler.settings["gem.test"]
280
314
 
281
315
  if test_framework.to_s.empty?
282
- Bundler.ui.confirm "Do you want to generate tests with your gem?"
316
+ Bundler.ui.info "\nDo you want to generate tests with your gem?"
283
317
  Bundler.ui.info hint_text("test")
284
318
 
285
319
  result = Bundler.ui.ask "Enter a test framework. rspec/minitest/test-unit/(none):"
@@ -301,6 +335,10 @@ module Bundler
301
335
  test_framework
302
336
  end
303
337
 
338
+ def skip?(option)
339
+ options.key?(option) && options[option].nil?
340
+ end
341
+
304
342
  def hint_text(setting)
305
343
  if Bundler.settings["gem.#{setting}"] == false
306
344
  "Your choice will only be applied to this gem."
@@ -311,15 +349,15 @@ module Bundler
311
349
  end
312
350
 
313
351
  def ask_and_set_ci
352
+ return if skip?(:ci)
314
353
  ci_template = options[:ci] || Bundler.settings["gem.ci"]
315
354
 
316
355
  if ci_template.to_s.empty?
317
- Bundler.ui.confirm "Do you want to set up continuous integration for your gem? " \
356
+ Bundler.ui.info "\nDo you want to set up continuous integration for your gem? " \
318
357
  "Supported services:\n" \
319
358
  "* CircleCI: https://circleci.com/\n" \
320
359
  "* GitHub Actions: https://github.com/features/actions\n" \
321
- "* GitLab CI: https://docs.gitlab.com/ee/ci/\n" \
322
- "\n"
360
+ "* GitLab CI: https://docs.gitlab.com/ee/ci/\n"
323
361
  Bundler.ui.info hint_text("ci")
324
362
 
325
363
  result = Bundler.ui.ask "Enter a CI service. github/gitlab/circle/(none):"
@@ -342,15 +380,15 @@ module Bundler
342
380
  end
343
381
 
344
382
  def ask_and_set_linter
383
+ return if skip?(:linter)
345
384
  linter_template = options[:linter] || Bundler.settings["gem.linter"]
346
385
  linter_template = deprecated_rubocop_option if linter_template.nil?
347
386
 
348
387
  if linter_template.to_s.empty?
349
- Bundler.ui.confirm "Do you want to add a code linter and formatter to your gem? " \
388
+ Bundler.ui.info "\nDo you want to add a code linter and formatter to your gem? " \
350
389
  "Supported Linters:\n" \
351
390
  "* RuboCop: https://rubocop.org\n" \
352
- "* Standard: https://github.com/standardrb/standard\n" \
353
- "\n"
391
+ "* Standard: https://github.com/standardrb/standard\n"
354
392
  Bundler.ui.info hint_text("linter")
355
393
 
356
394
  result = Bundler.ui.ask "Enter a linter. rubocop/standard/(none):"
@@ -437,7 +475,7 @@ module Bundler
437
475
  end
438
476
 
439
477
  def required_ruby_version
440
- "2.6.0"
478
+ "3.2.0"
441
479
  end
442
480
 
443
481
  def rubocop_version
@@ -448,23 +486,13 @@ module Bundler
448
486
  "1.3"
449
487
  end
450
488
 
451
- # TODO: remove at next minor release
452
- def travis_removal_info
453
- if options[:ci] == "travis"
454
- Bundler.ui.error "Support for Travis CI was removed from gem skeleton generator."
455
- exit 1
456
- end
457
-
458
- if Bundler.settings["gem.ci"] == "travis"
459
- Bundler.ui.error "Support for Travis CI was removed from gem skeleton generator, but it is present in bundle config. Please configure another provider using `bundle config set gem.ci SERVICE` (where SERVICE is one of github/gitlab/circle) or unset configuration using `bundle config unset gem.ci`."
460
- exit 1
461
- end
462
- end
463
-
464
- def validate_rust_builder_rubygems_version
465
- if Gem::Version.new(rust_builder_required_rubygems_version) > Gem.rubygems_version
466
- Bundler.ui.error "Your RubyGems version (#{Gem.rubygems_version}) is too old to build Rust extension. Please update your RubyGems using `gem update --system` or any other way and try again."
467
- exit 1
489
+ def github_username(git_username)
490
+ if options[:github_username].nil?
491
+ git_username
492
+ elsif options[:github_username] == false
493
+ ""
494
+ else
495
+ options[:github_username]
468
496
  end
469
497
  end
470
498
  end
@@ -39,8 +39,8 @@ module Bundler
39
39
  path = File.expand_path("../../..", __dir__)
40
40
  else
41
41
  path = spec.full_gem_path
42
- if spec.deleted_gem?
43
- return Bundler.ui.warn "The gem #{name} has been deleted. It was installed at: #{path}"
42
+ if spec.installation_missing?
43
+ return Bundler.ui.warn "The gem #{name} is missing. It should be installed at #{path}, but was not found"
44
44
  end
45
45
  end
46
46
 
@@ -65,19 +65,19 @@ module Bundler
65
65
  gem_info << "\tDefault Gem: yes\n" if spec.respond_to?(:default_gem?) && spec.default_gem?
66
66
  gem_info << "\tReverse Dependencies: \n\t\t#{gem_dependencies.join("\n\t\t")}" if gem_dependencies.any?
67
67
 
68
- if name != "bundler" && spec.deleted_gem?
69
- return Bundler.ui.warn "The gem #{name} has been deleted. Gemspec information is still available though:\n#{gem_info}"
68
+ if name != "bundler" && spec.installation_missing?
69
+ return Bundler.ui.warn "The gem #{name} is missing. Gemspec information is still available though:\n#{gem_info}"
70
70
  end
71
71
 
72
72
  Bundler.ui.info gem_info
73
73
  end
74
74
 
75
75
  def gem_dependencies
76
- @gem_dependencies ||= Bundler.definition.specs.map do |spec|
76
+ @gem_dependencies ||= Bundler.definition.specs.filter_map do |spec|
77
77
  dependency = spec.dependencies.find {|dep| dep.name == gem_name }
78
78
  next unless dependency
79
79
  "#{spec.name} (#{spec.version}) depends on #{gem_name} (#{dependency.requirements_list.join(", ")})"
80
- end.compact.sort
80
+ end.sort
81
81
  end
82
82
  end
83
83
  end
@@ -35,8 +35,8 @@ module Bundler
35
35
  Bundler.ui.confirm(added.map do |d|
36
36
  name = "'#{d.name}'"
37
37
  requirement = ", '#{d.requirement}'"
38
- group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
39
- source = ", :source => '#{d.source}'" unless d.source.nil?
38
+ group = ", group: #{d.groups.inspect}" if d.groups != Array(:default)
39
+ source = ", source: '#{d.source}'" unless d.source.nil?
40
40
  %(gem #{name}#{requirement}#{group}#{source})
41
41
  end.join("\n"))
42
42
  else
@@ -48,7 +48,7 @@ module Bundler
48
48
 
49
49
  def last_version_number
50
50
  definition = Bundler.definition(true)
51
- definition.resolve_remotely!
51
+ definition.remotely!
52
52
  specs = definition.index[name].sort_by(&:version)
53
53
  unless options[:pre]
54
54
  specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
@@ -12,22 +12,31 @@ module Bundler
12
12
 
13
13
  warn_if_root
14
14
 
15
- Bundler.self_manager.install_locked_bundler_and_restart_with_it_if_needed
15
+ if options[:local]
16
+ Bundler.self_manager.restart_with_locked_bundler_if_needed
17
+ else
18
+ Bundler.self_manager.install_locked_bundler_and_restart_with_it_if_needed
19
+ end
16
20
 
17
- Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Bundler::FREEBSD
21
+ Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Gem.freebsd_platform?
18
22
 
19
23
  # Disable color in deployment mode
20
24
  Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
21
25
 
26
+ if target_rbconfig_path = options[:"target-rbconfig"]
27
+ Bundler.rubygems.set_target_rbconfig(target_rbconfig_path)
28
+ end
29
+
22
30
  check_for_options_conflicts
23
31
 
24
32
  check_trust_policy
25
33
 
26
34
  if options[:deployment] || options[:frozen] || Bundler.frozen_bundle?
27
35
  unless Bundler.default_lockfile.exist?
28
- flag = "--deployment flag" if options[:deployment]
29
- flag ||= "--frozen flag" if options[:frozen]
30
- flag ||= "deployment setting"
36
+ flag = "--deployment flag" if options[:deployment]
37
+ flag ||= "--frozen flag" if options[:frozen]
38
+ flag ||= "deployment setting" if Bundler.settings[:deployment]
39
+ flag ||= "frozen setting" if Bundler.settings[:frozen]
31
40
  raise ProductionError, "The #{flag} requires a lockfile. Please make " \
32
41
  "sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control " \
33
42
  "before deploying."
@@ -57,7 +66,9 @@ module Bundler
57
66
 
58
67
  Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
59
68
 
60
- definition = Bundler.definition
69
+ # For install we want to enable strict validation
70
+ # (rather than some optimizations we perform at app runtime).
71
+ definition = Bundler.definition(strict: true)
61
72
  definition.validate_runtime!
62
73
 
63
74
  installer = Installer.install(Bundler.root, definition, options)
@@ -149,9 +160,7 @@ module Bundler
149
160
  Bundler.settings.set_command_option_if_given :path, options[:path]
150
161
 
151
162
  if options["standalone"] && Bundler.settings[:path].nil? && !options["local"]
152
- Bundler.settings.temporary(path_relative_to_cwd: false) do
153
- Bundler.settings.set_command_option :path, "bundle"
154
- end
163
+ Bundler.settings.set_command_option :path, "bundle"
155
164
  end
156
165
 
157
166
  bin_option = options["binstubs"]
@@ -170,7 +179,7 @@ module Bundler
170
179
 
171
180
  normalize_groups if options[:without] || options[:with]
172
181
 
173
- options[:force] = options[:redownload]
182
+ options[:force] = options[:redownload] if options[:redownload]
174
183
  end
175
184
 
176
185
  def warn_ambiguous_gems
@@ -10,7 +10,7 @@ module Bundler
10
10
  be sure to check out these resources:
11
11
 
12
12
  1. Check out our troubleshooting guide for quick fixes to common issues:
13
- https://github.com/rubygems/rubygems/blob/master/bundler/doc/TROUBLESHOOTING.md
13
+ https://github.com/rubygems/rubygems/blob/master/doc/bundler/TROUBLESHOOTING.md
14
14
 
15
15
  2. Instructions for common Bundler uses can be found on the documentation
16
16
  site: https://bundler.io/
@@ -34,8 +34,8 @@ module Bundler
34
34
  end
35
35
 
36
36
  def doctor
37
- require_relative "doctor"
38
- Bundler::CLI::Doctor.new({}).run
37
+ require_relative "doctor/diagnose"
38
+ Bundler::CLI::Doctor::Diagnose.new({}).run
39
39
  end
40
40
  end
41
41
  end
@@ -14,9 +14,11 @@ module Bundler
14
14
  exit 1
15
15
  end
16
16
 
17
+ check_for_conflicting_options
18
+
17
19
  print = options[:print]
18
- previous_ui_level = Bundler.ui.level
19
- Bundler.ui.level = "silent" if print
20
+ previous_output_stream = Bundler.ui.output_stream
21
+ Bundler.ui.output_stream = :stderr if print
20
22
 
21
23
  Bundler::Fetcher.disable_endpoint = options["full-index"]
22
24
 
@@ -33,20 +35,25 @@ module Bundler
33
35
  update = { bundler: bundler }
34
36
  end
35
37
 
38
+ file = options[:lockfile]
39
+ file = file ? Pathname.new(file).expand_path : Bundler.default_lockfile
40
+
36
41
  Bundler.settings.temporary(frozen: false) do
37
- definition = Bundler.definition(update)
42
+ definition = Bundler.definition(update, file)
43
+ definition.add_checksums if options["add-checksums"]
38
44
 
39
45
  Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
40
46
 
41
- options["remove-platform"].each do |platform|
47
+ options["remove-platform"].each do |platform_string|
48
+ platform = Gem::Platform.new(platform_string)
42
49
  definition.remove_platform(platform)
43
50
  end
44
51
 
45
52
  options["add-platform"].each do |platform_string|
46
53
  platform = Gem::Platform.new(platform_string)
47
54
  if platform.to_s == "unknown"
48
- Bundler.ui.warn "The platform `#{platform_string}` is unknown to RubyGems " \
49
- "and adding it will likely lead to resolution errors"
55
+ Bundler.ui.error "The platform `#{platform_string}` is unknown to RubyGems and can't be added to the lockfile."
56
+ exit 1
50
57
  end
51
58
  definition.add_platform(platform)
52
59
  end
@@ -55,19 +62,33 @@ module Bundler
55
62
  raise InvalidOption, "Removing all platforms from the bundle is not allowed"
56
63
  end
57
64
 
58
- definition.resolve_remotely! unless options[:local]
65
+ definition.remotely! unless options[:local]
66
+
67
+ if options["normalize-platforms"]
68
+ definition.normalize_platforms
69
+ end
59
70
 
60
71
  if print
61
72
  puts definition.to_lock
62
73
  else
63
- file = options[:lockfile]
64
- file = file ? File.expand_path(file) : Bundler.default_lockfile
65
74
  puts "Writing lockfile to #{file}"
66
- definition.lock(file)
75
+ definition.lock
67
76
  end
68
77
  end
69
78
 
70
- Bundler.ui.level = previous_ui_level
79
+ Bundler.ui.output_stream = previous_output_stream
80
+ end
81
+
82
+ private
83
+
84
+ def check_for_conflicting_options
85
+ if options["normalize-platforms"] && options["add-platform"].any?
86
+ raise InvalidOption, "--normalize-platforms can't be used with --add-platform"
87
+ end
88
+
89
+ if options["normalize-platforms"] && options["remove-platform"].any?
90
+ raise InvalidOption, "--normalize-platforms can't be used with --remove-platform"
91
+ end
71
92
  end
72
93
  end
73
94
  end
@@ -26,13 +26,15 @@ module Bundler
26
26
  def run
27
27
  check_for_deployment_mode!
28
28
 
29
- gems.each do |gem_name|
30
- Bundler::CLI::Common.select_spec(gem_name)
31
- end
32
-
33
29
  Bundler.definition.validate_runtime!
34
30
  current_specs = Bundler.ui.silence { Bundler.definition.resolve }
35
31
 
32
+ gems.each do |gem_name|
33
+ if current_specs[gem_name].empty?
34
+ raise GemNotFound, "Could not find gem '#{gem_name}'."
35
+ end
36
+ end
37
+
36
38
  current_dependencies = Bundler.ui.silence do
37
39
  Bundler.load.dependencies.map {|dep| [dep.name, dep] }.to_h
38
40
  end
@@ -54,7 +56,7 @@ module Bundler
54
56
  end
55
57
 
56
58
  if options[:parseable]
57
- Bundler.ui.silence(&definition_resolution)
59
+ Bundler.ui.progress(&definition_resolution)
58
60
  else
59
61
  definition_resolution.call
60
62
  end
@@ -97,28 +99,26 @@ module Bundler
97
99
  }
98
100
  end
99
101
 
100
- if outdated_gems.empty?
102
+ relevant_outdated_gems = if options_include_groups
103
+ outdated_gems.group_by {|g| g[:groups] }.sort.flat_map do |groups, gems|
104
+ contains_group = groups.split(", ").include?(options[:group])
105
+ next unless options[:groups] || contains_group
106
+
107
+ gems
108
+ end.compact
109
+ else
110
+ outdated_gems
111
+ end
112
+
113
+ if relevant_outdated_gems.empty?
101
114
  unless options[:parseable]
102
115
  Bundler.ui.info(nothing_outdated_message)
103
116
  end
104
117
  else
105
- if options_include_groups
106
- relevant_outdated_gems = outdated_gems.group_by {|g| g[:groups] }.sort.flat_map do |groups, gems|
107
- contains_group = groups.split(", ").include?(options[:group])
108
- next unless options[:groups] || contains_group
109
-
110
- gems
111
- end.compact
112
-
113
- if options[:parseable]
114
- print_gems(relevant_outdated_gems)
115
- else
116
- print_gems_table(relevant_outdated_gems)
117
- end
118
- elsif options[:parseable]
119
- print_gems(outdated_gems)
118
+ if options[:parseable]
119
+ print_gems(relevant_outdated_gems)
120
120
  else
121
- print_gems_table(outdated_gems)
121
+ print_gems_table(relevant_outdated_gems)
122
122
  end
123
123
 
124
124
  exit 1
@@ -155,7 +155,7 @@ module Bundler
155
155
 
156
156
  return active_spec if strict
157
157
 
158
- active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
158
+ active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.installable_on_platform?(current_spec.platform) }.sort_by(&:version)
159
159
  if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
160
160
  active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
161
161
  end
@@ -5,14 +5,15 @@ module Bundler
5
5
  class CLI::Plugin < Thor
6
6
  desc "install PLUGINS", "Install the plugin from the source"
7
7
  long_desc <<-D
8
- Install plugins either from the rubygems source provided (with --source option) or from a git source provided with --git (for remote repos) or --local_git (for local repos). If no sources are provided, it uses Gem.sources
8
+ Install plugins either from the rubygems source provided (with --source option), from a git source provided with --git, or a local path provided with --path. If no sources are provided, it uses Gem.sources
9
9
  D
10
10
  method_option "source", type: :string, default: nil, banner: "URL of the RubyGems source to fetch the plugin from"
11
11
  method_option "version", type: :string, default: nil, banner: "The version of the plugin to fetch"
12
12
  method_option "git", type: :string, default: nil, banner: "URL of the git repo to fetch from"
13
- method_option "local_git", type: :string, default: nil, banner: "Path of the local git repo to fetch from"
13
+ method_option "local_git", type: :string, default: nil, banner: "Path of the local git repo to fetch from (deprecated)"
14
14
  method_option "branch", type: :string, default: nil, banner: "The git branch to checkout"
15
15
  method_option "ref", type: :string, default: nil, banner: "The git revision to check out"
16
+ method_option "path", type: :string, default: nil, banner: "Path of a local gem to directly use"
16
17
  def install(*plugins)
17
18
  Bundler::Plugin.install(plugins, options)
18
19
  end
@@ -49,7 +49,7 @@ module Bundler
49
49
  true
50
50
  end.map(&:name)
51
51
 
52
- jobs = installer.send(:installation_parallelization, {})
52
+ jobs = installer.send(:installation_parallelization)
53
53
  pristine_count = definition.specs.count - installed_specs.count
54
54
  # allow a pristining a single gem to skip the parallel worker
55
55
  jobs = [jobs, pristine_count].min
@@ -24,7 +24,7 @@ module Bundler
24
24
  return unless spec
25
25
  path = spec.full_gem_path
26
26
  unless File.directory?(path)
27
- return Bundler.ui.warn "The gem #{gem_name} has been deleted. It was installed at: #{path}"
27
+ return Bundler.ui.warn "The gem #{gem_name} is missing. It should be installed at #{path}, but was not found"
28
28
  end
29
29
  end
30
30
  return Bundler.ui.info(path)
@@ -59,9 +59,9 @@ module Bundler
59
59
  definition = Bundler.definition(true)
60
60
  if options[:outdated]
61
61
  Bundler.ui.info "Fetching remote specs for outdated check...\n\n"
62
- Bundler.ui.silence { definition.resolve_remotely! }
62
+ Bundler.ui.silence { definition.remotely! }
63
63
  else
64
- definition.resolve_with_cache!
64
+ definition.with_cache!
65
65
  end
66
66
  Bundler.reset!
67
67
  definition.specs