rubygems-update 3.3.18 → 3.6.2

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 (832) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2182 -1067
  3. data/CODE_OF_CONDUCT.md +79 -28
  4. data/Manifest.txt +184 -290
  5. data/README.md +35 -19
  6. data/bundler/CHANGELOG.md +1003 -3
  7. data/bundler/README.md +3 -7
  8. data/bundler/bundler.gemspec +11 -11
  9. data/bundler/exe/bundle +5 -25
  10. data/bundler/lib/bundler/build_metadata.rb +3 -3
  11. data/bundler/lib/bundler/capistrano.rb +1 -1
  12. data/bundler/lib/bundler/checksum.rb +254 -0
  13. data/bundler/lib/bundler/ci_detector.rb +75 -0
  14. data/bundler/lib/bundler/cli/add.rb +7 -5
  15. data/bundler/lib/bundler/cli/binstubs.rb +10 -6
  16. data/bundler/lib/bundler/cli/cache.rb +1 -1
  17. data/bundler/lib/bundler/cli/check.rb +4 -4
  18. data/bundler/lib/bundler/cli/common.rb +11 -1
  19. data/bundler/lib/bundler/cli/config.rb +8 -7
  20. data/bundler/lib/bundler/cli/console.rb +2 -5
  21. data/bundler/lib/bundler/cli/doctor.rb +10 -12
  22. data/bundler/lib/bundler/cli/exec.rb +2 -1
  23. data/bundler/lib/bundler/cli/fund.rb +1 -1
  24. data/bundler/lib/bundler/cli/gem.rb +77 -53
  25. data/bundler/lib/bundler/cli/info.rb +4 -15
  26. data/bundler/lib/bundler/cli/init.rb +6 -2
  27. data/bundler/lib/bundler/cli/inject.rb +1 -1
  28. data/bundler/lib/bundler/cli/install.rb +27 -15
  29. data/bundler/lib/bundler/cli/issue.rb +1 -1
  30. data/bundler/lib/bundler/cli/lock.rb +54 -28
  31. data/bundler/lib/bundler/cli/open.rb +9 -9
  32. data/bundler/lib/bundler/cli/outdated.rb +34 -29
  33. data/bundler/lib/bundler/cli/platform.rb +7 -5
  34. data/bundler/lib/bundler/cli/plugin.rb +9 -15
  35. data/bundler/lib/bundler/cli/pristine.rb +38 -30
  36. data/bundler/lib/bundler/cli/show.rb +4 -4
  37. data/bundler/lib/bundler/cli/update.rb +6 -5
  38. data/bundler/lib/bundler/cli/viz.rb +1 -1
  39. data/bundler/lib/bundler/cli.rb +258 -307
  40. data/bundler/lib/bundler/compact_index_client/cache.rb +55 -60
  41. data/bundler/lib/bundler/compact_index_client/cache_file.rb +148 -0
  42. data/bundler/lib/bundler/compact_index_client/gem_parser.rb +7 -3
  43. data/bundler/lib/bundler/compact_index_client/parser.rb +84 -0
  44. data/bundler/lib/bundler/compact_index_client/updater.rb +71 -83
  45. data/bundler/lib/bundler/compact_index_client.rb +58 -80
  46. data/bundler/lib/bundler/constants.rb +9 -2
  47. data/bundler/lib/bundler/current_ruby.rb +11 -16
  48. data/bundler/lib/bundler/definition.rb +547 -228
  49. data/bundler/lib/bundler/dependency.rb +30 -87
  50. data/bundler/lib/bundler/digest.rb +3 -3
  51. data/bundler/lib/bundler/dsl.rb +115 -65
  52. data/bundler/lib/bundler/endpoint_specification.rb +27 -14
  53. data/bundler/lib/bundler/env.rb +5 -7
  54. data/bundler/lib/bundler/environment_preserver.rb +8 -25
  55. data/bundler/lib/bundler/errors.rb +85 -11
  56. data/bundler/lib/bundler/feature_flag.rb +1 -2
  57. data/bundler/lib/bundler/fetcher/base.rb +5 -3
  58. data/bundler/lib/bundler/fetcher/compact_index.rb +28 -43
  59. data/bundler/lib/bundler/fetcher/dependency.rb +3 -7
  60. data/bundler/lib/bundler/fetcher/downloader.rb +17 -16
  61. data/bundler/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
  62. data/bundler/lib/bundler/fetcher/index.rb +2 -3
  63. data/bundler/lib/bundler/fetcher.rb +91 -74
  64. data/bundler/lib/bundler/force_platform.rb +16 -0
  65. data/bundler/lib/bundler/friendly_errors.rb +6 -9
  66. data/bundler/lib/bundler/gem_helper.rb +5 -6
  67. data/bundler/lib/bundler/gem_helpers.rb +45 -7
  68. data/bundler/lib/bundler/gem_version_promoter.rb +68 -109
  69. data/bundler/lib/bundler/graph.rb +9 -9
  70. data/bundler/lib/bundler/index.rb +69 -73
  71. data/bundler/lib/bundler/injector.rb +12 -13
  72. data/bundler/lib/bundler/inline.rb +40 -17
  73. data/bundler/lib/bundler/installer/gem_installer.rb +13 -12
  74. data/bundler/lib/bundler/installer/parallel_installer.rb +19 -66
  75. data/bundler/lib/bundler/installer/standalone.rb +29 -15
  76. data/bundler/lib/bundler/installer.rb +27 -77
  77. data/bundler/lib/bundler/lazy_specification.rb +134 -71
  78. data/bundler/lib/bundler/lockfile_generator.rb +13 -4
  79. data/bundler/lib/bundler/lockfile_parser.rb +134 -61
  80. data/bundler/lib/bundler/man/bundle-add.1 +46 -48
  81. data/bundler/lib/bundler/man/bundle-add.1.ronn +54 -22
  82. data/bundler/lib/bundler/man/bundle-binstubs.1 +10 -19
  83. data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
  84. data/bundler/lib/bundler/man/bundle-cache.1 +38 -25
  85. data/bundler/lib/bundler/man/bundle-cache.1.ronn +40 -4
  86. data/bundler/lib/bundler/man/bundle-check.1 +7 -14
  87. data/bundler/lib/bundler/man/bundle-check.1.ronn +7 -2
  88. data/bundler/lib/bundler/man/bundle-clean.1 +4 -11
  89. data/bundler/lib/bundler/man/bundle-clean.1.ronn +1 -1
  90. data/bundler/lib/bundler/man/bundle-config.1 +41 -220
  91. data/bundler/lib/bundler/man/bundle-config.1.ronn +27 -22
  92. data/bundler/lib/bundler/man/bundle-console.1 +33 -0
  93. data/bundler/lib/bundler/man/bundle-console.1.ronn +39 -0
  94. data/bundler/lib/bundler/man/bundle-doctor.1 +5 -19
  95. data/bundler/lib/bundler/man/bundle-doctor.1.ronn +1 -1
  96. data/bundler/lib/bundler/man/bundle-env.1 +9 -0
  97. data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
  98. data/bundler/lib/bundler/man/bundle-exec.1 +20 -78
  99. data/bundler/lib/bundler/man/bundle-exec.1.ronn +12 -10
  100. data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
  101. data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
  102. data/bundler/lib/bundler/man/bundle-gem.1 +53 -81
  103. data/bundler/lib/bundler/man/bundle-gem.1.ronn +41 -9
  104. data/bundler/lib/bundler/man/bundle-help.1 +9 -0
  105. data/bundler/lib/bundler/man/bundle-help.1.ronn +12 -0
  106. data/bundler/lib/bundler/man/bundle-info.1 +8 -11
  107. data/bundler/lib/bundler/man/bundle-info.1.ronn +9 -5
  108. data/bundler/lib/bundler/man/bundle-init.1 +7 -12
  109. data/bundler/lib/bundler/man/bundle-init.1.ronn +4 -1
  110. data/bundler/lib/bundler/man/bundle-inject.1 +17 -19
  111. data/bundler/lib/bundler/man/bundle-inject.1.ronn +12 -2
  112. data/bundler/lib/bundler/man/bundle-install.1 +42 -162
  113. data/bundler/lib/bundler/man/bundle-install.1.ronn +31 -49
  114. data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
  115. data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
  116. data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
  117. data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  118. data/bundler/lib/bundler/man/bundle-list.1 +4 -19
  119. data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
  120. data/bundler/lib/bundler/man/bundle-lock.1 +25 -34
  121. data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
  122. data/bundler/lib/bundler/man/bundle-open.1 +18 -18
  123. data/bundler/lib/bundler/man/bundle-open.1.ronn +10 -1
  124. data/bundler/lib/bundler/man/bundle-outdated.1 +22 -67
  125. data/bundler/lib/bundler/man/bundle-outdated.1.ronn +20 -12
  126. data/bundler/lib/bundler/man/bundle-platform.1 +16 -28
  127. data/bundler/lib/bundler/man/bundle-platform.1.ronn +14 -7
  128. data/bundler/lib/bundler/man/bundle-plugin.1 +58 -0
  129. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +63 -0
  130. data/bundler/lib/bundler/man/bundle-pristine.1 +5 -16
  131. data/bundler/lib/bundler/man/bundle-pristine.1.ronn +1 -1
  132. data/bundler/lib/bundler/man/bundle-remove.1 +4 -14
  133. data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
  134. data/bundler/lib/bundler/man/bundle-show.1 +7 -11
  135. data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
  136. data/bundler/lib/bundler/man/bundle-update.1 +30 -143
  137. data/bundler/lib/bundler/man/bundle-update.1.ronn +14 -6
  138. data/bundler/lib/bundler/man/bundle-version.1 +22 -0
  139. data/bundler/lib/bundler/man/bundle-version.1.ronn +24 -0
  140. data/bundler/lib/bundler/man/bundle-viz.1 +9 -18
  141. data/bundler/lib/bundler/man/bundle-viz.1.ronn +9 -3
  142. data/bundler/lib/bundler/man/bundle.1 +17 -51
  143. data/bundler/lib/bundler/man/bundle.1.ronn +12 -7
  144. data/bundler/lib/bundler/man/gemfile.5 +77 -341
  145. data/bundler/lib/bundler/man/gemfile.5.ronn +73 -54
  146. data/bundler/lib/bundler/man/index.txt +8 -0
  147. data/bundler/lib/bundler/match_metadata.rb +17 -0
  148. data/bundler/lib/bundler/match_platform.rb +1 -1
  149. data/bundler/lib/bundler/match_remote_metadata.rb +29 -0
  150. data/bundler/lib/bundler/materialization.rb +59 -0
  151. data/bundler/lib/bundler/mirror.rb +8 -10
  152. data/bundler/lib/bundler/plugin/api/source.rb +7 -5
  153. data/bundler/lib/bundler/plugin/events.rb +24 -0
  154. data/bundler/lib/bundler/plugin/index.rb +13 -5
  155. data/bundler/lib/bundler/plugin/installer/path.rb +18 -0
  156. data/bundler/lib/bundler/plugin/installer/rubygems.rb +0 -4
  157. data/bundler/lib/bundler/plugin/installer.rb +42 -19
  158. data/bundler/lib/bundler/plugin/source_list.rb +4 -4
  159. data/bundler/lib/bundler/plugin.rb +35 -7
  160. data/bundler/lib/bundler/process_lock.rb +10 -14
  161. data/bundler/lib/bundler/remote_specification.rb +17 -13
  162. data/bundler/lib/bundler/resolver/base.rb +117 -0
  163. data/bundler/lib/bundler/resolver/candidate.rb +82 -0
  164. data/bundler/lib/bundler/resolver/incompatibility.rb +15 -0
  165. data/bundler/lib/bundler/resolver/package.rb +90 -0
  166. data/bundler/lib/bundler/resolver/root.rb +25 -0
  167. data/bundler/lib/bundler/resolver/spec_group.rb +54 -67
  168. data/bundler/lib/bundler/resolver.rb +432 -329
  169. data/bundler/lib/bundler/retry.rb +2 -2
  170. data/bundler/lib/bundler/ruby_dsl.rb +42 -7
  171. data/bundler/lib/bundler/ruby_version.rb +23 -10
  172. data/bundler/lib/bundler/rubygems_ext.rb +286 -81
  173. data/bundler/lib/bundler/rubygems_gem_installer.rb +77 -68
  174. data/bundler/lib/bundler/rubygems_integration.rb +57 -155
  175. data/bundler/lib/bundler/runtime.rb +28 -17
  176. data/bundler/lib/bundler/safe_marshal.rb +31 -0
  177. data/bundler/lib/bundler/self_manager.rb +50 -12
  178. data/bundler/lib/bundler/settings.rb +144 -58
  179. data/bundler/lib/bundler/setup.rb +13 -1
  180. data/bundler/lib/bundler/shared_helpers.rb +87 -36
  181. data/bundler/lib/bundler/source/git/git_proxy.rb +278 -80
  182. data/bundler/lib/bundler/source/git.rb +161 -68
  183. data/bundler/lib/bundler/source/metadata.rb +16 -16
  184. data/bundler/lib/bundler/source/path/installer.rb +1 -22
  185. data/bundler/lib/bundler/source/path.rb +16 -26
  186. data/bundler/lib/bundler/source/rubygems/remote.rb +1 -1
  187. data/bundler/lib/bundler/source/rubygems.rb +94 -154
  188. data/bundler/lib/bundler/source.rb +3 -1
  189. data/bundler/lib/bundler/source_list.rb +34 -4
  190. data/bundler/lib/bundler/spec_set.rb +195 -65
  191. data/bundler/lib/bundler/stub_specification.rb +34 -4
  192. data/bundler/lib/bundler/templates/Executable +1 -1
  193. data/bundler/lib/bundler/templates/Executable.bundler +6 -11
  194. data/bundler/lib/bundler/templates/Executable.standalone +2 -0
  195. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
  196. data/bundler/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
  197. data/bundler/lib/bundler/templates/newgem/README.md.tt +11 -5
  198. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +19 -8
  199. data/bundler/lib/bundler/templates/newgem/bin/console.tt +0 -4
  200. data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
  201. data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
  202. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
  203. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  204. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
  205. data/bundler/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
  206. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -8
  207. data/bundler/lib/bundler/templates/newgem/gitignore.tt +3 -0
  208. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +13 -4
  209. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +12 -4
  210. data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
  211. data/bundler/lib/bundler/templates/newgem/standard.yml.tt +1 -1
  212. data/bundler/lib/bundler/ui/rg_proxy.rb +1 -1
  213. data/bundler/lib/bundler/ui/shell.rb +60 -15
  214. data/bundler/lib/bundler/ui/silent.rb +33 -6
  215. data/bundler/lib/bundler/uri_credentials_filter.rb +3 -3
  216. data/bundler/lib/bundler/uri_normalizer.rb +23 -0
  217. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +3 -3
  218. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  219. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -1
  220. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +56 -7
  221. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -418
  222. data/bundler/lib/bundler/vendor/net-http-persistent/.document +1 -0
  223. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  224. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +4 -3
  225. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +23 -11
  226. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +1 -1
  227. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +102 -64
  228. data/bundler/lib/bundler/vendor/pub_grub/.document +1 -0
  229. data/bundler/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  230. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  231. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
  232. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  233. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
  234. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  235. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  236. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  237. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  238. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
  239. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  240. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  241. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
  242. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
  243. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +248 -0
  244. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  245. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  246. data/bundler/lib/bundler/vendor/securerandom/.document +1 -0
  247. data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
  248. data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
  249. data/bundler/lib/bundler/vendor/thor/.document +1 -0
  250. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
  251. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +1 -1
  252. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
  253. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +11 -15
  254. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +15 -4
  255. data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +15 -15
  256. data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +140 -14
  257. data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +13 -4
  258. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +4 -0
  259. data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +16 -25
  260. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +12 -1
  261. data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -1
  262. data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +2 -2
  263. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +17 -1
  264. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +33 -17
  265. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +28 -9
  266. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +46 -7
  267. data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +2 -2
  268. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +40 -30
  269. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +35 -159
  270. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -46
  271. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
  272. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -46
  273. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +118 -0
  274. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
  275. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
  276. data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
  277. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +8 -7
  278. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  279. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +166 -8
  280. data/bundler/lib/bundler/vendor/tsort/.document +1 -0
  281. data/bundler/lib/bundler/vendor/tsort/lib/tsort.rb +3 -0
  282. data/bundler/lib/bundler/vendor/uri/.document +1 -0
  283. data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
  284. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +343 -148
  285. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +10 -4
  286. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +3 -2
  287. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +44 -33
  288. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +40 -2
  289. data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +2 -1
  290. data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
  291. data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
  292. data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -2
  293. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +25 -12
  294. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +130 -38
  295. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  296. data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +1 -2
  297. data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +2 -1
  298. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +12 -11
  299. data/bundler/lib/bundler/vendored_net_http.rb +23 -0
  300. data/bundler/lib/bundler/vendored_persistent.rb +0 -36
  301. data/bundler/lib/bundler/{vendored_tmpdir.rb → vendored_pub_grub.rb} +1 -1
  302. data/bundler/lib/bundler/vendored_securerandom.rb +12 -0
  303. data/bundler/lib/bundler/vendored_timeout.rb +12 -0
  304. data/bundler/lib/bundler/vendored_uri.rb +18 -1
  305. data/bundler/lib/bundler/version.rb +5 -1
  306. data/bundler/lib/bundler/vlad.rb +1 -1
  307. data/bundler/lib/bundler/worker.rb +5 -7
  308. data/bundler/lib/bundler/yaml_serializer.rb +22 -13
  309. data/bundler/lib/bundler.rb +155 -148
  310. data/{bundler → doc/bundler}/UPGRADING.md +11 -4
  311. data/{CONTRIBUTING.md → doc/rubygems/CONTRIBUTING.md} +40 -17
  312. data/doc/rubygems/POLICIES.md +204 -0
  313. data/{test/rubygems/fake_certlib/openssl.rb → exe/gem} +5 -1
  314. data/{bin → exe}/update_rubygems +12 -10
  315. data/lib/rubygems/available_set.rb +8 -7
  316. data/lib/rubygems/basic_specification.rb +90 -52
  317. data/lib/rubygems/bundler_version_finder.rb +6 -6
  318. data/lib/rubygems/ci_detector.rb +75 -0
  319. data/lib/rubygems/command.rb +68 -64
  320. data/lib/rubygems/command_manager.rb +39 -24
  321. data/lib/rubygems/commands/build_command.rb +14 -19
  322. data/lib/rubygems/commands/cert_command.rb +39 -39
  323. data/lib/rubygems/commands/check_command.rb +30 -25
  324. data/lib/rubygems/commands/cleanup_command.rb +32 -43
  325. data/lib/rubygems/commands/contents_command.rb +33 -25
  326. data/lib/rubygems/commands/dependency_command.rb +22 -23
  327. data/lib/rubygems/commands/environment_command.rb +8 -9
  328. data/lib/rubygems/commands/exec_command.rb +247 -0
  329. data/lib/rubygems/commands/fetch_command.rb +25 -10
  330. data/lib/rubygems/commands/generate_index_command.rb +40 -74
  331. data/lib/rubygems/commands/help_command.rb +15 -14
  332. data/lib/rubygems/commands/info_command.rb +5 -5
  333. data/lib/rubygems/commands/install_command.rb +31 -38
  334. data/lib/rubygems/commands/list_command.rb +6 -5
  335. data/lib/rubygems/commands/lock_command.rb +6 -5
  336. data/lib/rubygems/commands/mirror_command.rb +4 -3
  337. data/lib/rubygems/commands/open_command.rb +11 -12
  338. data/lib/rubygems/commands/outdated_command.rb +6 -5
  339. data/lib/rubygems/commands/owner_command.rb +23 -22
  340. data/lib/rubygems/commands/pristine_command.rb +83 -62
  341. data/lib/rubygems/commands/push_command.rb +38 -13
  342. data/lib/rubygems/commands/query_command.rb +11 -11
  343. data/lib/rubygems/commands/rdoc_command.rb +23 -28
  344. data/lib/rubygems/commands/rebuild_command.rb +262 -0
  345. data/lib/rubygems/commands/search_command.rb +6 -5
  346. data/lib/rubygems/commands/server_command.rb +4 -3
  347. data/lib/rubygems/commands/setup_command.rb +137 -154
  348. data/lib/rubygems/commands/signin_command.rb +10 -9
  349. data/lib/rubygems/commands/signout_command.rb +8 -7
  350. data/lib/rubygems/commands/sources_command.rb +34 -33
  351. data/lib/rubygems/commands/specification_command.rb +25 -20
  352. data/lib/rubygems/commands/stale_command.rb +5 -4
  353. data/lib/rubygems/commands/uninstall_command.rb +66 -59
  354. data/lib/rubygems/commands/unpack_command.rb +23 -30
  355. data/lib/rubygems/commands/update_command.rb +62 -94
  356. data/lib/rubygems/commands/which_command.rb +9 -8
  357. data/lib/rubygems/commands/yank_command.rb +14 -13
  358. data/lib/rubygems/compatibility.rb +5 -6
  359. data/lib/rubygems/config_file.rb +160 -50
  360. data/lib/rubygems/core_ext/kernel_gem.rb +3 -10
  361. data/lib/rubygems/core_ext/kernel_require.rb +88 -114
  362. data/lib/rubygems/core_ext/kernel_warn.rb +30 -39
  363. data/lib/rubygems/core_ext/tcpsocket_init.rb +4 -2
  364. data/lib/rubygems/defaults.rb +53 -22
  365. data/lib/rubygems/dependency.rb +34 -36
  366. data/lib/rubygems/dependency_installer.rb +52 -56
  367. data/lib/rubygems/dependency_list.rb +8 -7
  368. data/lib/rubygems/deprecate.rb +80 -75
  369. data/lib/rubygems/doctor.rb +23 -22
  370. data/lib/rubygems/errors.rb +6 -8
  371. data/lib/rubygems/exceptions.rb +20 -18
  372. data/lib/rubygems/ext/build_error.rb +2 -1
  373. data/lib/rubygems/ext/builder.rb +56 -32
  374. data/lib/rubygems/ext/cargo_builder/link_flag_converter.rb +9 -5
  375. data/lib/rubygems/ext/cargo_builder.rb +158 -131
  376. data/lib/rubygems/ext/cmake_builder.rb +9 -4
  377. data/lib/rubygems/ext/configure_builder.rb +9 -3
  378. data/lib/rubygems/ext/ext_conf_builder.rb +19 -15
  379. data/lib/rubygems/ext/rake_builder.rb +14 -7
  380. data/lib/rubygems/ext.rb +8 -7
  381. data/lib/rubygems/gem_runner.rb +23 -9
  382. data/lib/rubygems/gemcutter_utilities/webauthn_listener/response.rb +163 -0
  383. data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +105 -0
  384. data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +80 -0
  385. data/lib/rubygems/gemcutter_utilities.rb +141 -63
  386. data/lib/rubygems/gemspec_helpers.rb +19 -0
  387. data/lib/rubygems/install_default_message.rb +3 -2
  388. data/lib/rubygems/install_message.rb +3 -2
  389. data/lib/rubygems/install_update_options.rb +72 -67
  390. data/lib/rubygems/installer.rb +148 -130
  391. data/lib/rubygems/installer_uninstaller_utils.rb +2 -4
  392. data/lib/rubygems/local_remote_options.rb +24 -28
  393. data/lib/rubygems/name_tuple.rb +10 -11
  394. data/lib/rubygems/package/digest_io.rb +2 -1
  395. data/lib/rubygems/package/file_source.rb +3 -2
  396. data/lib/rubygems/package/io_source.rb +1 -0
  397. data/lib/rubygems/package/old.rb +11 -10
  398. data/lib/rubygems/package/source.rb +1 -0
  399. data/lib/rubygems/package/tar_header.rb +125 -91
  400. data/lib/rubygems/package/tar_reader/entry.rb +106 -29
  401. data/lib/rubygems/package/tar_reader.rb +16 -39
  402. data/lib/rubygems/package/tar_writer.rb +29 -26
  403. data/lib/rubygems/package.rb +122 -84
  404. data/lib/rubygems/package_task.rb +7 -6
  405. data/lib/rubygems/path_support.rb +11 -11
  406. data/lib/rubygems/platform.rb +119 -70
  407. data/lib/rubygems/psych_tree.rb +6 -1
  408. data/lib/rubygems/query_utils.rb +46 -48
  409. data/lib/rubygems/rdoc.rb +13 -3
  410. data/lib/rubygems/remote_fetcher.rb +47 -39
  411. data/lib/rubygems/request/connection_pools.rb +6 -6
  412. data/lib/rubygems/request/http_pool.rb +2 -1
  413. data/lib/rubygems/request/https_pool.rb +1 -0
  414. data/lib/rubygems/request.rb +48 -44
  415. data/lib/rubygems/request_set/gem_dependency_api.rb +141 -144
  416. data/lib/rubygems/request_set/lockfile/parser.rb +31 -30
  417. data/lib/rubygems/request_set/lockfile/tokenizer.rb +24 -14
  418. data/lib/rubygems/request_set/lockfile.rb +11 -15
  419. data/lib/rubygems/request_set.rb +25 -23
  420. data/lib/rubygems/requirement.rb +30 -27
  421. data/lib/rubygems/resolver/activation_request.rb +7 -10
  422. data/lib/rubygems/resolver/api_set/gem_parser.rb +7 -3
  423. data/lib/rubygems/resolver/api_set.rb +20 -13
  424. data/lib/rubygems/resolver/api_specification.rb +8 -7
  425. data/lib/rubygems/resolver/best_set.rb +5 -32
  426. data/lib/rubygems/resolver/composed_set.rb +4 -3
  427. data/lib/rubygems/resolver/conflict.rb +14 -21
  428. data/lib/rubygems/resolver/current_set.rb +1 -0
  429. data/lib/rubygems/resolver/dependency_request.rb +3 -2
  430. data/lib/rubygems/resolver/git_set.rb +2 -2
  431. data/lib/rubygems/resolver/git_specification.rb +7 -6
  432. data/lib/rubygems/resolver/index_set.rb +10 -9
  433. data/lib/rubygems/resolver/index_specification.rb +8 -6
  434. data/lib/rubygems/resolver/installed_specification.rb +6 -5
  435. data/lib/rubygems/resolver/installer_set.rb +19 -22
  436. data/lib/rubygems/resolver/local_specification.rb +4 -3
  437. data/lib/rubygems/resolver/lock_set.rb +6 -5
  438. data/lib/rubygems/resolver/lock_specification.rb +5 -4
  439. data/lib/rubygems/resolver/requirement_list.rb +1 -0
  440. data/lib/rubygems/resolver/set.rb +1 -0
  441. data/lib/rubygems/resolver/source_set.rb +2 -0
  442. data/lib/rubygems/resolver/spec_specification.rb +8 -0
  443. data/lib/rubygems/resolver/specification.rb +2 -1
  444. data/lib/rubygems/resolver/stats.rb +2 -1
  445. data/lib/rubygems/resolver/vendor_set.rb +2 -1
  446. data/lib/rubygems/resolver/vendor_specification.rb +4 -3
  447. data/lib/rubygems/resolver.rb +51 -57
  448. data/lib/rubygems/s3_uri_signer.rb +18 -16
  449. data/lib/rubygems/safe_marshal/elements.rb +146 -0
  450. data/lib/rubygems/safe_marshal/reader.rb +325 -0
  451. data/lib/rubygems/safe_marshal/visitors/stream_printer.rb +31 -0
  452. data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +428 -0
  453. data/lib/rubygems/safe_marshal/visitors/visitor.rb +74 -0
  454. data/lib/rubygems/safe_marshal.rb +74 -0
  455. data/lib/rubygems/safe_yaml.rb +14 -26
  456. data/lib/rubygems/security/policies.rb +48 -49
  457. data/lib/rubygems/security/policy.rb +25 -28
  458. data/lib/rubygems/security/signer.rb +16 -7
  459. data/lib/rubygems/security/trust_dir.rb +12 -13
  460. data/lib/rubygems/security.rb +40 -66
  461. data/lib/rubygems/security_option.rb +7 -6
  462. data/lib/rubygems/shellwords.rb +3 -0
  463. data/lib/rubygems/source/git.rb +34 -31
  464. data/lib/rubygems/source/installed.rb +4 -3
  465. data/lib/rubygems/source/local.rb +49 -49
  466. data/lib/rubygems/source/lock.rb +2 -3
  467. data/lib/rubygems/source/specific_file.rb +6 -4
  468. data/lib/rubygems/source/vendor.rb +1 -2
  469. data/lib/rubygems/source.rb +37 -31
  470. data/lib/rubygems/source_list.rb +8 -8
  471. data/lib/rubygems/spec_fetcher.rb +95 -66
  472. data/lib/rubygems/specification.rb +342 -404
  473. data/lib/rubygems/specification_policy.rb +147 -75
  474. data/lib/rubygems/specification_record.rb +212 -0
  475. data/lib/rubygems/stub_specification.rb +56 -30
  476. data/lib/rubygems/target_rbconfig.rb +50 -0
  477. data/lib/rubygems/text.rb +3 -4
  478. data/lib/rubygems/uninstaller.rb +67 -48
  479. data/lib/rubygems/update_suggestion.rb +56 -0
  480. data/lib/rubygems/uri.rb +10 -10
  481. data/lib/rubygems/uri_formatter.rb +2 -2
  482. data/lib/rubygems/user_interaction.rb +50 -40
  483. data/lib/rubygems/util/licenses.rb +310 -39
  484. data/lib/rubygems/util/list.rb +4 -1
  485. data/lib/rubygems/util.rb +19 -20
  486. data/lib/rubygems/validator.rb +15 -14
  487. data/lib/rubygems/vendor/molinillo/.document +1 -0
  488. data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
  489. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +11 -11
  490. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
  491. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
  492. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
  493. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
  494. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
  495. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +1 -1
  496. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
  497. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
  498. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +1 -1
  499. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/dependency_graph.rb +3 -3
  500. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/errors.rb +1 -1
  501. data/lib/rubygems/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
  502. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +2 -2
  503. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/modules/ui.rb +1 -1
  504. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/resolution.rb +4 -4
  505. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/resolver.rb +1 -1
  506. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo/state.rb +1 -1
  507. data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/lib/molinillo.rb +2 -2
  508. data/lib/rubygems/vendor/net-http/.document +1 -0
  509. data/lib/rubygems/vendor/net-http/COPYING +56 -0
  510. data/lib/rubygems/vendor/net-http/lib/net/http/exceptions.rb +34 -0
  511. data/lib/rubygems/vendor/net-http/lib/net/http/generic_request.rb +414 -0
  512. data/lib/rubygems/vendor/net-http/lib/net/http/header.rb +981 -0
  513. data/lib/rubygems/vendor/net-http/lib/net/http/proxy_delta.rb +17 -0
  514. data/lib/rubygems/vendor/net-http/lib/net/http/request.rb +88 -0
  515. data/lib/rubygems/vendor/net-http/lib/net/http/requests.rb +430 -0
  516. data/lib/rubygems/vendor/net-http/lib/net/http/response.rb +738 -0
  517. data/lib/rubygems/vendor/net-http/lib/net/http/responses.rb +1174 -0
  518. data/lib/rubygems/vendor/net-http/lib/net/http/status.rb +84 -0
  519. data/lib/rubygems/vendor/net-http/lib/net/http.rb +2580 -0
  520. data/lib/rubygems/vendor/net-http/lib/net/https.rb +23 -0
  521. data/lib/rubygems/vendor/net-protocol/.document +1 -0
  522. data/lib/rubygems/vendor/net-protocol/lib/net/protocol.rb +544 -0
  523. data/lib/rubygems/vendor/optparse/.document +1 -0
  524. data/lib/rubygems/vendor/optparse/COPYING +56 -0
  525. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/ac.rb +16 -0
  526. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/kwargs.rb +8 -3
  527. data/lib/rubygems/vendor/optparse/lib/optparse/uri.rb +7 -0
  528. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/version.rb +9 -0
  529. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse.rb +206 -83
  530. data/lib/rubygems/vendor/resolv/.document +1 -0
  531. data/lib/rubygems/vendor/resolv/COPYING +56 -0
  532. data/lib/rubygems/vendor/resolv/lib/resolv.rb +3455 -0
  533. data/lib/rubygems/vendor/securerandom/.document +1 -0
  534. data/lib/rubygems/vendor/securerandom/COPYING +56 -0
  535. data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +102 -0
  536. data/lib/rubygems/vendor/timeout/.document +1 -0
  537. data/lib/rubygems/vendor/timeout/COPYING +56 -0
  538. data/lib/rubygems/vendor/timeout/lib/timeout.rb +198 -0
  539. data/lib/rubygems/vendor/tsort/.document +1 -0
  540. data/lib/rubygems/vendor/tsort/lib/tsort.rb +455 -0
  541. data/lib/rubygems/vendor/uri/.document +1 -0
  542. data/lib/rubygems/vendor/uri/COPYING +56 -0
  543. data/lib/rubygems/vendor/uri/lib/uri/common.rb +876 -0
  544. data/lib/rubygems/vendor/uri/lib/uri/file.rb +100 -0
  545. data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +267 -0
  546. data/lib/rubygems/vendor/uri/lib/uri/generic.rb +1578 -0
  547. data/lib/rubygems/vendor/uri/lib/uri/http.rb +125 -0
  548. data/lib/rubygems/vendor/uri/lib/uri/https.rb +23 -0
  549. data/lib/rubygems/vendor/uri/lib/uri/ldap.rb +261 -0
  550. data/lib/rubygems/vendor/uri/lib/uri/ldaps.rb +22 -0
  551. data/lib/rubygems/vendor/uri/lib/uri/mailto.rb +293 -0
  552. data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  553. data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
  554. data/lib/rubygems/vendor/uri/lib/uri/version.rb +6 -0
  555. data/lib/rubygems/vendor/uri/lib/uri/ws.rb +83 -0
  556. data/lib/rubygems/vendor/uri/lib/uri/wss.rb +23 -0
  557. data/lib/rubygems/vendor/uri/lib/uri.rb +104 -0
  558. data/{bundler/lib/bundler → lib/rubygems}/vendored_molinillo.rb +0 -1
  559. data/lib/rubygems/vendored_net_http.rb +5 -0
  560. data/lib/rubygems/vendored_optparse.rb +3 -0
  561. data/lib/rubygems/vendored_securerandom.rb +3 -0
  562. data/lib/rubygems/vendored_timeout.rb +5 -0
  563. data/lib/rubygems/vendored_tsort.rb +3 -0
  564. data/lib/rubygems/version.rb +57 -45
  565. data/lib/rubygems/version_option.rb +6 -8
  566. data/lib/rubygems/yaml_serializer.rb +98 -0
  567. data/lib/rubygems.rb +191 -133
  568. data/rubygems-update.gemspec +16 -9
  569. data/setup.rb +12 -9
  570. metadata +233 -307
  571. data/POLICIES.md +0 -100
  572. data/bin/gem +0 -13
  573. data/bundler/lib/bundler/dep_proxy.rb +0 -55
  574. data/bundler/lib/bundler/templates/gems.rb +0 -5
  575. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +0 -5
  576. data/bundler/lib/bundler/templates/newgem/travis.yml.tt +0 -6
  577. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  578. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  579. data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
  580. data/bundler/lib/bundler/version_ranges.rb +0 -122
  581. data/lib/rubygems/indexer.rb +0 -427
  582. data/lib/rubygems/mock_gem_ui.rb +0 -85
  583. data/lib/rubygems/optparse/lib/optparse/uri.rb +0 -7
  584. data/lib/rubygems/optparse.rb +0 -3
  585. data/lib/rubygems/resolver/molinillo/LICENSE +0 -9
  586. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  587. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
  588. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
  589. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
  590. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
  591. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
  592. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
  593. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
  594. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
  595. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
  596. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
  597. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +0 -255
  598. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +0 -143
  599. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  600. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
  601. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +0 -67
  602. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +0 -839
  603. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +0 -46
  604. data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +0 -58
  605. data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +0 -11
  606. data/lib/rubygems/resolver/molinillo.rb +0 -2
  607. data/lib/rubygems/tsort/LICENSE.txt +0 -22
  608. data/lib/rubygems/tsort/lib/tsort.rb +0 -454
  609. data/lib/rubygems/tsort.rb +0 -3
  610. data/test/rubygems/alternate_cert.pem +0 -19
  611. data/test/rubygems/alternate_cert_32.pem +0 -19
  612. data/test/rubygems/alternate_key.pem +0 -27
  613. data/test/rubygems/bad_rake.rb +0 -2
  614. data/test/rubygems/ca_cert.pem +0 -77
  615. data/test/rubygems/child_cert.pem +0 -20
  616. data/test/rubygems/child_cert_32.pem +0 -20
  617. data/test/rubygems/child_key.pem +0 -27
  618. data/test/rubygems/client.pem +0 -107
  619. data/test/rubygems/data/excon-0.7.7.gemspec.rz +0 -0
  620. data/test/rubygems/data/gem-private_key.pem +0 -27
  621. data/test/rubygems/data/gem-public_cert.pem +0 -20
  622. data/test/rubygems/data/null-required-ruby-version.gemspec.rz +0 -0
  623. data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
  624. data/test/rubygems/data/pry-0.4.7.gemspec.rz +0 -0
  625. data/test/rubygems/encrypted_private_key.pem +0 -30
  626. data/test/rubygems/expired_cert.pem +0 -19
  627. data/test/rubygems/foo/discover.rb +0 -1
  628. data/test/rubygems/future_cert.pem +0 -19
  629. data/test/rubygems/future_cert_32.pem +0 -19
  630. data/test/rubygems/good_rake.rb +0 -2
  631. data/test/rubygems/grandchild_cert.pem +0 -20
  632. data/test/rubygems/grandchild_cert_32.pem +0 -20
  633. data/test/rubygems/grandchild_key.pem +0 -27
  634. data/test/rubygems/helper.rb +0 -1622
  635. data/test/rubygems/installer_test_case.rb +0 -247
  636. data/test/rubygems/invalid_client.pem +0 -49
  637. data/test/rubygems/invalid_issuer_cert.pem +0 -20
  638. data/test/rubygems/invalid_issuer_cert_32.pem +0 -20
  639. data/test/rubygems/invalid_key.pem +0 -27
  640. data/test/rubygems/invalid_signer_cert.pem +0 -19
  641. data/test/rubygems/invalid_signer_cert_32.pem +0 -19
  642. data/test/rubygems/invalidchild_cert.pem +0 -20
  643. data/test/rubygems/invalidchild_cert_32.pem +0 -20
  644. data/test/rubygems/invalidchild_key.pem +0 -27
  645. data/test/rubygems/package/tar_test_case.rb +0 -139
  646. data/test/rubygems/packages/ascii_binder-0.1.10.1.gem +0 -0
  647. data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
  648. data/test/rubygems/plugin/exception/rubygems_plugin.rb +0 -3
  649. data/test/rubygems/plugin/load/rubygems_plugin.rb +0 -4
  650. data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +0 -3
  651. data/test/rubygems/private3072_key.pem +0 -40
  652. data/test/rubygems/private_ec_key.pem +0 -9
  653. data/test/rubygems/private_key.pem +0 -27
  654. data/test/rubygems/public3072_cert.pem +0 -25
  655. data/test/rubygems/public_cert.pem +0 -20
  656. data/test/rubygems/public_cert_32.pem +0 -19
  657. data/test/rubygems/public_key.pem +0 -9
  658. data/test/rubygems/rubygems/commands/crash_command.rb +0 -4
  659. data/test/rubygems/rubygems_plugin.rb +0 -23
  660. data/test/rubygems/sff/discover.rb +0 -1
  661. data/test/rubygems/simple_gem.rb +0 -67
  662. data/test/rubygems/specifications/bar-0.0.2.gemspec +0 -7
  663. data/test/rubygems/specifications/foo-0.0.1-x86-mswin32.gemspec +0 -0
  664. data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +0 -12
  665. data/test/rubygems/ssl_cert.pem +0 -80
  666. data/test/rubygems/ssl_key.pem +0 -27
  667. data/test/rubygems/test_bundled_ca.rb +0 -60
  668. data/test/rubygems/test_config.rb +0 -27
  669. data/test/rubygems/test_deprecate.rb +0 -157
  670. data/test/rubygems/test_exit.rb +0 -11
  671. data/test/rubygems/test_gem.rb +0 -2112
  672. data/test/rubygems/test_gem_available_set.rb +0 -129
  673. data/test/rubygems/test_gem_bundler_version_finder.rb +0 -125
  674. data/test/rubygems/test_gem_command.rb +0 -400
  675. data/test/rubygems/test_gem_command_manager.rb +0 -334
  676. data/test/rubygems/test_gem_commands_build_command.rb +0 -727
  677. data/test/rubygems/test_gem_commands_cert_command.rb +0 -867
  678. data/test/rubygems/test_gem_commands_check_command.rb +0 -67
  679. data/test/rubygems/test_gem_commands_cleanup_command.rb +0 -291
  680. data/test/rubygems/test_gem_commands_contents_command.rb +0 -270
  681. data/test/rubygems/test_gem_commands_dependency_command.rb +0 -227
  682. data/test/rubygems/test_gem_commands_environment_command.rb +0 -167
  683. data/test/rubygems/test_gem_commands_fetch_command.rb +0 -257
  684. data/test/rubygems/test_gem_commands_generate_index_command.rb +0 -80
  685. data/test/rubygems/test_gem_commands_help_command.rb +0 -93
  686. data/test/rubygems/test_gem_commands_info_command.rb +0 -43
  687. data/test/rubygems/test_gem_commands_install_command.rb +0 -1553
  688. data/test/rubygems/test_gem_commands_list_command.rb +0 -32
  689. data/test/rubygems/test_gem_commands_lock_command.rb +0 -66
  690. data/test/rubygems/test_gem_commands_mirror.rb +0 -19
  691. data/test/rubygems/test_gem_commands_open_command.rb +0 -97
  692. data/test/rubygems/test_gem_commands_outdated_command.rb +0 -49
  693. data/test/rubygems/test_gem_commands_owner_command.rb +0 -326
  694. data/test/rubygems/test_gem_commands_pristine_command.rb +0 -659
  695. data/test/rubygems/test_gem_commands_push_command.rb +0 -477
  696. data/test/rubygems/test_gem_commands_query_command.rb +0 -857
  697. data/test/rubygems/test_gem_commands_search_command.rb +0 -15
  698. data/test/rubygems/test_gem_commands_server_command.rb +0 -19
  699. data/test/rubygems/test_gem_commands_setup_command.rb +0 -447
  700. data/test/rubygems/test_gem_commands_signin_command.rb +0 -219
  701. data/test/rubygems/test_gem_commands_signout_command.rb +0 -30
  702. data/test/rubygems/test_gem_commands_sources_command.rb +0 -534
  703. data/test/rubygems/test_gem_commands_specification_command.rb +0 -276
  704. data/test/rubygems/test_gem_commands_stale_command.rb +0 -42
  705. data/test/rubygems/test_gem_commands_uninstall_command.rb +0 -504
  706. data/test/rubygems/test_gem_commands_unpack_command.rb +0 -223
  707. data/test/rubygems/test_gem_commands_update_command.rb +0 -835
  708. data/test/rubygems/test_gem_commands_which_command.rb +0 -84
  709. data/test/rubygems/test_gem_commands_yank_command.rb +0 -180
  710. data/test/rubygems/test_gem_config_file.rb +0 -504
  711. data/test/rubygems/test_gem_dependency.rb +0 -395
  712. data/test/rubygems/test_gem_dependency_installer.rb +0 -1155
  713. data/test/rubygems/test_gem_dependency_list.rb +0 -264
  714. data/test/rubygems/test_gem_dependency_resolution_error.rb +0 -26
  715. data/test/rubygems/test_gem_doctor.rb +0 -194
  716. data/test/rubygems/test_gem_ext_builder.rb +0 -338
  717. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/.gitignore +0 -1
  718. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +0 -243
  719. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +0 -10
  720. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +0 -21
  721. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/custom_name.gemspec +0 -10
  722. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/src/lib.rs +0 -27
  723. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/.gitignore +0 -1
  724. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +0 -243
  725. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +0 -10
  726. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +0 -21
  727. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/rust_ruby_example.gemspec +0 -8
  728. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/src/lib.rs +0 -39
  729. data/test/rubygems/test_gem_ext_cargo_builder.rb +0 -178
  730. data/test/rubygems/test_gem_ext_cargo_builder_link_flag_converter.rb +0 -33
  731. data/test/rubygems/test_gem_ext_cargo_builder_unit.rb +0 -75
  732. data/test/rubygems/test_gem_ext_cmake_builder.rb +0 -83
  733. data/test/rubygems/test_gem_ext_configure_builder.rb +0 -79
  734. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +0 -230
  735. data/test/rubygems/test_gem_ext_rake_builder.rb +0 -112
  736. data/test/rubygems/test_gem_gem_runner.rb +0 -113
  737. data/test/rubygems/test_gem_gemcutter_utilities.rb +0 -272
  738. data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -59
  739. data/test/rubygems/test_gem_indexer.rb +0 -361
  740. data/test/rubygems/test_gem_install_update_options.rb +0 -207
  741. data/test/rubygems/test_gem_installer.rb +0 -2394
  742. data/test/rubygems/test_gem_local_remote_options.rb +0 -132
  743. data/test/rubygems/test_gem_name_tuple.rb +0 -42
  744. data/test/rubygems/test_gem_package.rb +0 -1178
  745. data/test/rubygems/test_gem_package_old.rb +0 -90
  746. data/test/rubygems/test_gem_package_tar_header.rb +0 -225
  747. data/test/rubygems/test_gem_package_tar_reader.rb +0 -87
  748. data/test/rubygems/test_gem_package_tar_reader_entry.rb +0 -152
  749. data/test/rubygems/test_gem_package_tar_writer.rb +0 -330
  750. data/test/rubygems/test_gem_package_task.rb +0 -117
  751. data/test/rubygems/test_gem_path_support.rb +0 -138
  752. data/test/rubygems/test_gem_platform.rb +0 -391
  753. data/test/rubygems/test_gem_rdoc.rb +0 -136
  754. data/test/rubygems/test_gem_remote_fetcher.rb +0 -1226
  755. data/test/rubygems/test_gem_request.rb +0 -541
  756. data/test/rubygems/test_gem_request_connection_pools.rb +0 -150
  757. data/test/rubygems/test_gem_request_set.rb +0 -671
  758. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +0 -847
  759. data/test/rubygems/test_gem_request_set_lockfile.rb +0 -468
  760. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +0 -543
  761. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +0 -306
  762. data/test/rubygems/test_gem_requirement.rb +0 -498
  763. data/test/rubygems/test_gem_resolver.rb +0 -791
  764. data/test/rubygems/test_gem_resolver_activation_request.rb +0 -42
  765. data/test/rubygems/test_gem_resolver_api_set.rb +0 -209
  766. data/test/rubygems/test_gem_resolver_api_specification.rb +0 -166
  767. data/test/rubygems/test_gem_resolver_best_set.rb +0 -158
  768. data/test/rubygems/test_gem_resolver_composed_set.rb +0 -43
  769. data/test/rubygems/test_gem_resolver_conflict.rb +0 -81
  770. data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -82
  771. data/test/rubygems/test_gem_resolver_git_set.rb +0 -187
  772. data/test/rubygems/test_gem_resolver_git_specification.rb +0 -113
  773. data/test/rubygems/test_gem_resolver_index_set.rb +0 -87
  774. data/test/rubygems/test_gem_resolver_index_specification.rb +0 -92
  775. data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -46
  776. data/test/rubygems/test_gem_resolver_installer_set.rb +0 -275
  777. data/test/rubygems/test_gem_resolver_local_specification.rb +0 -43
  778. data/test/rubygems/test_gem_resolver_lock_set.rb +0 -61
  779. data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -97
  780. data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -18
  781. data/test/rubygems/test_gem_resolver_specification.rb +0 -62
  782. data/test/rubygems/test_gem_resolver_vendor_set.rb +0 -81
  783. data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -81
  784. data/test/rubygems/test_gem_security.rb +0 -340
  785. data/test/rubygems/test_gem_security_policy.rb +0 -535
  786. data/test/rubygems/test_gem_security_signer.rb +0 -217
  787. data/test/rubygems/test_gem_security_trust_dir.rb +0 -98
  788. data/test/rubygems/test_gem_silent_ui.rb +0 -116
  789. data/test/rubygems/test_gem_source.rb +0 -253
  790. data/test/rubygems/test_gem_source_fetch_problem.rb +0 -36
  791. data/test/rubygems/test_gem_source_git.rb +0 -303
  792. data/test/rubygems/test_gem_source_installed.rb +0 -34
  793. data/test/rubygems/test_gem_source_list.rb +0 -118
  794. data/test/rubygems/test_gem_source_local.rb +0 -106
  795. data/test/rubygems/test_gem_source_lock.rb +0 -112
  796. data/test/rubygems/test_gem_source_specific_file.rb +0 -75
  797. data/test/rubygems/test_gem_source_subpath_problem.rb +0 -49
  798. data/test/rubygems/test_gem_source_vendor.rb +0 -29
  799. data/test/rubygems/test_gem_spec_fetcher.rb +0 -337
  800. data/test/rubygems/test_gem_specification.rb +0 -3756
  801. data/test/rubygems/test_gem_stream_ui.rb +0 -224
  802. data/test/rubygems/test_gem_stub_specification.rb +0 -277
  803. data/test/rubygems/test_gem_text.rb +0 -102
  804. data/test/rubygems/test_gem_uninstaller.rb +0 -674
  805. data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -30
  806. data/test/rubygems/test_gem_uri.rb +0 -39
  807. data/test/rubygems/test_gem_uri_formatter.rb +0 -26
  808. data/test/rubygems/test_gem_util.rb +0 -90
  809. data/test/rubygems/test_gem_validator.rb +0 -42
  810. data/test/rubygems/test_gem_version.rb +0 -295
  811. data/test/rubygems/test_gem_version_option.rb +0 -164
  812. data/test/rubygems/test_kernel.rb +0 -129
  813. data/test/rubygems/test_project_sanity.rb +0 -20
  814. data/test/rubygems/test_remote_fetch_error.rb +0 -19
  815. data/test/rubygems/test_require.rb +0 -719
  816. data/test/rubygems/test_rubygems.rb +0 -74
  817. data/test/rubygems/utilities.rb +0 -371
  818. data/test/rubygems/wrong_key_cert.pem +0 -19
  819. data/test/rubygems/wrong_key_cert_32.pem +0 -19
  820. data/test/test_changelog_generator.rb +0 -17
  821. /data/{lib/rubygems/optparse → bundler/lib/bundler/vendor/connection_pool}/.document +0 -0
  822. /data/{lib/rubygems/tsort → bundler/lib/bundler/vendor/fileutils}/.document +0 -0
  823. /data/{lib/rubygems/optparse → bundler/lib/bundler/vendor/fileutils}/COPYING +0 -0
  824. /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
  825. /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
  826. /data/{bundler/lib/bundler → lib/rubygems}/vendor/molinillo/LICENSE +0 -0
  827. /data/{bundler/lib/bundler/vendor/fileutils → lib/rubygems/vendor/net-protocol}/LICENSE.txt +0 -0
  828. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optionparser.rb +0 -0
  829. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/date.rb +0 -0
  830. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/shellwords.rb +0 -0
  831. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/time.rb +0 -0
  832. /data/{bundler/lib/bundler/vendor/uri → lib/rubygems/vendor/tsort}/LICENSE.txt +0 -0
@@ -5,11 +5,13 @@ require_relative "vendored_thor"
5
5
  module Bundler
6
6
  class CLI < Thor
7
7
  require_relative "cli/common"
8
+ require_relative "cli/install"
8
9
 
9
10
  package_name "Bundler"
10
11
 
11
12
  AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
12
13
  PARSEABLE_COMMANDS = %w[check config help exec platform show version].freeze
14
+ EXTENSIONS = ["c", "rust"].freeze
13
15
 
14
16
  COMMAND_ALIASES = {
15
17
  "check" => "c",
@@ -22,6 +24,8 @@ module Bundler
22
24
  }.freeze
23
25
 
24
26
  def self.start(*)
27
+ check_deprecated_ext_option(ARGV) if ARGV.include?("--ext")
28
+
25
29
  super
26
30
  ensure
27
31
  Bundler::SharedHelpers.print_major_deprecations!
@@ -61,12 +65,12 @@ module Bundler
61
65
  Bundler.reset_settings_and_root!
62
66
  end
63
67
 
64
- Bundler.self_manager.restart_with_locked_bundler_if_needed
68
+ Bundler.auto_switch
65
69
 
66
70
  Bundler.settings.set_command_option_if_given :retry, options[:retry]
67
71
 
68
72
  current_cmd = args.last[:current_command].name
69
- auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
73
+ Bundler.auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
70
74
  rescue UnknownArgumentError => e
71
75
  raise InvalidOption, e.message
72
76
  ensure
@@ -77,10 +81,10 @@ module Bundler
77
81
  unprinted_warnings.each {|w| Bundler.ui.warn(w) }
78
82
  end
79
83
 
80
- check_unknown_options!(:except => [:config, :exec])
84
+ check_unknown_options!(except: [:config, :exec])
81
85
  stop_on_unknown_option! :exec
82
86
 
83
- desc "cli_help", "Prints a summary of bundler commands", :hide => true
87
+ desc "cli_help", "Prints a summary of bundler commands", hide: true
84
88
  def cli_help
85
89
  version
86
90
  Bundler.ui.info "\n"
@@ -96,21 +100,23 @@ module Bundler
96
100
  shell.say "Bundler commands:\n\n"
97
101
 
98
102
  shell.say " Primary commands:\n"
99
- shell.print_table(primary_commands, :indent => 4, :truncate => true)
103
+ shell.print_table(primary_commands, indent: 4, truncate: true)
100
104
  shell.say
101
105
  shell.say " Utilities:\n"
102
- shell.print_table(utilities, :indent => 4, :truncate => true)
106
+ shell.print_table(utilities, indent: 4, truncate: true)
103
107
  shell.say
104
108
  self.class.send(:class_options_help, shell)
105
109
  end
106
110
  default_task(Bundler.feature_flag.default_cli_command)
107
111
 
108
- class_option "no-color", :type => :boolean, :desc => "Disable colorization in output"
109
- class_option "retry", :type => :numeric, :aliases => "-r", :banner => "NUM",
110
- :desc => "Specify the number of times you wish to attempt network commands"
111
- class_option "verbose", :type => :boolean, :desc => "Enable verbose output mode", :aliases => "-V"
112
+ class_option "no-color", type: :boolean, desc: "Disable colorization in output"
113
+ class_option "retry", type: :numeric, aliases: "-r", banner: "NUM",
114
+ desc: "Specify the number of times you wish to attempt network commands"
115
+ class_option "verbose", type: :boolean, desc: "Enable verbose output mode", aliases: "-V"
112
116
 
113
117
  def help(cli = nil)
118
+ cli = self.class.all_aliases[cli] if self.class.all_aliases[cli]
119
+
114
120
  case cli
115
121
  when "gemfile" then command = "gemfile"
116
122
  when nil then command = "bundle"
@@ -124,8 +130,8 @@ module Bundler
124
130
 
125
131
  if man_pages.include?(command)
126
132
  man_page = man_pages[command]
127
- if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+}
128
- Kernel.exec "man #{man_page}"
133
+ if Bundler.which("man") && !man_path.match?(%r{^file:/.+!/META-INF/jruby.home/.+})
134
+ Kernel.exec("man", man_page)
129
135
  else
130
136
  puts File.read("#{man_path}/#{File.basename(man_page)}.ronn")
131
137
  end
@@ -152,7 +158,8 @@ module Bundler
152
158
  Gemfile to a gem with a gemspec, the --gemspec option will automatically add each
153
159
  dependency listed in the gemspec file to the newly created Gemfile.
154
160
  D
155
- method_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile"
161
+ method_option "gemspec", type: :string, banner: "Use the specified .gemspec to create the Gemfile"
162
+ method_option "gemfile", type: :string, banner: "Use the specified name for the gemfile instead of 'Gemfile'"
156
163
  def init
157
164
  require_relative "cli/init"
158
165
  Init.new(options.dup).run
@@ -164,12 +171,9 @@ module Bundler
164
171
  all gems are found, Bundler prints a success message and exits with a status of 0.
165
172
  If not, the first missing gem is listed and Bundler exits status 1.
166
173
  D
167
- method_option "dry-run", :type => :boolean, :default => false, :banner =>
168
- "Lock the Gemfile"
169
- method_option "gemfile", :type => :string, :banner =>
170
- "Use the specified gemfile instead of Gemfile"
171
- method_option "path", :type => :string, :banner =>
172
- "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
174
+ method_option "dry-run", type: :boolean, default: false, banner: "Lock the Gemfile"
175
+ method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
176
+ method_option "path", type: :string, banner: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
173
177
  def check
174
178
  remembered_flag_deprecation("path")
175
179
 
@@ -183,10 +187,14 @@ module Bundler
183
187
  long_desc <<-D
184
188
  Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If the gem is not found, Bundler prints a error message and if gem could not be removed due to any reason Bundler will display a warning.
185
189
  D
186
- method_option "install", :type => :boolean, :banner =>
187
- "Runs 'bundle install' after removing the gems from the Gemfile"
190
+ method_option "install", type: :boolean, banner: "Runs 'bundle install' after removing the gems from the Gemfile"
188
191
  def remove(*gems)
189
- SharedHelpers.major_deprecation(2, "The `--install` flag has been deprecated. `bundle install` is triggered by default.") if ARGV.include?("--install")
192
+ if ARGV.include?("--install")
193
+ message = "The `--install` flag has been deprecated. `bundle install` is triggered by default."
194
+ removed_message = "The `--install` flag has been removed. `bundle install` is triggered by default."
195
+ SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
196
+ end
197
+
190
198
  require_relative "cli/remove"
191
199
  Remove.new(gems, options).run
192
200
  end
@@ -202,56 +210,40 @@ module Bundler
202
210
 
203
211
  If the bundle has already been installed, bundler will tell you so and then exit.
204
212
  D
205
- method_option "binstubs", :type => :string, :lazy_default => "bin", :banner =>
206
- "Generate bin stubs for bundled gems to ./bin"
207
- method_option "clean", :type => :boolean, :banner =>
208
- "Run bundle clean automatically after install"
209
- method_option "deployment", :type => :boolean, :banner =>
210
- "Install using defaults tuned for deployment environments"
211
- method_option "frozen", :type => :boolean, :banner =>
212
- "Do not allow the Gemfile.lock to be updated after this install"
213
- method_option "full-index", :type => :boolean, :banner =>
214
- "Fall back to using the single-file index of all gems"
215
- method_option "gemfile", :type => :string, :banner =>
216
- "Use the specified gemfile instead of Gemfile"
217
- method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>
218
- "Specify the number of jobs to run in parallel"
219
- method_option "local", :type => :boolean, :banner =>
220
- "Do not attempt to fetch gems remotely and use the gem cache instead"
221
- method_option "no-cache", :type => :boolean, :banner =>
222
- "Don't update the existing gem cache."
223
- method_option "redownload", :type => :boolean, :aliases => "--force", :banner =>
224
- "Force downloading every gem."
225
- method_option "no-prune", :type => :boolean, :banner =>
226
- "Don't remove stale gems from the cache."
227
- method_option "path", :type => :string, :banner =>
228
- "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
229
- method_option "quiet", :type => :boolean, :banner =>
230
- "Only output warnings and errors."
231
- method_option "shebang", :type => :string, :banner =>
232
- "Specify a different shebang executable name than the default (usually 'ruby')"
233
- method_option "standalone", :type => :array, :lazy_default => [], :banner =>
234
- "Make a bundle that can work without the Bundler runtime"
235
- method_option "system", :type => :boolean, :banner =>
236
- "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
237
- method_option "trust-policy", :alias => "P", :type => :string, :banner =>
238
- "Gem trust policy (like gem install -P). Must be one of " +
239
- Bundler.rubygems.security_policy_keys.join("|")
240
- method_option "without", :type => :array, :banner =>
241
- "Exclude gems that are part of the specified named group."
242
- method_option "with", :type => :array, :banner =>
243
- "Include gems that are part of the specified named group."
213
+ method_option "binstubs", type: :string, lazy_default: "bin", banner: "Generate bin stubs for bundled gems to ./bin"
214
+ method_option "clean", type: :boolean, banner: "Run bundle clean automatically after install"
215
+ method_option "deployment", type: :boolean, banner: "Install using defaults tuned for deployment environments"
216
+ method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this install"
217
+ method_option "full-index", type: :boolean, banner: "Fall back to using the single-file index of all gems"
218
+ method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
219
+ method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
220
+ method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
221
+ method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
222
+ method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
223
+ method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
224
+ method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
225
+ method_option "path", type: :string, banner: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
226
+ method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
227
+ method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
228
+ method_option "standalone", type: :array, lazy_default: [], banner: "Make a bundle that can work without the Bundler runtime"
229
+ method_option "system", type: :boolean, banner: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
230
+ method_option "trust-policy", alias: "P", type: :string, banner: "Gem trust policy (like gem install -P). Must be one of #{Bundler.rubygems.security_policy_keys.join("|")}"
231
+ method_option "target-rbconfig", type: :string, banner: "Path to rbconfig.rb for the deployment target platform"
232
+ method_option "without", type: :array, banner: "Exclude gems that are part of the specified named group."
233
+ method_option "with", type: :array, banner: "Include gems that are part of the specified named group."
244
234
  def install
245
235
  SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
246
236
 
247
- %w[clean deployment frozen no-prune path shebang system without with].each do |option|
237
+ %w[clean deployment frozen no-prune path shebang without with].each do |option|
248
238
  remembered_flag_deprecation(option)
249
239
  end
250
240
 
241
+ print_remembered_flag_deprecation("--system", "path.system", "true") if ARGV.include?("--system")
242
+
251
243
  remembered_negative_flag_deprecation("no-deployment")
252
244
 
253
245
  require_relative "cli/install"
254
- Bundler.settings.temporary(:no_install => false) do
246
+ Bundler.settings.temporary(no_install: false) do
255
247
  Install.new(options.dup).run
256
248
  end
257
249
  end
@@ -264,42 +256,27 @@ module Bundler
264
256
  update when you have changed the Gemfile, or if you want to get the newest
265
257
  possible versions of the gems in the bundle.
266
258
  D
267
- method_option "full-index", :type => :boolean, :banner =>
268
- "Fall back to using the single-file index of all gems"
269
- method_option "gemfile", :type => :string, :banner =>
270
- "Use the specified gemfile instead of Gemfile"
271
- method_option "group", :aliases => "-g", :type => :array, :banner =>
272
- "Update a specific group"
273
- method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>
274
- "Specify the number of jobs to run in parallel"
275
- method_option "local", :type => :boolean, :banner =>
276
- "Do not attempt to fetch gems remotely and use the gem cache instead"
277
- method_option "quiet", :type => :boolean, :banner =>
278
- "Only output warnings and errors."
279
- method_option "source", :type => :array, :banner =>
280
- "Update a specific source (and all gems associated with it)"
281
- method_option "redownload", :type => :boolean, :aliases => "--force", :banner =>
282
- "Force downloading every gem."
283
- method_option "ruby", :type => :boolean, :banner =>
284
- "Update ruby specified in Gemfile.lock"
285
- method_option "bundler", :type => :string, :lazy_default => "> 0.a", :banner =>
286
- "Update the locked version of bundler"
287
- method_option "patch", :type => :boolean, :banner =>
288
- "Prefer updating only to next patch version"
289
- method_option "minor", :type => :boolean, :banner =>
290
- "Prefer updating only to next minor version"
291
- method_option "major", :type => :boolean, :banner =>
292
- "Prefer updating to next major version (default)"
293
- method_option "strict", :type => :boolean, :banner =>
294
- "Do not allow any gem to be updated past latest --patch | --minor | --major"
295
- method_option "conservative", :type => :boolean, :banner =>
296
- "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
297
- method_option "all", :type => :boolean, :banner =>
298
- "Update everything."
259
+ method_option "full-index", type: :boolean, banner: "Fall back to using the single-file index of all gems"
260
+ method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
261
+ method_option "group", aliases: "-g", type: :array, banner: "Update a specific group"
262
+ method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
263
+ method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
264
+ method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
265
+ method_option "source", type: :array, banner: "Update a specific source (and all gems associated with it)"
266
+ method_option "redownload", type: :boolean, aliases: "--force", banner: "Force downloading every gem."
267
+ method_option "ruby", type: :boolean, banner: "Update ruby specified in Gemfile.lock"
268
+ method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
269
+ method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
270
+ method_option "minor", type: :boolean, banner: "Prefer updating only to next minor version"
271
+ method_option "major", type: :boolean, banner: "Prefer updating to next major version (default)"
272
+ method_option "pre", type: :boolean, banner: "Always choose the highest allowed version when updating gems, regardless of prerelease status"
273
+ method_option "strict", type: :boolean, banner: "Do not allow any gem to be updated past latest --patch | --minor | --major"
274
+ method_option "conservative", type: :boolean, banner: "Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
275
+ method_option "all", type: :boolean, banner: "Update everything."
299
276
  def update(*gems)
300
277
  SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
301
278
  require_relative "cli/update"
302
- Bundler.settings.temporary(:no_install => false) do
279
+ Bundler.settings.temporary(no_install: false) do
303
280
  Update.new(options, gems).run
304
281
  end
305
282
  end
@@ -309,21 +286,23 @@ module Bundler
309
286
  Show lists the names and versions of all gems that are required by your Gemfile.
310
287
  Calling show with [GEM] will list the exact location of that gem on your machine.
311
288
  D
312
- method_option "paths", :type => :boolean,
313
- :banner => "List the paths of all gems that are required by your Gemfile."
314
- method_option "outdated", :type => :boolean,
315
- :banner => "Show verbose output including whether gems are outdated."
289
+ method_option "paths", type: :boolean, banner: "List the paths of all gems that are required by your Gemfile."
290
+ method_option "outdated", type: :boolean, banner: "Show verbose output including whether gems are outdated."
316
291
  def show(gem_name = nil)
317
- SharedHelpers.major_deprecation(2, "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement") if ARGV.include?("--outdated")
292
+ if ARGV.include?("--outdated")
293
+ message = "the `--outdated` flag to `bundle show` was undocumented and will be removed without replacement"
294
+ removed_message = "the `--outdated` flag to `bundle show` was undocumented and has been removed without replacement"
295
+ SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
296
+ end
318
297
  require_relative "cli/show"
319
298
  Show.new(options, gem_name).run
320
299
  end
321
300
 
322
301
  desc "list", "List all gems in the bundle"
323
- method_option "name-only", :type => :boolean, :banner => "print only the gem names"
324
- method_option "only-group", :type => :array, :default => [], :banner => "print gems from a given set of groups"
325
- method_option "without-group", :type => :array, :default => [], :banner => "print all gems except from a given set of groups"
326
- method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle"
302
+ method_option "name-only", type: :boolean, banner: "print only the gem names"
303
+ method_option "only-group", type: :array, default: [], banner: "print gems from a given set of groups"
304
+ method_option "without-group", type: :array, default: [], banner: "print all gems except from a given set of groups"
305
+ method_option "paths", type: :boolean, banner: "print the path to each gem in the bundle"
327
306
  def list
328
307
  require_relative "cli/list"
329
308
  List.new(options).run
@@ -332,8 +311,8 @@ module Bundler
332
311
  map aliases_for("list")
333
312
 
334
313
  desc "info GEM [OPTIONS]", "Show information for the given gem"
335
- method_option "path", :type => :boolean, :banner => "Print full path to gem"
336
- method_option "version", :type => :boolean, :banner => "Print gem version"
314
+ method_option "path", type: :boolean, banner: "Print full path to gem"
315
+ method_option "version", type: :boolean, banner: "Print gem version"
337
316
  def info(gem_name)
338
317
  require_relative "cli/info"
339
318
  Info.new(options, gem_name).run
@@ -345,18 +324,12 @@ module Bundler
345
324
  or the --binstubs directory if one has been set. Calling binstubs with [GEM [GEM]]
346
325
  will create binstubs for all given gems.
347
326
  D
348
- method_option "force", :type => :boolean, :default => false, :banner =>
349
- "Overwrite existing binstubs if they exist"
350
- method_option "path", :type => :string, :lazy_default => "bin", :banner =>
351
- "Binstub destination directory (default bin)"
352
- method_option "shebang", :type => :string, :banner =>
353
- "Specify a different shebang executable name than the default (usually 'ruby')"
354
- method_option "standalone", :type => :boolean, :banner =>
355
- "Make binstubs that can work without the Bundler runtime"
356
- method_option "all", :type => :boolean, :banner =>
357
- "Install binstubs for all gems"
358
- method_option "all-platforms", :type => :boolean, :default => false, :banner =>
359
- "Install binstubs for all platforms"
327
+ method_option "force", type: :boolean, default: false, banner: "Overwrite existing binstubs if they exist"
328
+ method_option "path", type: :string, lazy_default: "bin", banner: "Binstub destination directory (default bin)"
329
+ method_option "shebang", type: :string, banner: "Specify a different shebang executable name than the default (usually 'ruby')"
330
+ method_option "standalone", type: :boolean, banner: "Make binstubs that can work without the Bundler runtime"
331
+ method_option "all", type: :boolean, banner: "Install binstubs for all gems"
332
+ method_option "all-platforms", type: :boolean, default: false, banner: "Install binstubs for all platforms"
360
333
  def binstubs(*gems)
361
334
  require_relative "cli/binstubs"
362
335
  Binstubs.new(options, gems).run
@@ -366,18 +339,20 @@ module Bundler
366
339
  long_desc <<-D
367
340
  Adds the specified gem to Gemfile (if valid) and run 'bundle install' in one step.
368
341
  D
369
- method_option "version", :aliases => "-v", :type => :string
370
- method_option "group", :aliases => "-g", :type => :string
371
- method_option "source", :aliases => "-s", :type => :string
372
- method_option "require", :aliases => "-r", :type => :string, :banner => "Adds require path to gem. Provide false, or a path as a string."
373
- method_option "git", :type => :string
374
- method_option "github", :type => :string
375
- method_option "branch", :type => :string
376
- method_option "ref", :type => :string
377
- method_option "skip-install", :type => :boolean, :banner =>
378
- "Adds gem to the Gemfile but does not install it"
379
- method_option "optimistic", :type => :boolean, :banner => "Adds optimistic declaration of version to gem"
380
- method_option "strict", :type => :boolean, :banner => "Adds strict declaration of version to gem"
342
+ method_option "version", aliases: "-v", type: :string
343
+ method_option "group", aliases: "-g", type: :string
344
+ method_option "source", aliases: "-s", type: :string
345
+ method_option "require", aliases: "-r", type: :string, banner: "Adds require path to gem. Provide false, or a path as a string."
346
+ method_option "path", type: :string
347
+ method_option "git", type: :string
348
+ method_option "github", type: :string
349
+ method_option "branch", type: :string
350
+ method_option "ref", type: :string
351
+ method_option "glob", type: :string, banner: "The location of a dependency's .gemspec, expanded within Ruby (single quotes recommended)"
352
+ method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
353
+ method_option "skip-install", type: :boolean, banner: "Adds gem to the Gemfile but does not install it"
354
+ method_option "optimistic", type: :boolean, banner: "Adds optimistic declaration of version to gem"
355
+ method_option "strict", type: :boolean, banner: "Adds strict declaration of version to gem"
381
356
  def add(*gems)
382
357
  require_relative "cli/add"
383
358
  Add.new(options.dup, gems).run
@@ -393,54 +368,43 @@ module Bundler
393
368
  For more information on patch level options (--major, --minor, --patch,
394
369
  --strict) see documentation on the same options on the update command.
395
370
  D
396
- method_option "group", :type => :string, :banner => "List gems from a specific group"
397
- method_option "groups", :type => :boolean, :banner => "List gems organized by groups"
398
- method_option "local", :type => :boolean, :banner =>
399
- "Do not attempt to fetch gems remotely and use the gem cache instead"
400
- method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
401
- method_option "source", :type => :array, :banner => "Check against a specific source"
402
- method_option "filter-strict", :type => :boolean, :banner =>
403
- "Only list newer versions allowed by your Gemfile requirements"
404
- method_option "strict", :type => :boolean, :aliases => "--update-strict", :banner =>
405
- "Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
406
- method_option "minor", :type => :boolean, :banner => "Prefer updating only to next minor version"
407
- method_option "major", :type => :boolean, :banner => "Prefer updating to next major version (default)"
408
- method_option "patch", :type => :boolean, :banner => "Prefer updating only to next patch version"
409
- method_option "filter-major", :type => :boolean, :banner => "Only list major newer versions"
410
- method_option "filter-minor", :type => :boolean, :banner => "Only list minor newer versions"
411
- method_option "filter-patch", :type => :boolean, :banner => "Only list patch newer versions"
412
- method_option "parseable", :aliases => "--porcelain", :type => :boolean, :banner =>
413
- "Use minimal formatting for more parseable output"
414
- method_option "only-explicit", :type => :boolean, :banner =>
415
- "Only list gems specified in your Gemfile, not their dependencies"
371
+ method_option "group", type: :string, banner: "List gems from a specific group"
372
+ method_option "groups", type: :boolean, banner: "List gems organized by groups"
373
+ method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
374
+ method_option "pre", type: :boolean, banner: "Check for newer pre-release gems"
375
+ method_option "source", type: :array, banner: "Check against a specific source"
376
+ method_option "filter-strict", type: :boolean, aliases: "--strict", banner: "Only list newer versions allowed by your Gemfile requirements"
377
+ method_option "update-strict", type: :boolean, banner: "Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
378
+ method_option "minor", type: :boolean, banner: "Prefer updating only to next minor version"
379
+ method_option "major", type: :boolean, banner: "Prefer updating to next major version (default)"
380
+ method_option "patch", type: :boolean, banner: "Prefer updating only to next patch version"
381
+ method_option "filter-major", type: :boolean, banner: "Only list major newer versions"
382
+ method_option "filter-minor", type: :boolean, banner: "Only list minor newer versions"
383
+ method_option "filter-patch", type: :boolean, banner: "Only list patch newer versions"
384
+ method_option "parseable", aliases: "--porcelain", type: :boolean, banner: "Use minimal formatting for more parseable output"
385
+ method_option "only-explicit", type: :boolean, banner: "Only list gems specified in your Gemfile, not their dependencies"
416
386
  def outdated(*gems)
417
387
  require_relative "cli/outdated"
418
388
  Outdated.new(options, gems).run
419
389
  end
420
390
 
421
391
  desc "fund [OPTIONS]", "Lists information about gems seeking funding assistance"
422
- method_option "group", :aliases => "-g", :type => :array, :banner =>
423
- "Fetch funding information for a specific group"
392
+ method_option "group", aliases: "-g", type: :array, banner: "Fetch funding information for a specific group"
424
393
  def fund
425
394
  require_relative "cli/fund"
426
395
  Fund.new(options).run
427
396
  end
428
397
 
429
398
  desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
430
- method_option "all", :type => :boolean,
431
- :default => Bundler.feature_flag.cache_all?,
432
- :banner => "Include all sources (including path and git)."
433
- method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
434
- method_option "cache-path", :type => :string, :banner =>
435
- "Specify a different cache path than the default (vendor/cache)."
436
- method_option "gemfile", :type => :string, :banner => "Use the specified gemfile instead of Gemfile"
437
- method_option "no-install", :type => :boolean, :banner => "Don't install the gems, only update the cache."
438
- method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
439
- method_option "path", :type => :string, :banner =>
440
- "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
441
- method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
442
- method_option "frozen", :type => :boolean, :banner =>
443
- "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install"
399
+ method_option "all", type: :boolean, default: Bundler.feature_flag.cache_all?, banner: "Include all sources (including path and git)."
400
+ method_option "all-platforms", type: :boolean, banner: "Include gems for all platforms present in the lockfile, not only the current one"
401
+ method_option "cache-path", type: :string, banner: "Specify a different cache path than the default (vendor/cache)."
402
+ method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
403
+ method_option "no-install", type: :boolean, banner: "Don't install the gems, only update the cache."
404
+ method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache."
405
+ method_option "path", type: :string, banner: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
406
+ method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
407
+ method_option "frozen", type: :boolean, banner: "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install"
444
408
  long_desc <<-D
445
409
  The cache command will copy the .gem files for every gem in the bundle into the
446
410
  directory ./vendor/cache. If you then check that directory into your source
@@ -448,17 +412,20 @@ module Bundler
448
412
  bundle without having to download any additional gems.
449
413
  D
450
414
  def cache
451
- SharedHelpers.major_deprecation 2,
452
- "The `--all` flag is deprecated because it relies on being " \
453
- "remembered across bundler invocations, which bundler will no longer " \
454
- "do in future versions. Instead please use `bundle config set cache_all true`, " \
455
- "and stop using this flag" if ARGV.include?("--all")
456
-
457
- SharedHelpers.major_deprecation 2,
458
- "The `--path` flag is deprecated because its semantics are unclear. " \
459
- "Use `bundle config cache_path` to configure the path of your cache of gems, " \
460
- "and `bundle config path` to configure the path where your gems are installed, " \
461
- "and stop using this flag" if ARGV.include?("--path")
415
+ print_remembered_flag_deprecation("--all", "cache_all", "true") if ARGV.include?("--all")
416
+
417
+ if ARGV.include?("--path")
418
+ message =
419
+ "The `--path` flag is deprecated because its semantics are unclear. " \
420
+ "Use `bundle config cache_path` to configure the path of your cache of gems, " \
421
+ "and `bundle config path` to configure the path where your gems are installed, " \
422
+ "and stop using this flag"
423
+ removed_message =
424
+ "The `--path` flag has been removed because its semantics were unclear. " \
425
+ "Use `bundle config cache_path` to configure the path of your cache of gems, " \
426
+ "and `bundle config path` to configure the path where your gems are installed."
427
+ SharedHelpers.major_deprecation 2, message, removed_message: removed_message
428
+ end
462
429
 
463
430
  require_relative "cli/cache"
464
431
  Cache.new(options).run
@@ -467,8 +434,8 @@ module Bundler
467
434
  map aliases_for("cache")
468
435
 
469
436
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
470
- method_option :keep_file_descriptors, :type => :boolean, :default => true
471
- method_option :gemfile, :type => :string, :required => false
437
+ method_option :keep_file_descriptors, type: :boolean, default: true, banner: "Passes all file descriptors to the new processes. Default is true, and setting it to false is deprecated"
438
+ method_option :gemfile, type: :string, required: false, banner: "Use the specified gemfile instead of Gemfile"
472
439
  long_desc <<-D
473
440
  Exec runs a command, providing it access to the gems in the bundle. While using
474
441
  bundle exec you can require and call the bundled gems as if they were installed
@@ -476,7 +443,9 @@ module Bundler
476
443
  D
477
444
  def exec(*args)
478
445
  if ARGV.include?("--no-keep-file-descriptors")
479
- SharedHelpers.major_deprecation(2, "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to")
446
+ message = "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to"
447
+ removed_message = "The `--no-keep-file-descriptors` has been removed. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to"
448
+ SharedHelpers.major_deprecation(2, message, removed_message: removed_message)
480
449
  end
481
450
 
482
451
  require_relative "cli/exec"
@@ -501,20 +470,19 @@ module Bundler
501
470
  subcommand "config", Config
502
471
 
503
472
  desc "open GEM", "Opens the source directory of the given bundled gem"
473
+ method_option "path", type: :string, lazy_default: "", banner: "Open relative path of the gem source."
504
474
  def open(name)
505
475
  require_relative "cli/open"
506
476
  Open.new(options, name).run
507
477
  end
508
478
 
509
- unless Bundler.feature_flag.bundler_3_mode?
510
- desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
511
- def console(group = nil)
512
- require_relative "cli/console"
513
- Console.new(options, group).run
514
- end
479
+ desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
480
+ def console(group = nil)
481
+ require_relative "cli/console"
482
+ Console.new(options, group).run
515
483
  end
516
484
 
517
- desc "version", "Prints the bundler's version information"
485
+ desc "version", "Prints Bundler version information"
518
486
  def version
519
487
  cli_help = current_command.name == "cli_help"
520
488
  if cli_help || ARGV.include?("version")
@@ -545,17 +513,17 @@ module Bundler
545
513
  end
546
514
 
547
515
  unless Bundler.feature_flag.bundler_3_mode?
548
- desc "viz [OPTIONS]", "Generates a visual dependency graph", :hide => true
516
+ desc "viz [OPTIONS]", "Generates a visual dependency graph", hide: true
549
517
  long_desc <<-D
550
518
  Viz generates a PNG file of the current Gemfile as a dependency graph.
551
519
  Viz requires the ruby-graphviz gem (and its dependencies).
552
520
  The associated gems must also be installed via 'bundle install'.
553
521
  D
554
- method_option :file, :type => :string, :default => "gem_graph", :aliases => "-f", :desc => "The name to use for the generated file. see format option"
555
- method_option :format, :type => :string, :default => "png", :aliases => "-F", :desc => "This is output format option. Supported format is png, jpg, svg, dot ..."
556
- method_option :requirements, :type => :boolean, :default => false, :aliases => "-R", :desc => "Set to show the version of each required dependency."
557
- method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
558
- method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
522
+ method_option :file, type: :string, default: "gem_graph", aliases: "-f", desc: "The name to use for the generated file. see format option"
523
+ method_option :format, type: :string, default: "png", aliases: "-F", desc: "This is output format option. Supported format is png, jpg, svg, dot ..."
524
+ method_option :requirements, type: :boolean, default: false, aliases: "-R", desc: "Set to show the version of each required dependency."
525
+ method_option :version, type: :boolean, default: false, aliases: "-v", desc: "Set to show each gem version."
526
+ method_option :without, type: :array, default: [], aliases: "-W", banner: "GROUP[ GROUP...]", desc: "Exclude gems that are part of the specified named group."
559
527
  def viz
560
528
  SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
561
529
  require_relative "cli/viz"
@@ -563,79 +531,50 @@ module Bundler
563
531
  end
564
532
  end
565
533
 
566
- old_gem = instance_method(:gem)
567
-
568
534
  desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
569
- method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
570
- method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
571
- method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
572
- :lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
573
- :desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
574
- method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
575
- method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
576
- method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
577
- method_option :rubocop, :type => :boolean, :desc => "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
578
- method_option :changelog, :type => :boolean, :desc => "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
579
- method_option :test, :type => :string, :lazy_default => Bundler.settings["gem.test"] || "", :aliases => "-t", :banner => "Use the specified test framework for your library",
580
- :desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
581
- method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",
582
- :desc => "Generate CI configuration, either GitHub Actions, Travis CI, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|travis|gitlab|circle)`"
583
- method_option :linter, :type => :string, :lazy_default => Bundler.settings["gem.linter"] || "",
584
- :desc => "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
585
- method_option :github_username, :type => :string, :default => Bundler.settings["gem.github_username"], :banner => "Set your username on GitHub", :desc => "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
535
+ method_option :exe, type: :boolean, default: false, aliases: ["--bin", "-b"], desc: "Generate a binary executable for your library."
536
+ method_option :coc, type: :boolean, desc: "Generate a code of conduct file. Set a default with `bundle config set --global gem.coc true`."
537
+ method_option :edit, type: :string, aliases: "-e", required: false, banner: "EDITOR", lazy_default: [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }, desc: "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
538
+ method_option :ext, type: :string, desc: "Generate the boilerplate for C extension code.", enum: EXTENSIONS
539
+ method_option :git, type: :boolean, default: true, desc: "Initialize a git repo inside your library."
540
+ method_option :mit, type: :boolean, desc: "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
541
+ method_option :rubocop, type: :boolean, desc: "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
542
+ method_option :changelog, type: :boolean, desc: "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
543
+ method_option :test, type: :string, lazy_default: Bundler.settings["gem.test"] || "", aliases: "-t", banner: "Use the specified test framework for your library", enum: %w[rspec minitest test-unit], desc: "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
544
+ method_option :ci, type: :string, lazy_default: Bundler.settings["gem.ci"] || "", enum: %w[github gitlab circle], desc: "Generate CI configuration, either GitHub Actions, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|gitlab|circle)`"
545
+ method_option :linter, type: :string, lazy_default: Bundler.settings["gem.linter"] || "", enum: %w[rubocop standard], desc: "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
546
+ method_option :github_username, type: :string, default: Bundler.settings["gem.github_username"], banner: "Set your username on GitHub", desc: "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
586
547
 
587
548
  def gem(name)
588
- end
589
-
590
- commands["gem"].tap do |gem_command|
591
- def gem_command.run(instance, args = [])
592
- arity = 1 # name
593
-
594
- require_relative "cli/gem"
595
- cmd_args = args + [instance]
596
- cmd_args.unshift(instance.options)
597
-
598
- cmd = begin
599
- Gem.new(*cmd_args)
600
- rescue ArgumentError => e
601
- instance.class.handle_argument_error(self, e, args, arity)
602
- end
549
+ require_relative "cli/gem"
550
+ cmd_args = args + [self]
551
+ cmd_args.unshift(options)
603
552
 
604
- cmd.run
605
- end
553
+ Gem.new(*cmd_args).run
606
554
  end
607
555
 
608
- undef_method(:gem)
609
- define_method(:gem, old_gem)
610
- private :gem
611
-
612
556
  def self.source_root
613
557
  File.expand_path("templates", __dir__)
614
558
  end
615
559
 
616
- desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :hide => true
617
- method_option "dry-run", :type => :boolean, :default => false, :banner =>
618
- "Only print out changes, do not clean gems"
619
- method_option "force", :type => :boolean, :default => false, :banner =>
620
- "Forces clean even if --path is not set"
560
+ desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", hide: true
561
+ method_option "dry-run", type: :boolean, default: false, banner: "Only print out changes, do not clean gems"
562
+ method_option "force", type: :boolean, default: false, banner: "Forces cleaning up unused gems even if Bundler is configured to use globally installed gems. As a consequence, removes all system gems except for the ones in the current application."
621
563
  def clean
622
564
  require_relative "cli/clean"
623
565
  Clean.new(options.dup).run
624
566
  end
625
567
 
626
568
  desc "platform [OPTIONS]", "Displays platform compatibility information"
627
- method_option "ruby", :type => :boolean, :default => false, :banner =>
628
- "only display ruby related platform information"
569
+ method_option "ruby", type: :boolean, default: false, banner: "only display ruby related platform information"
629
570
  def platform
630
571
  require_relative "cli/platform"
631
572
  Platform.new(options).run
632
573
  end
633
574
 
634
- desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", :hide => true
635
- method_option "source", :type => :string, :banner =>
636
- "Install gem from the given source"
637
- method_option "group", :type => :string, :banner =>
638
- "Install gem into a bundler group"
575
+ desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", hide: true
576
+ method_option "source", type: :string, banner: "Install gem from the given source"
577
+ method_option "group", type: :string, banner: "Install gem into a bundler group"
639
578
  def inject(name, version)
640
579
  SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
641
580
  require_relative "cli/inject"
@@ -643,32 +582,23 @@ module Bundler
643
582
  end
644
583
 
645
584
  desc "lock", "Creates a lockfile without installing"
646
- method_option "update", :type => :array, :lazy_default => true, :banner =>
647
- "ignore the existing lockfile, update all gems by default, or update list of given gems"
648
- method_option "local", :type => :boolean, :default => false, :banner =>
649
- "do not attempt to fetch remote gemspecs and use the local gem cache only"
650
- method_option "print", :type => :boolean, :default => false, :banner =>
651
- "print the lockfile to STDOUT instead of writing to the file system"
652
- method_option "gemfile", :type => :string, :banner =>
653
- "Use the specified gemfile instead of Gemfile"
654
- method_option "lockfile", :type => :string, :default => nil, :banner =>
655
- "the path the lockfile should be written to"
656
- method_option "full-index", :type => :boolean, :default => false, :banner =>
657
- "Fall back to using the single-file index of all gems"
658
- method_option "add-platform", :type => :array, :default => [], :banner =>
659
- "Add a new platform to the lockfile"
660
- method_option "remove-platform", :type => :array, :default => [], :banner =>
661
- "Remove a platform from the lockfile"
662
- method_option "patch", :type => :boolean, :banner =>
663
- "If updating, prefer updating only to next patch version"
664
- method_option "minor", :type => :boolean, :banner =>
665
- "If updating, prefer updating only to next minor version"
666
- method_option "major", :type => :boolean, :banner =>
667
- "If updating, prefer updating to next major version (default)"
668
- method_option "strict", :type => :boolean, :banner =>
669
- "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
670
- method_option "conservative", :type => :boolean, :banner =>
671
- "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
585
+ method_option "update", type: :array, lazy_default: true, banner: "ignore the existing lockfile, update all gems by default, or update list of given gems"
586
+ method_option "local", type: :boolean, default: false, banner: "do not attempt to fetch remote gemspecs and use the local gem cache only"
587
+ method_option "print", type: :boolean, default: false, banner: "print the lockfile to STDOUT instead of writing to the file system"
588
+ method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
589
+ method_option "lockfile", type: :string, default: nil, banner: "the path the lockfile should be written to"
590
+ method_option "full-index", type: :boolean, default: false, banner: "Fall back to using the single-file index of all gems"
591
+ method_option "add-checksums", type: :boolean, default: false, banner: "Adds checksums to the lockfile"
592
+ method_option "add-platform", type: :array, default: [], banner: "Add a new platform to the lockfile"
593
+ method_option "remove-platform", type: :array, default: [], banner: "Remove a platform from the lockfile"
594
+ method_option "normalize-platforms", type: :boolean, default: false, banner: "Normalize lockfile platforms"
595
+ method_option "patch", type: :boolean, banner: "If updating, prefer updating only to next patch version"
596
+ method_option "minor", type: :boolean, banner: "If updating, prefer updating only to next minor version"
597
+ method_option "major", type: :boolean, banner: "If updating, prefer updating to next major version (default)"
598
+ method_option "pre", type: :boolean, banner: "If updating, always choose the highest allowed version, regardless of prerelease status"
599
+ method_option "strict", type: :boolean, banner: "If updating, do not allow any gem to be updated past latest --patch | --minor | --major"
600
+ method_option "conservative", type: :boolean, banner: "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
601
+ method_option "bundler", type: :string, lazy_default: "> 0.a", banner: "Update the locked version of bundler"
672
602
  def lock
673
603
  require_relative "cli/lock"
674
604
  Lock.new(options).run
@@ -685,10 +615,8 @@ module Bundler
685
615
  missing dependencies are detected, Bundler prints them and exits status 1.
686
616
  Otherwise, Bundler prints a success message and exits with a status of 0.
687
617
  D
688
- method_option "gemfile", :type => :string, :banner =>
689
- "Use the specified gemfile instead of Gemfile"
690
- method_option "quiet", :type => :boolean, :banner =>
691
- "Only output warnings and errors."
618
+ method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
619
+ method_option "quiet", type: :boolean, banner: "Only output warnings and errors."
692
620
  def doctor
693
621
  require_relative "cli/doctor"
694
622
  Doctor.new(options).run
@@ -708,7 +636,9 @@ module Bundler
708
636
  D
709
637
  def pristine(*gems)
710
638
  require_relative "cli/pristine"
711
- Pristine.new(gems).run
639
+ Bundler.settings.temporary(no_install: false) do
640
+ Pristine.new(gems).run
641
+ end
712
642
  end
713
643
 
714
644
  if Bundler.feature_flag.plugins?
@@ -729,7 +659,6 @@ module Bundler
729
659
  exec_used = args.index {|a| exec_commands.include? a }
730
660
 
731
661
  command = args.find {|a| bundler_commands.include? a }
732
- command = all_aliases[command] if all_aliases[command]
733
662
 
734
663
  if exec_used && help_used
735
664
  if exec_used + help_used == 1
@@ -746,28 +675,42 @@ module Bundler
746
675
  end
747
676
  end
748
677
 
749
- private
750
-
751
- # Automatically invoke `bundle install` and resume if
752
- # Bundler.settings[:auto_install] exists. This is set through config cmd
753
- # `bundle config set --global auto_install 1`.
754
- #
755
- # Note that this method `nil`s out the global Definition object, so it
756
- # should be called first, before you instantiate anything like an
757
- # `Installer` that'll keep a reference to the old one instead.
758
- def auto_install
759
- return unless Bundler.settings[:auto_install]
760
-
761
- begin
762
- Bundler.definition.specs
763
- rescue GemNotFound
764
- Bundler.ui.info "Automatically installing missing gems."
765
- Bundler.reset!
766
- invoke :install, []
767
- Bundler.reset!
678
+ def self.check_deprecated_ext_option(arguments)
679
+ # when deprecated version of `--ext` is called
680
+ # print out deprecation warning and pretend `--ext=c` was provided
681
+ if deprecated_ext_value?(arguments)
682
+ message = "Extensions can now be generated using C or Rust, so `--ext` with no arguments has been deprecated. Please select a language, e.g. `--ext=rust` to generate a Rust extension. This gem will now be generated as if `--ext=c` was used."
683
+ removed_message = "Extensions can now be generated using C or Rust, so `--ext` with no arguments has been removed. Please select a language, e.g. `--ext=rust` to generate a Rust extension."
684
+ SharedHelpers.major_deprecation 2, message, removed_message: removed_message
685
+ arguments[arguments.index("--ext")] = "--ext=c"
768
686
  end
769
687
  end
770
688
 
689
+ def self.deprecated_ext_value?(arguments)
690
+ index = arguments.index("--ext")
691
+ next_argument = arguments[index + 1]
692
+
693
+ # it is ok when --ext is followed with valid extension value
694
+ # for example `bundle gem hello --ext c`
695
+ return false if EXTENSIONS.include?(next_argument)
696
+
697
+ # deprecated call when --ext is called with no value in last position
698
+ # for example `bundle gem hello_gem --ext`
699
+ return true if next_argument.nil?
700
+
701
+ # deprecated call when --ext is followed by other parameter
702
+ # for example `bundle gem --ext --no-ci hello_gem`
703
+ return true if next_argument.start_with?("-")
704
+
705
+ # deprecated call when --ext is followed by gem name
706
+ # for example `bundle gem --ext hello_gem`
707
+ return true if next_argument
708
+
709
+ false
710
+ end
711
+
712
+ private
713
+
771
714
  def current_command
772
715
  _, _, config = @_initializer
773
716
  config[:current_command]
@@ -797,13 +740,10 @@ module Bundler
797
740
 
798
741
  return unless SharedHelpers.md5_available?
799
742
 
800
- latest = Fetcher::CompactIndex.
801
- new(nil, Source::Rubygems::Remote.new(Bundler::URI("https://rubygems.org")), nil).
802
- send(:compact_index_client).
803
- instance_variable_get(:@cache).
804
- dependencies("bundler").
805
- map {|d| Gem::Version.new(d.first) }.
806
- max
743
+ require_relative "vendored_uri"
744
+ remote = Source::Rubygems::Remote.new(Gem::URI("https://rubygems.org"))
745
+ cache_path = Bundler.user_cache.join("compact_index", remote.cache_slug)
746
+ latest = Bundler::CompactIndexClient.new(cache_path).latest_version("bundler")
807
747
  return unless latest
808
748
 
809
749
  current = Gem::Version.new(VERSION)
@@ -837,12 +777,23 @@ module Bundler
837
777
 
838
778
  value = options[name]
839
779
  value = value.join(" ").to_s if option.type == :array
780
+ value = "'#{value}'" unless option.type == :boolean
781
+
782
+ print_remembered_flag_deprecation(flag_name, name.tr("-", "_"), value)
783
+ end
840
784
 
841
- Bundler::SharedHelpers.major_deprecation 2,
785
+ def print_remembered_flag_deprecation(flag_name, option_name, option_value)
786
+ message =
842
787
  "The `#{flag_name}` flag is deprecated because it relies on being " \
843
788
  "remembered across bundler invocations, which bundler will no longer " \
844
- "do in future versions. Instead please use `bundle config set --local #{name.tr("-", "_")} " \
845
- "'#{value}'`, and stop using this flag"
789
+ "do in future versions. Instead please use `bundle config set #{option_name} " \
790
+ "#{option_value}`, and stop using this flag"
791
+ removed_message =
792
+ "The `#{flag_name}` flag has been removed because it relied on being " \
793
+ "remembered across bundler invocations, which bundler will no longer " \
794
+ "do. Instead please use `bundle config set #{option_name} " \
795
+ "#{option_value}`, and stop using this flag"
796
+ Bundler::SharedHelpers.major_deprecation 2, message, removed_message: removed_message
846
797
  end
847
798
  end
848
799
  end