bundler 1.11.1 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (328) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +2125 -840
  3. data/LICENSE.md +18 -19
  4. data/README.md +33 -11
  5. data/bundler.gemspec +34 -21
  6. data/exe/bundle +36 -6
  7. data/exe/bundler +2 -18
  8. data/lib/bundler.rb +435 -160
  9. data/lib/bundler/build_metadata.rb +45 -0
  10. data/lib/bundler/capistrano.rb +9 -3
  11. data/lib/bundler/cli.rb +550 -130
  12. data/lib/bundler/cli/add.rb +47 -0
  13. data/lib/bundler/cli/binstubs.rb +26 -10
  14. data/lib/bundler/cli/cache.rb +25 -17
  15. data/lib/bundler/cli/check.rb +8 -7
  16. data/lib/bundler/cli/clean.rb +8 -8
  17. data/lib/bundler/cli/common.rb +69 -9
  18. data/lib/bundler/cli/config.rb +170 -76
  19. data/lib/bundler/cli/console.rb +6 -1
  20. data/lib/bundler/cli/doctor.rb +140 -0
  21. data/lib/bundler/cli/exec.rb +63 -21
  22. data/lib/bundler/cli/fund.rb +36 -0
  23. data/lib/bundler/cli/gem.rb +158 -42
  24. data/lib/bundler/cli/info.rb +73 -0
  25. data/lib/bundler/cli/init.rb +22 -7
  26. data/lib/bundler/cli/inject.rb +38 -10
  27. data/lib/bundler/cli/install.rb +139 -104
  28. data/lib/bundler/cli/issue.rb +40 -0
  29. data/lib/bundler/cli/list.rb +60 -0
  30. data/lib/bundler/cli/lock.rb +27 -5
  31. data/lib/bundler/cli/open.rb +13 -5
  32. data/lib/bundler/cli/outdated.rb +251 -46
  33. data/lib/bundler/cli/platform.rb +6 -2
  34. data/lib/bundler/cli/plugin.rb +41 -0
  35. data/lib/bundler/cli/pristine.rb +52 -0
  36. data/lib/bundler/cli/remove.rb +18 -0
  37. data/lib/bundler/cli/show.rb +5 -4
  38. data/lib/bundler/cli/update.rb +67 -26
  39. data/lib/bundler/cli/viz.rb +11 -6
  40. data/lib/bundler/compact_index_client.rb +125 -0
  41. data/lib/bundler/compact_index_client/cache.rb +110 -0
  42. data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  43. data/lib/bundler/compact_index_client/updater.rb +104 -0
  44. data/lib/bundler/constants.rb +2 -0
  45. data/lib/bundler/current_ruby.rb +51 -174
  46. data/lib/bundler/definition.rb +533 -216
  47. data/lib/bundler/dep_proxy.rb +18 -8
  48. data/lib/bundler/dependency.rb +39 -12
  49. data/lib/bundler/deployment.rb +7 -0
  50. data/lib/bundler/deprecate.rb +31 -2
  51. data/lib/bundler/dsl.rb +188 -91
  52. data/lib/bundler/endpoint_specification.rb +51 -10
  53. data/lib/bundler/env.rb +116 -48
  54. data/lib/bundler/environment_preserver.rb +82 -0
  55. data/lib/bundler/errors.rb +108 -31
  56. data/lib/bundler/feature_flag.rb +60 -0
  57. data/lib/bundler/fetcher.rb +81 -52
  58. data/lib/bundler/fetcher/base.rb +15 -3
  59. data/lib/bundler/fetcher/compact_index.rb +140 -0
  60. data/lib/bundler/fetcher/dependency.rb +36 -42
  61. data/lib/bundler/fetcher/downloader.rb +39 -12
  62. data/lib/bundler/fetcher/index.rb +34 -9
  63. data/lib/bundler/friendly_errors.rb +132 -88
  64. data/lib/bundler/gem_helper.rb +92 -50
  65. data/lib/bundler/gem_helpers.rb +90 -5
  66. data/lib/bundler/gem_tasks.rb +3 -1
  67. data/lib/bundler/gem_version_promoter.rb +190 -0
  68. data/lib/bundler/gemdeps.rb +29 -0
  69. data/lib/bundler/graph.rb +20 -41
  70. data/lib/bundler/index.rb +74 -57
  71. data/lib/bundler/injector.rb +242 -31
  72. data/lib/bundler/inline.rb +49 -23
  73. data/lib/bundler/installer.rb +190 -74
  74. data/lib/bundler/installer/gem_installer.rb +33 -20
  75. data/lib/bundler/installer/parallel_installer.rb +201 -97
  76. data/lib/bundler/installer/standalone.rb +10 -6
  77. data/lib/bundler/lazy_specification.rb +74 -10
  78. data/lib/bundler/lockfile_generator.rb +95 -0
  79. data/lib/bundler/lockfile_parser.rb +126 -74
  80. data/lib/bundler/{ssl_certs → man}/.document +0 -0
  81. data/lib/bundler/man/bundle-add.1 +66 -0
  82. data/lib/bundler/man/bundle-add.1.ronn +46 -0
  83. data/lib/bundler/man/bundle-binstubs.1 +42 -0
  84. data/lib/bundler/man/bundle-binstubs.1.ronn +41 -0
  85. data/lib/bundler/man/bundle-cache.1 +55 -0
  86. data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +22 -16
  87. data/lib/bundler/man/bundle-check.1 +31 -0
  88. data/lib/bundler/man/bundle-check.1.ronn +26 -0
  89. data/lib/bundler/man/bundle-clean.1 +24 -0
  90. data/lib/bundler/man/bundle-clean.1.ronn +18 -0
  91. data/lib/bundler/man/bundle-config.1 +488 -0
  92. data/lib/bundler/man/bundle-config.1.ronn +388 -0
  93. data/lib/bundler/man/bundle-doctor.1 +44 -0
  94. data/lib/bundler/man/bundle-doctor.1.ronn +33 -0
  95. data/lib/bundler/man/bundle-exec.1 +165 -0
  96. data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +20 -4
  97. data/lib/bundler/man/bundle-gem.1 +102 -0
  98. data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +37 -13
  99. data/lib/bundler/man/bundle-info.1 +20 -0
  100. data/lib/bundler/man/bundle-info.1.ronn +17 -0
  101. data/lib/bundler/man/bundle-init.1 +25 -0
  102. data/lib/bundler/man/bundle-init.1.ronn +29 -0
  103. data/lib/bundler/man/bundle-inject.1 +33 -0
  104. data/lib/bundler/man/bundle-inject.1.ronn +22 -0
  105. data/lib/bundler/man/bundle-install.1 +338 -0
  106. data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +82 -76
  107. data/lib/bundler/man/bundle-list.1 +50 -0
  108. data/lib/bundler/man/bundle-list.1.ronn +33 -0
  109. data/lib/bundler/man/bundle-lock.1 +84 -0
  110. data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +47 -0
  111. data/lib/bundler/man/bundle-open.1 +32 -0
  112. data/lib/bundler/man/bundle-open.1.ronn +19 -0
  113. data/lib/bundler/man/bundle-outdated.1 +155 -0
  114. data/lib/bundler/man/bundle-outdated.1.ronn +111 -0
  115. data/lib/bundler/man/bundle-platform.1 +61 -0
  116. data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +1 -1
  117. data/lib/bundler/man/bundle-pristine.1 +34 -0
  118. data/lib/bundler/man/bundle-pristine.1.ronn +34 -0
  119. data/lib/bundler/man/bundle-remove.1 +31 -0
  120. data/lib/bundler/man/bundle-remove.1.ronn +23 -0
  121. data/lib/bundler/man/bundle-show.1 +23 -0
  122. data/lib/bundler/man/bundle-show.1.ronn +21 -0
  123. data/lib/bundler/man/bundle-update.1 +394 -0
  124. data/lib/bundler/man/bundle-update.1.ronn +350 -0
  125. data/lib/bundler/man/bundle-viz.1 +39 -0
  126. data/lib/bundler/man/bundle-viz.1.ronn +30 -0
  127. data/lib/bundler/man/bundle.1 +136 -0
  128. data/lib/bundler/man/bundle.1.ronn +111 -0
  129. data/lib/bundler/man/gemfile.5 +686 -0
  130. data/{man → lib/bundler/man}/gemfile.5.ronn +117 -95
  131. data/lib/bundler/man/index.txt +25 -0
  132. data/lib/bundler/match_platform.rb +15 -4
  133. data/lib/bundler/mirror.rb +223 -0
  134. data/lib/bundler/plugin.rb +330 -0
  135. data/lib/bundler/plugin/api.rb +81 -0
  136. data/lib/bundler/plugin/api/source.rb +304 -0
  137. data/lib/bundler/plugin/dsl.rb +53 -0
  138. data/lib/bundler/plugin/events.rb +61 -0
  139. data/lib/bundler/plugin/index.rb +182 -0
  140. data/lib/bundler/plugin/installer.rb +109 -0
  141. data/lib/bundler/plugin/installer/git.rb +38 -0
  142. data/lib/bundler/plugin/installer/rubygems.rb +27 -0
  143. data/lib/bundler/plugin/source_list.rb +27 -0
  144. data/lib/bundler/process_lock.rb +24 -0
  145. data/lib/bundler/psyched_yaml.rb +2 -6
  146. data/lib/bundler/remote_specification.rb +42 -9
  147. data/lib/bundler/resolver.rb +312 -225
  148. data/lib/bundler/resolver/spec_group.rb +122 -0
  149. data/lib/bundler/retry.rb +11 -5
  150. data/lib/bundler/ruby_dsl.rb +9 -2
  151. data/lib/bundler/ruby_version.rb +84 -61
  152. data/lib/bundler/rubygems_ext.rb +92 -53
  153. data/lib/bundler/rubygems_gem_installer.rb +84 -0
  154. data/lib/bundler/rubygems_integration.rb +320 -395
  155. data/lib/bundler/runtime.rb +87 -75
  156. data/lib/bundler/settings.rb +297 -119
  157. data/lib/bundler/settings/validator.rb +102 -0
  158. data/lib/bundler/setup.rb +13 -12
  159. data/lib/bundler/shared_helpers.rb +234 -53
  160. data/lib/bundler/similarity_detector.rb +5 -3
  161. data/lib/bundler/source.rb +63 -4
  162. data/lib/bundler/source/gemspec.rb +18 -0
  163. data/lib/bundler/source/git.rb +97 -50
  164. data/lib/bundler/source/git/git_proxy.rb +138 -65
  165. data/lib/bundler/source/metadata.rb +67 -0
  166. data/lib/bundler/source/path.rb +83 -47
  167. data/lib/bundler/source/path/installer.rb +42 -11
  168. data/lib/bundler/source/rubygems.rb +231 -116
  169. data/lib/bundler/source/rubygems/remote.rb +30 -1
  170. data/lib/bundler/source_list.rb +103 -21
  171. data/lib/bundler/spec_set.rb +96 -51
  172. data/lib/bundler/stub_specification.rb +87 -4
  173. data/lib/bundler/templates/.document +1 -0
  174. data/lib/bundler/templates/Executable +14 -1
  175. data/lib/bundler/templates/Executable.bundler +114 -0
  176. data/lib/bundler/templates/Executable.standalone +6 -4
  177. data/lib/bundler/templates/Gemfile +4 -1
  178. data/lib/bundler/templates/gems.rb +8 -0
  179. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +79 -44
  180. data/lib/bundler/templates/newgem/Gemfile.tt +18 -2
  181. data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
  182. data/lib/bundler/templates/newgem/README.md.tt +16 -10
  183. data/lib/bundler/templates/newgem/Rakefile.tt +22 -8
  184. data/lib/bundler/templates/newgem/bin/console.tt +2 -1
  185. data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
  186. data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
  187. data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +4 -4
  188. data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
  189. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
  190. data/lib/bundler/templates/newgem/gitignore.tt +5 -1
  191. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  192. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -6
  193. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +6 -4
  194. data/lib/bundler/templates/newgem/newgem.gemspec.tt +27 -28
  195. data/lib/bundler/templates/newgem/rspec.tt +1 -0
  196. data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
  197. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +4 -4
  198. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -2
  199. data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +3 -1
  200. data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
  201. data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  202. data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  203. data/lib/bundler/templates/newgem/{.travis.yml.tt → travis.yml.tt} +2 -0
  204. data/lib/bundler/ui.rb +5 -3
  205. data/lib/bundler/ui/rg_proxy.rb +3 -1
  206. data/lib/bundler/ui/shell.rb +54 -21
  207. data/lib/bundler/ui/silent.rb +26 -1
  208. data/lib/bundler/uri_credentials_filter.rb +43 -0
  209. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
  210. data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
  211. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
  212. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
  213. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1764 -0
  214. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +11 -5
  215. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
  216. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
  217. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +113 -134
  218. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
  219. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
  220. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
  221. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
  222. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
  223. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
  224. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
  225. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
  226. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +158 -0
  227. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +82 -8
  228. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +4 -1
  229. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +2 -0
  230. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +6 -2
  231. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +555 -150
  232. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +6 -3
  233. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +19 -12
  234. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +310 -467
  235. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
  236. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
  237. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
  238. data/lib/bundler/vendor/thor/lib/thor.rb +58 -25
  239. data/lib/bundler/vendor/thor/lib/thor/actions.rb +50 -33
  240. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
  241. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +5 -3
  242. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +9 -19
  243. data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +16 -8
  244. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +79 -22
  245. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +33 -20
  246. data/lib/bundler/vendor/thor/lib/thor/base.rb +110 -67
  247. data/lib/bundler/vendor/thor/lib/thor/command.rb +33 -24
  248. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
  249. data/lib/bundler/vendor/thor/lib/thor/error.rb +81 -3
  250. data/lib/bundler/vendor/thor/lib/thor/group.rb +16 -16
  251. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +5 -5
  252. data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
  253. data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
  254. data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
  255. data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  256. data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
  257. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
  258. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +18 -18
  259. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +60 -26
  260. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +31 -13
  261. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
  262. data/lib/bundler/vendor/thor/lib/thor/runner.rb +42 -39
  263. data/lib/bundler/vendor/thor/lib/thor/shell.rb +5 -5
  264. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +109 -39
  265. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +7 -3
  266. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +5 -5
  267. data/lib/bundler/vendor/thor/lib/thor/util.rb +26 -9
  268. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  269. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
  270. data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  271. data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
  272. data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
  273. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  274. data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
  275. data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
  276. data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  277. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  278. data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
  279. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
  280. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  281. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
  282. data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  283. data/lib/bundler/vendored_fileutils.rb +4 -0
  284. data/lib/bundler/vendored_molinillo.rb +3 -1
  285. data/lib/bundler/vendored_persistent.rb +45 -9
  286. data/lib/bundler/vendored_thor.rb +8 -3
  287. data/lib/bundler/vendored_tmpdir.rb +4 -0
  288. data/lib/bundler/vendored_uri.rb +4 -0
  289. data/lib/bundler/version.rb +7 -4
  290. data/lib/bundler/version_ranges.rb +122 -0
  291. data/lib/bundler/vlad.rb +8 -2
  292. data/lib/bundler/worker.rb +38 -6
  293. data/lib/bundler/yaml_serializer.rb +89 -0
  294. metadata +164 -158
  295. data/.gitignore +0 -16
  296. data/.rspec +0 -3
  297. data/.rubocop.yml +0 -105
  298. data/.rubocop_todo.yml +0 -120
  299. data/.travis.yml +0 -97
  300. data/CODE_OF_CONDUCT.md +0 -42
  301. data/CONTRIBUTING.md +0 -32
  302. data/DEVELOPMENT.md +0 -118
  303. data/ISSUES.md +0 -96
  304. data/Rakefile +0 -309
  305. data/bin/rake +0 -14
  306. data/bin/rspec +0 -10
  307. data/bin/rubocop +0 -11
  308. data/exe/bundle_ruby +0 -60
  309. data/lib/bundler/cli/package.rb +0 -45
  310. data/lib/bundler/environment.rb +0 -41
  311. data/lib/bundler/gem_path_manipulation.rb +0 -8
  312. data/lib/bundler/gem_remote_fetcher.rb +0 -41
  313. data/lib/bundler/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
  314. data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +0 -32
  315. data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
  316. data/lib/bundler/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
  317. data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
  318. data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +0 -20
  319. data/lib/bundler/ssl_certs/certificate_manager.rb +0 -64
  320. data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
  321. data/lib/bundler/vendor/net/http/faster.rb +0 -26
  322. data/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +0 -128
  323. data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -10
  324. data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -98
  325. data/man/bundle-config.ronn +0 -187
  326. data/man/bundle-update.ronn +0 -188
  327. data/man/bundle.ronn +0 -98
  328. data/man/index.txt +0 -8
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rbconfig"
4
+
5
+ module Bundler
6
+ class CLI::Issue
7
+ def run
8
+ Bundler.ui.info <<-EOS.gsub(/^ {8}/, "")
9
+ Did you find an issue with Bundler? Before filing a new issue,
10
+ be sure to check out these resources:
11
+
12
+ 1. Check out our troubleshooting guide for quick fixes to common issues:
13
+ https://github.com/rubygems/rubygems/blob/master/bundler/doc/TROUBLESHOOTING.md
14
+
15
+ 2. Instructions for common Bundler uses can be found on the documentation
16
+ site: https://bundler.io/
17
+
18
+ 3. Information about each Bundler command can be found in the Bundler
19
+ man pages: https://bundler.io/man/bundle.1.html
20
+
21
+ Hopefully the troubleshooting steps above resolved your problem! If things
22
+ still aren't working the way you expect them to, please let us know so
23
+ that we can diagnose and help fix the problem you're having. Please
24
+ view the Filing Issues guide for more information:
25
+ https://github.com/rubygems/rubygems/blob/master/bundler/doc/contributing/ISSUES.md
26
+
27
+ EOS
28
+
29
+ Bundler.ui.info Bundler::Env.report
30
+
31
+ Bundler.ui.info "\n## Bundle Doctor"
32
+ doctor
33
+ end
34
+
35
+ def doctor
36
+ require_relative "doctor"
37
+ Bundler::CLI::Doctor.new({}).run
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CLI::List
5
+ def initialize(options)
6
+ @options = options
7
+ @without_group = options["without-group"].map(&:to_sym)
8
+ @only_group = options["only-group"].map(&:to_sym)
9
+ end
10
+
11
+ def run
12
+ raise InvalidOption, "The `--only-group` and `--without-group` options cannot be used together" if @only_group.any? && @without_group.any?
13
+
14
+ raise InvalidOption, "The `--name-only` and `--paths` options cannot be used together" if @options["name-only"] && @options[:paths]
15
+
16
+ specs = if @only_group.any? || @without_group.any?
17
+ filtered_specs_by_groups
18
+ else
19
+ Bundler.load.specs
20
+ end.reject {|s| s.name == "bundler" }.sort_by(&:name)
21
+
22
+ return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
23
+
24
+ return specs.each {|s| Bundler.ui.info s.name } if @options["name-only"]
25
+ return specs.each {|s| Bundler.ui.info s.full_gem_path } if @options["paths"]
26
+
27
+ Bundler.ui.info "Gems included by the bundle:"
28
+
29
+ specs.each {|s| Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version})" }
30
+
31
+ Bundler.ui.info "Use `bundle info` to print more detailed information about a gem"
32
+ end
33
+
34
+ private
35
+
36
+ def verify_group_exists(groups)
37
+ (@without_group + @only_group).each do |group|
38
+ raise InvalidOption, "`#{group}` group could not be found." unless groups.include?(group)
39
+ end
40
+ end
41
+
42
+ def filtered_specs_by_groups
43
+ definition = Bundler.definition
44
+ groups = definition.groups
45
+
46
+ verify_group_exists(groups)
47
+
48
+ show_groups =
49
+ if @without_group.any?
50
+ groups.reject {|g| @without_group.include?(g) }
51
+ elsif @only_group.any?
52
+ groups.select {|g| @only_group.include?(g) }
53
+ else
54
+ groups
55
+ end.map(&:to_sym)
56
+
57
+ definition.specs_for(show_groups)
58
+ end
59
+ end
60
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bundler
2
4
  class CLI::Lock
3
5
  attr_reader :options
@@ -16,12 +18,32 @@ module Bundler
16
18
  ui = Bundler.ui
17
19
  Bundler.ui = UI::Silent.new if print
18
20
 
19
- gems = options[:update]
21
+ Bundler::Fetcher.disable_endpoint = options["full-index"]
20
22
 
21
- if gems && !gems.empty?
22
- definition = Bundler.definition(:gems => gems)
23
- else
24
- definition = Bundler.definition(true)
23
+ update = options[:update]
24
+ if update.is_a?(Array) # unlocking specific gems
25
+ Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update)
26
+ update = { :gems => update, :lock_shared_dependencies => options[:conservative] }
27
+ end
28
+ definition = Bundler.definition(update)
29
+
30
+ Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options) if options[:update]
31
+
32
+ options["remove-platform"].each do |platform|
33
+ definition.remove_platform(platform)
34
+ end
35
+
36
+ options["add-platform"].each do |platform_string|
37
+ platform = Gem::Platform.new(platform_string)
38
+ if platform.to_s == "unknown"
39
+ Bundler.ui.warn "The platform `#{platform_string}` is unknown to RubyGems " \
40
+ "and adding it will likely lead to resolution errors"
41
+ end
42
+ definition.add_platform(platform)
43
+ end
44
+
45
+ if definition.platforms.empty?
46
+ raise InvalidOption, "Removing all platforms from the bundle is not allowed"
25
47
  end
26
48
 
27
49
  definition.resolve_remotely! unless options[:local]
@@ -1,4 +1,5 @@
1
- require "bundler/cli/common"
1
+ # frozen_string_literal: true
2
+
2
3
  require "shellwords"
3
4
 
4
5
  module Bundler
@@ -12,10 +13,17 @@ module Bundler
12
13
  def run
13
14
  editor = [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }
14
15
  return Bundler.ui.info("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR") unless editor
15
- path = Bundler::CLI::Common.select_spec(name, :regex_match).full_gem_path
16
- Dir.chdir(path) do
17
- command = Shellwords.split(editor) + [path]
18
- system(*command) || Bundler.ui.info("Could not run '#{command.join(" ")}'")
16
+ return unless spec = Bundler::CLI::Common.select_spec(name, :regex_match)
17
+ if spec.default_gem?
18
+ Bundler.ui.info "Unable to open #{name} because it's a default gem, so the directory it would normally be installed to does not exist."
19
+ else
20
+ path = spec.full_gem_path
21
+ Dir.chdir(path) do
22
+ command = Shellwords.split(editor) + [path]
23
+ Bundler.with_original_env do
24
+ system(*command)
25
+ end || Bundler.ui.info("Could not run '#{command.join(" ")}'")
26
+ end
19
27
  end
20
28
  end
21
29
  end
@@ -1,86 +1,291 @@
1
- require "bundler/cli/common"
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Bundler
4
4
  class CLI::Outdated
5
- attr_reader :options, :gems
5
+ attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources, :strict
6
+ attr_accessor :outdated_gems
7
+
6
8
  def initialize(options, gems)
7
9
  @options = options
8
10
  @gems = gems
11
+ @sources = Array(options[:source])
12
+
13
+ @filter_options_patch = options.keys & %w[filter-major filter-minor filter-patch]
14
+
15
+ @outdated_gems = []
16
+
17
+ @options_include_groups = [:group, :groups].any? do |v|
18
+ options.keys.include?(v.to_s)
19
+ end
20
+
21
+ # the patch level options imply strict is also true. It wouldn't make
22
+ # sense otherwise.
23
+ @strict = options["filter-strict"] || Bundler::CLI::Common.patch_level_options(options).any?
9
24
  end
10
25
 
11
26
  def run
12
- sources = Array(options[:source])
27
+ check_for_deployment_mode!
13
28
 
14
29
  gems.each do |gem_name|
15
30
  Bundler::CLI::Common.select_spec(gem_name)
16
31
  end
17
32
 
18
- Bundler.definition.validate_ruby!
19
- current_specs = Bundler.ui.silence { Bundler.load.specs }
20
- current_dependencies = {}
21
- Bundler.ui.silence { Bundler.load.dependencies.each {|dep| current_dependencies[dep.name] = dep } }
33
+ Bundler.definition.validate_runtime!
34
+ current_specs = Bundler.ui.silence { Bundler.definition.resolve }
22
35
 
23
- if gems.empty? && sources.empty?
36
+ current_dependencies = Bundler.ui.silence do
37
+ Bundler.load.dependencies.map {|dep| [dep.name, dep] }.to_h
38
+ end
39
+
40
+ definition = if gems.empty? && sources.empty?
24
41
  # We're doing a full update
25
- definition = Bundler.definition(true)
42
+ Bundler.definition(true)
26
43
  else
27
- definition = Bundler.definition(:gems => gems, :sources => sources)
44
+ Bundler.definition(:gems => gems, :sources => sources)
45
+ end
46
+
47
+ Bundler::CLI::Common.configure_gem_version_promoter(
48
+ Bundler.definition,
49
+ options
50
+ )
51
+
52
+ definition_resolution = proc do
53
+ options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
54
+ end
55
+
56
+ if options[:parseable]
57
+ Bundler.ui.silence(&definition_resolution)
58
+ else
59
+ definition_resolution.call
28
60
  end
29
- options["local"] ? definition.resolve_with_cache! : definition.resolve_remotely!
30
61
 
31
62
  Bundler.ui.info ""
32
63
 
33
- out_count = 0
34
64
  # Loop through the current specs
35
- gemfile_specs, dependency_specs = current_specs.partition {|spec| current_dependencies.key? spec.name }
36
- [gemfile_specs.sort_by(&:name), dependency_specs.sort_by(&:name)].flatten.each do |current_spec|
37
- next if !gems.empty? && !gems.include?(current_spec.name)
65
+ gemfile_specs, dependency_specs = current_specs.partition do |spec|
66
+ current_dependencies.key? spec.name
67
+ end
68
+
69
+ specs = if options["only-explicit"]
70
+ gemfile_specs
71
+ else
72
+ gemfile_specs + dependency_specs
73
+ end
74
+
75
+ specs.sort_by(&:name).each do |current_spec|
76
+ next unless gems.empty? || gems.include?(current_spec.name)
77
+
78
+ active_spec = retrieve_active_spec(definition, current_spec)
79
+ next unless active_spec
80
+
81
+ next unless filter_options_patch.empty? || update_present_via_semver_portions(current_spec, active_spec, options)
82
+
83
+ gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
84
+ next unless gem_outdated || (current_spec.git_version != active_spec.git_version)
38
85
 
39
86
  dependency = current_dependencies[current_spec.name]
87
+ groups = ""
88
+ if dependency && !options[:parseable]
89
+ groups = dependency.groups.join(", ")
90
+ end
40
91
 
41
- if options["strict"]
42
- active_spec = definition.specs.detect {|spec| spec.name == current_spec.name }
43
- else
44
- active_spec = definition.index[current_spec.name].sort_by(&:version)
45
- if !current_spec.version.prerelease? && !options[:pre] && active_spec.size > 1
46
- active_spec = active_spec.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
47
- end
48
- active_spec = active_spec.last
92
+ outdated_gems << {
93
+ :active_spec => active_spec,
94
+ :current_spec => current_spec,
95
+ :dependency => dependency,
96
+ :groups => groups,
97
+ }
98
+ end
99
+
100
+ if outdated_gems.empty?
101
+ unless options[:parseable]
102
+ Bundler.ui.info(nothing_outdated_message)
49
103
  end
50
- next if active_spec.nil?
104
+ else
105
+ if options_include_groups
106
+ relevant_outdated_gems = outdated_gems.group_by {|g| g[:groups] }.sort.flat_map do |groups, gems|
107
+ contains_group = groups.split(", ").include?(options[:group])
108
+ next unless options[:groups] || contains_group
51
109
 
52
- gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
53
- git_outdated = current_spec.git_version != active_spec.git_version
54
- if gem_outdated || git_outdated
55
- if out_count == 0
56
- if options["pre"]
57
- Bundler.ui.info "Outdated gems included in the bundle (including pre-releases):"
58
- else
59
- Bundler.ui.info "Outdated gems included in the bundle:"
110
+ gems
111
+ end.compact
112
+
113
+ if options[:parseable]
114
+ relevant_outdated_gems.each do |gems|
115
+ print_gems(gems)
60
116
  end
117
+ else
118
+ print_gems_table(relevant_outdated_gems)
61
119
  end
120
+ elsif options[:parseable]
121
+ print_gems(outdated_gems)
122
+ else
123
+ print_gems_table(outdated_gems)
124
+ end
125
+
126
+ exit 1
127
+ end
128
+ end
62
129
 
63
- spec_version = "#{active_spec.version}#{active_spec.git_version}"
64
- current_version = "#{current_spec.version}#{current_spec.git_version}"
65
- dependency_version = %(, requested #{dependency.requirement}) if dependency && dependency.specific?
130
+ private
66
131
 
67
- if dependency
68
- groups = dependency.groups.join(", ")
69
- pl = (dependency.groups.length > 1) ? "s" : ""
70
- groups = " in group#{pl} \"#{groups}\""
71
- end
132
+ def groups_text(group_text, groups)
133
+ "#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""
134
+ end
135
+
136
+ def nothing_outdated_message
137
+ if filter_options_patch.any?
138
+ display = filter_options_patch.map do |o|
139
+ o.sub("filter-", "")
140
+ end.join(" or ")
72
141
 
73
- Bundler.ui.info " * #{active_spec.name} (newest #{spec_version}, installed #{current_version}#{dependency_version})#{groups}".rstrip
74
- out_count += 1
142
+ "No #{display} updates to display.\n"
143
+ else
144
+ "Bundle up to date!\n"
145
+ end
146
+ end
147
+
148
+ def retrieve_active_spec(definition, current_spec)
149
+ if strict
150
+ active_spec = definition.find_resolved_spec(current_spec)
151
+ else
152
+ active_specs = definition.find_indexed_specs(current_spec)
153
+ if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
154
+ active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
75
155
  end
76
- Bundler.ui.debug "from #{active_spec.loaded_from}"
156
+ active_spec = active_specs.last
77
157
  end
78
158
 
79
- if out_count.zero?
80
- Bundler.ui.info "Bundle up to date!\n"
159
+ active_spec
160
+ end
161
+
162
+ def print_gems(gems_list)
163
+ gems_list.each do |gem|
164
+ print_gem(
165
+ gem[:current_spec],
166
+ gem[:active_spec],
167
+ gem[:dependency],
168
+ gem[:groups],
169
+ )
170
+ end
171
+ end
172
+
173
+ def print_gems_table(gems_list)
174
+ data = gems_list.map do |gem|
175
+ gem_column_for(
176
+ gem[:current_spec],
177
+ gem[:active_spec],
178
+ gem[:dependency],
179
+ gem[:groups],
180
+ )
181
+ end
182
+
183
+ print_indented([table_header] + data)
184
+ end
185
+
186
+ def print_gem(current_spec, active_spec, dependency, groups)
187
+ spec_version = "#{active_spec.version}#{active_spec.git_version}"
188
+ spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from
189
+ current_version = "#{current_spec.version}#{current_spec.git_version}"
190
+
191
+ if dependency && dependency.specific?
192
+ dependency_version = %(, requested #{dependency.requirement})
193
+ end
194
+
195
+ spec_outdated_info = "#{active_spec.name} (newest #{spec_version}, " \
196
+ "installed #{current_version}#{dependency_version})"
197
+
198
+ output_message = if options[:parseable]
199
+ spec_outdated_info.to_s
200
+ elsif options_include_groups || groups.empty?
201
+ " * #{spec_outdated_info}"
81
202
  else
82
- exit 1
203
+ " * #{spec_outdated_info} in #{groups_text("group", groups)}"
83
204
  end
205
+
206
+ Bundler.ui.info output_message.rstrip
207
+ end
208
+
209
+ def gem_column_for(current_spec, active_spec, dependency, groups)
210
+ current_version = "#{current_spec.version}#{current_spec.git_version}"
211
+ spec_version = "#{active_spec.version}#{active_spec.git_version}"
212
+ dependency = dependency.requirement if dependency
213
+
214
+ ret_val = [active_spec.name, current_version, spec_version, dependency.to_s, groups.to_s]
215
+ ret_val << active_spec.loaded_from.to_s if Bundler.ui.debug?
216
+ ret_val
217
+ end
218
+
219
+ def check_for_deployment_mode!
220
+ return unless Bundler.frozen_bundle?
221
+ suggested_command = if Bundler.settings.locations("frozen").keys.&([:global, :local]).any?
222
+ "bundle config unset frozen"
223
+ elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
224
+ "bundle config unset deployment"
225
+ end
226
+ raise ProductionError, "You are trying to check outdated gems in " \
227
+ "deployment mode. Run `bundle outdated` elsewhere.\n" \
228
+ "\nIf this is a development machine, remove the " \
229
+ "#{Bundler.default_gemfile} freeze" \
230
+ "\nby running `#{suggested_command}`."
231
+ end
232
+
233
+ def update_present_via_semver_portions(current_spec, active_spec, options)
234
+ current_major = current_spec.version.segments.first
235
+ active_major = active_spec.version.segments.first
236
+
237
+ update_present = false
238
+ update_present = active_major > current_major if options["filter-major"]
239
+
240
+ if !update_present && (options["filter-minor"] || options["filter-patch"]) && current_major == active_major
241
+ current_minor = get_version_semver_portion_value(current_spec, 1)
242
+ active_minor = get_version_semver_portion_value(active_spec, 1)
243
+
244
+ update_present = active_minor > current_minor if options["filter-minor"]
245
+
246
+ if !update_present && options["filter-patch"] && current_minor == active_minor
247
+ current_patch = get_version_semver_portion_value(current_spec, 2)
248
+ active_patch = get_version_semver_portion_value(active_spec, 2)
249
+
250
+ update_present = active_patch > current_patch
251
+ end
252
+ end
253
+
254
+ update_present
255
+ end
256
+
257
+ def get_version_semver_portion_value(spec, version_portion_index)
258
+ version_section = spec.version.segments[version_portion_index, 1]
259
+ version_section.to_a[0].to_i
260
+ end
261
+
262
+ def print_indented(matrix)
263
+ header = matrix[0]
264
+ data = matrix[1..-1]
265
+
266
+ column_sizes = Array.new(header.size) do |index|
267
+ matrix.max_by {|row| row[index].length }[index].length
268
+ end
269
+
270
+ Bundler.ui.info justify(header, column_sizes)
271
+
272
+ data.sort_by! {|row| row[0] }
273
+
274
+ data.each do |row|
275
+ Bundler.ui.info justify(row, column_sizes)
276
+ end
277
+ end
278
+
279
+ def table_header
280
+ header = ["Gem", "Current", "Latest", "Requested", "Groups"]
281
+ header << "Path" if Bundler.ui.debug?
282
+ header
283
+ end
284
+
285
+ def justify(row, sizes)
286
+ row.each_with_index.map do |element, index|
287
+ element.ljust(sizes[index])
288
+ end.join(" ").strip + "\n"
84
289
  end
85
290
  end
86
291
  end