bundler 1.17.2 → 2.2.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (322) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2095 -1251
  3. data/LICENSE.md +18 -19
  4. data/README.md +10 -11
  5. data/bundler.gemspec +10 -28
  6. data/exe/bundle +22 -3
  7. data/lib/bundler/build_metadata.rb +4 -12
  8. data/lib/bundler/capistrano.rb +4 -4
  9. data/lib/bundler/cli/add.rb +28 -16
  10. data/lib/bundler/cli/binstubs.rb +6 -2
  11. data/lib/bundler/cli/cache.rb +24 -17
  12. data/lib/bundler/cli/check.rb +4 -2
  13. data/lib/bundler/cli/clean.rb +1 -1
  14. data/lib/bundler/cli/common.rb +39 -13
  15. data/lib/bundler/cli/config.rb +161 -86
  16. data/lib/bundler/cli/console.rb +1 -1
  17. data/lib/bundler/cli/doctor.rb +20 -9
  18. data/lib/bundler/cli/exec.rb +8 -25
  19. data/lib/bundler/cli/fund.rb +36 -0
  20. data/lib/bundler/cli/gem.rb +213 -32
  21. data/lib/bundler/cli/info.rb +42 -7
  22. data/lib/bundler/cli/init.rb +2 -2
  23. data/lib/bundler/cli/inject.rb +1 -1
  24. data/lib/bundler/cli/install.rb +34 -44
  25. data/lib/bundler/cli/issue.rb +8 -7
  26. data/lib/bundler/cli/list.rb +19 -11
  27. data/lib/bundler/cli/lock.rb +5 -1
  28. data/lib/bundler/cli/open.rb +11 -8
  29. data/lib/bundler/cli/outdated.rb +142 -118
  30. data/lib/bundler/cli/plugin.rb +19 -2
  31. data/lib/bundler/cli/pristine.rb +6 -1
  32. data/lib/bundler/cli/remove.rb +1 -2
  33. data/lib/bundler/cli/show.rb +2 -2
  34. data/lib/bundler/cli/update.rb +43 -16
  35. data/lib/bundler/cli.rb +211 -150
  36. data/lib/bundler/compact_index_client/cache.rb +6 -14
  37. data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  38. data/lib/bundler/compact_index_client/updater.rb +15 -28
  39. data/lib/bundler/compact_index_client.rb +28 -12
  40. data/lib/bundler/current_ruby.rb +14 -11
  41. data/lib/bundler/definition.rb +207 -368
  42. data/lib/bundler/dep_proxy.rb +16 -9
  43. data/lib/bundler/dependency.rb +19 -14
  44. data/lib/bundler/deployment.rb +1 -1
  45. data/lib/bundler/digest.rb +71 -0
  46. data/lib/bundler/dsl.rb +81 -81
  47. data/lib/bundler/endpoint_specification.rb +1 -1
  48. data/lib/bundler/env.rb +9 -14
  49. data/lib/bundler/environment_preserver.rb +29 -3
  50. data/lib/bundler/errors.rb +20 -3
  51. data/lib/bundler/feature_flag.rb +14 -33
  52. data/lib/bundler/fetcher/base.rb +1 -1
  53. data/lib/bundler/fetcher/compact_index.rb +28 -14
  54. data/lib/bundler/fetcher/dependency.rb +1 -1
  55. data/lib/bundler/fetcher/downloader.rb +14 -8
  56. data/lib/bundler/fetcher/index.rb +8 -8
  57. data/lib/bundler/fetcher.rb +22 -17
  58. data/lib/bundler/friendly_errors.rb +29 -48
  59. data/lib/bundler/gem_helper.rb +79 -43
  60. data/lib/bundler/gem_helpers.rb +38 -29
  61. data/lib/bundler/gem_tasks.rb +1 -1
  62. data/lib/bundler/gem_version_promoter.rb +5 -5
  63. data/lib/bundler/graph.rb +3 -3
  64. data/lib/bundler/index.rb +9 -9
  65. data/lib/bundler/injector.rb +33 -13
  66. data/lib/bundler/inline.rb +41 -30
  67. data/lib/bundler/installer/gem_installer.rb +9 -18
  68. data/lib/bundler/installer/parallel_installer.rb +50 -33
  69. data/lib/bundler/installer/standalone.rb +30 -11
  70. data/lib/bundler/installer.rb +39 -66
  71. data/lib/bundler/lazy_specification.rb +63 -28
  72. data/lib/bundler/lockfile_generator.rb +1 -1
  73. data/lib/bundler/lockfile_parser.rb +19 -52
  74. data/lib/bundler/{ssl_certs → man}/.document +0 -0
  75. data/{man → lib/bundler/man}/bundle-add.1 +10 -2
  76. data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +7 -1
  77. data/{man → lib/bundler/man}/bundle-binstubs.1 +6 -4
  78. data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +3 -5
  79. data/lib/bundler/man/bundle-cache.1 +55 -0
  80. data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +15 -15
  81. data/{man → lib/bundler/man}/bundle-check.1 +1 -1
  82. data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
  83. data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
  84. data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
  85. data/{man → lib/bundler/man}/bundle-config.1 +59 -60
  86. data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +77 -78
  87. data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
  88. data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
  89. data/{man → lib/bundler/man}/bundle-exec.1 +2 -2
  90. data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +1 -1
  91. data/{man → lib/bundler/man}/bundle-gem.1 +38 -3
  92. data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +46 -7
  93. data/{man → lib/bundler/man}/bundle-info.1 +1 -1
  94. data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
  95. data/{man → lib/bundler/man}/bundle-init.1 +2 -2
  96. data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +1 -1
  97. data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
  98. data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
  99. data/{man → lib/bundler/man}/bundle-install.1 +37 -7
  100. data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +34 -7
  101. data/{man → lib/bundler/man}/bundle-list.1 +7 -7
  102. data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
  103. data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
  104. data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
  105. data/{man → lib/bundler/man}/bundle-open.1 +1 -1
  106. data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
  107. data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
  108. data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
  109. data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
  110. data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
  111. data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
  112. data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
  113. data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
  114. data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
  115. data/{man → lib/bundler/man}/bundle-show.1 +1 -1
  116. data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
  117. data/{man → lib/bundler/man}/bundle-update.1 +7 -7
  118. data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +6 -6
  119. data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
  120. data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
  121. data/{man → lib/bundler/man}/bundle.1 +7 -3
  122. data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +5 -2
  123. data/{man → lib/bundler/man}/gemfile.5 +44 -21
  124. data/{man → lib/bundler/man}/gemfile.5.ronn +24 -20
  125. data/{man → lib/bundler/man}/index.txt +1 -1
  126. data/lib/bundler/match_platform.rb +1 -1
  127. data/lib/bundler/mirror.rb +5 -5
  128. data/lib/bundler/plugin/api/source.rb +27 -7
  129. data/lib/bundler/plugin/api.rb +1 -1
  130. data/lib/bundler/plugin/dsl.rb +1 -1
  131. data/lib/bundler/plugin/index.rb +27 -4
  132. data/lib/bundler/plugin/installer/rubygems.rb +1 -1
  133. data/lib/bundler/plugin/installer.rb +35 -22
  134. data/lib/bundler/plugin/source_list.rb +5 -1
  135. data/lib/bundler/plugin.rb +100 -42
  136. data/lib/bundler/psyched_yaml.rb +0 -15
  137. data/lib/bundler/remote_specification.rb +5 -4
  138. data/lib/bundler/resolver/spec_group.rb +57 -53
  139. data/lib/bundler/resolver.rb +127 -113
  140. data/lib/bundler/retry.rb +4 -4
  141. data/lib/bundler/ruby_version.rb +5 -20
  142. data/lib/bundler/rubygems_ext.rb +103 -79
  143. data/lib/bundler/rubygems_gem_installer.rb +69 -8
  144. data/lib/bundler/rubygems_integration.rb +181 -446
  145. data/lib/bundler/runtime.rb +24 -34
  146. data/lib/bundler/settings.rb +159 -110
  147. data/lib/bundler/setup.rb +11 -12
  148. data/lib/bundler/shared_helpers.rb +56 -90
  149. data/lib/bundler/similarity_detector.rb +3 -3
  150. data/lib/bundler/source/git/git_proxy.rb +106 -105
  151. data/lib/bundler/source/git.rb +66 -39
  152. data/lib/bundler/source/metadata.rb +9 -9
  153. data/lib/bundler/source/path/installer.rb +10 -10
  154. data/lib/bundler/source/path.rb +23 -12
  155. data/lib/bundler/source/rubygems/remote.rb +3 -4
  156. data/lib/bundler/source/rubygems.rb +136 -120
  157. data/lib/bundler/source/rubygems_aggregate.rb +68 -0
  158. data/lib/bundler/source.rb +27 -6
  159. data/lib/bundler/source_list.rb +101 -66
  160. data/lib/bundler/source_map.rb +58 -0
  161. data/lib/bundler/spec_set.rb +49 -53
  162. data/lib/bundler/stub_specification.rb +40 -34
  163. data/lib/bundler/templates/Executable.bundler +24 -15
  164. data/lib/bundler/templates/Gemfile +1 -1
  165. data/lib/bundler/templates/gems.rb +1 -1
  166. data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
  167. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
  168. data/lib/bundler/templates/newgem/Gemfile.tt +19 -2
  169. data/lib/bundler/templates/newgem/README.md.tt +7 -5
  170. data/lib/bundler/templates/newgem/Rakefile.tt +23 -5
  171. data/lib/bundler/templates/newgem/bin/console.tt +1 -0
  172. data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
  173. data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
  174. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +27 -0
  175. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  176. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
  177. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
  178. data/lib/bundler/templates/newgem/newgem.gemspec.tt +29 -40
  179. data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
  180. data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  181. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
  182. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
  183. data/lib/bundler/templates/newgem/standard.yml.tt +2 -0
  184. data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
  185. data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
  186. data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  187. data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  188. data/lib/bundler/templates/newgem/travis.yml.tt +0 -1
  189. data/lib/bundler/ui/rg_proxy.rb +1 -1
  190. data/lib/bundler/ui/shell.rb +7 -11
  191. data/lib/bundler/ui.rb +3 -3
  192. data/lib/bundler/uri_credentials_filter.rb +10 -4
  193. data/lib/bundler/vendor/.document +1 -0
  194. data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  195. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +174 -0
  196. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
  197. data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
  198. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +126 -0
  199. data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
  200. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +273 -147
  201. data/lib/bundler/vendor/molinillo/LICENSE +9 -0
  202. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
  203. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
  204. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
  205. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
  206. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
  207. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
  208. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
  209. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +3 -3
  210. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +39 -11
  211. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +38 -6
  212. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +4 -4
  213. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  214. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +12 -1
  215. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +53 -51
  216. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
  217. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +5 -6
  218. data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  219. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
  220. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
  221. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
  222. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +302 -462
  223. data/lib/bundler/vendor/thor/LICENSE.md +20 -0
  224. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
  225. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +3 -2
  226. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
  227. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +20 -9
  228. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
  229. data/lib/bundler/vendor/thor/lib/thor/actions.rb +28 -13
  230. data/lib/bundler/vendor/thor/lib/thor/base.rb +63 -43
  231. data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
  232. data/lib/bundler/vendor/thor/lib/thor/error.rb +78 -0
  233. data/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
  234. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
  235. data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
  236. data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
  237. data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
  238. data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  239. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +7 -3
  240. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +20 -7
  241. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +21 -5
  242. data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
  243. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
  244. data/lib/bundler/vendor/thor/lib/thor/runner.rb +15 -14
  245. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +65 -8
  246. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +10 -2
  247. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
  248. data/lib/bundler/vendor/thor/lib/thor/shell.rb +4 -4
  249. data/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
  250. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  251. data/lib/bundler/vendor/thor/lib/thor.rb +16 -9
  252. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
  253. data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  254. data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
  255. data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
  256. data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
  257. data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
  258. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  259. data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
  260. data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
  261. data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  262. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  263. data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
  264. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
  265. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  266. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
  267. data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  268. data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  269. data/lib/bundler/vendored_fileutils.rb +1 -6
  270. data/lib/bundler/vendored_molinillo.rb +1 -1
  271. data/lib/bundler/vendored_persistent.rb +7 -12
  272. data/lib/bundler/vendored_thor.rb +2 -2
  273. data/lib/bundler/vendored_tmpdir.rb +4 -0
  274. data/lib/bundler/vendored_tsort.rb +4 -0
  275. data/lib/bundler/vendored_uri.rb +4 -0
  276. data/lib/bundler/version.rb +1 -20
  277. data/lib/bundler/version_ranges.rb +51 -5
  278. data/lib/bundler/vlad.rb +2 -2
  279. data/lib/bundler/worker.rb +21 -8
  280. data/lib/bundler/yaml_serializer.rb +3 -4
  281. data/lib/bundler.rb +248 -118
  282. metadata +115 -190
  283. data/exe/bundle_ruby +0 -60
  284. data/lib/bundler/cli/package.rb +0 -49
  285. data/lib/bundler/compatibility_guard.rb +0 -14
  286. data/lib/bundler/gem_remote_fetcher.rb +0 -43
  287. data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
  288. data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
  289. data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
  290. data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
  291. data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
  292. data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
  293. data/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
  294. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
  295. data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
  296. data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
  297. data/man/bundle-add.1.txt +0 -52
  298. data/man/bundle-binstubs.1.txt +0 -48
  299. data/man/bundle-check.1.txt +0 -33
  300. data/man/bundle-clean.1.txt +0 -26
  301. data/man/bundle-config.1.txt +0 -529
  302. data/man/bundle-doctor.1.txt +0 -44
  303. data/man/bundle-exec.1.txt +0 -178
  304. data/man/bundle-gem.1.txt +0 -91
  305. data/man/bundle-info.1.txt +0 -21
  306. data/man/bundle-init.1.txt +0 -34
  307. data/man/bundle-inject.1.txt +0 -32
  308. data/man/bundle-install.1.txt +0 -396
  309. data/man/bundle-list.1.txt +0 -43
  310. data/man/bundle-lock.1.txt +0 -93
  311. data/man/bundle-open.1.txt +0 -29
  312. data/man/bundle-outdated.1.txt +0 -131
  313. data/man/bundle-package.1 +0 -55
  314. data/man/bundle-package.1.txt +0 -79
  315. data/man/bundle-platform.1.txt +0 -57
  316. data/man/bundle-pristine.1.txt +0 -44
  317. data/man/bundle-remove.1.txt +0 -34
  318. data/man/bundle-show.1.txt +0 -27
  319. data/man/bundle-update.1.txt +0 -391
  320. data/man/bundle-viz.1.txt +0 -39
  321. data/man/bundle.1.txt +0 -113
  322. data/man/gemfile.5.txt +0 -653
@@ -1,12 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "uri"
4
3
  require "rubygems/user_interaction"
5
4
 
6
5
  module Bundler
7
6
  class Source
8
7
  class Rubygems < Source
9
- autoload :Remote, "bundler/source/rubygems/remote"
8
+ autoload :Remote, File.expand_path("rubygems/remote", __dir__)
10
9
 
11
10
  # Use the API when installing less than X gems
12
11
  API_REQUEST_LIMIT = 500
@@ -21,18 +20,38 @@ module Bundler
21
20
  @dependency_names = []
22
21
  @allow_remote = false
23
22
  @allow_cached = false
23
+ @allow_local = options["allow_local"] || false
24
24
  @caches = [cache_path, *Bundler.rubygems.gem_cache]
25
25
 
26
- Array(options["remotes"] || []).reverse_each {|r| add_remote(r) }
26
+ Array(options["remotes"]).reverse_each {|r| add_remote(r) }
27
+ end
28
+
29
+ def local_only!
30
+ @specs = nil
31
+ @allow_local = true
32
+ @allow_cached = false
33
+ @allow_remote = false
34
+ end
35
+
36
+ def local!
37
+ return if @allow_local
38
+
39
+ @specs = nil
40
+ @allow_local = true
27
41
  end
28
42
 
29
43
  def remote!
44
+ return if @allow_remote
45
+
30
46
  @specs = nil
31
47
  @allow_remote = true
32
48
  end
33
49
 
34
50
  def cached!
51
+ return if @allow_cached
52
+
35
53
  @specs = nil
54
+ @allow_local = true
36
55
  @allow_cached = true
37
56
  end
38
57
 
@@ -50,9 +69,17 @@ module Bundler
50
69
  o.is_a?(Rubygems) && (o.credless_remotes - credless_remotes).empty?
51
70
  end
52
71
 
72
+ def multiple_remotes?
73
+ @remotes.size > 1
74
+ end
75
+
76
+ def no_remotes?
77
+ @remotes.size == 0
78
+ end
79
+
53
80
  def can_lock?(spec)
54
- return super if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
55
- spec.source.is_a?(Rubygems)
81
+ return super unless multiple_remotes?
82
+ include?(spec.source)
56
83
  end
57
84
 
58
85
  def options
@@ -74,12 +101,27 @@ module Bundler
74
101
  def to_s
75
102
  if remotes.empty?
76
103
  "locally installed gems"
77
- else
78
- remote_names = remotes.map(&:to_s).join(", ")
104
+ elsif @allow_remote && @allow_cached && @allow_local
105
+ "rubygems repository #{remote_names}, cached gems or installed locally"
106
+ elsif @allow_remote && @allow_local
79
107
  "rubygems repository #{remote_names} or installed locally"
108
+ elsif @allow_remote
109
+ "rubygems repository #{remote_names}"
110
+ elsif @allow_cached && @allow_local
111
+ "cached gems or installed locally"
112
+ else
113
+ "locally installed gems"
80
114
  end
81
115
  end
82
- alias_method :name, :to_s
116
+
117
+ def identifier
118
+ if remotes.empty?
119
+ "locally installed gems"
120
+ else
121
+ "rubygems repository #{remote_names}"
122
+ end
123
+ end
124
+ alias_method :name, :identifier
83
125
 
84
126
  def specs
85
127
  @specs ||= begin
@@ -88,7 +130,7 @@ module Bundler
88
130
  # small_idx.use large_idx.
89
131
  idx = @allow_remote ? remote_specs.dup : Index.new
90
132
  idx.use(cached_specs, :override_dupes) if @allow_cached || @allow_remote
91
- idx.use(installed_specs, :override_dupes)
133
+ idx.use(installed_specs, :override_dupes) if @allow_local
92
134
  idx
93
135
  end
94
136
  end
@@ -97,7 +139,7 @@ module Bundler
97
139
  force = opts[:force]
98
140
  ensure_builtin_gems_cached = opts[:ensure_builtin_gems_cached]
99
141
 
100
- if ensure_builtin_gems_cached && builtin_gem?(spec)
142
+ if ensure_builtin_gems_cached && spec.default_gem?
101
143
  if !cached_path(spec)
102
144
  cached_built_in_gem(spec) unless spec.remote
103
145
  force = true
@@ -120,8 +162,14 @@ module Bundler
120
162
  uris.uniq!
121
163
  Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1
122
164
 
123
- s = Bundler.rubygems.spec_from_gem(fetch_gem(spec), Bundler.settings["trust-policy"])
124
- spec.__swap__(s)
165
+ path = fetch_gem(spec)
166
+ begin
167
+ s = Bundler.rubygems.spec_from_gem(path, Bundler.settings["trust-policy"])
168
+ spec.__swap__(s)
169
+ rescue Gem::Package::FormatError
170
+ Bundler.rm_rf(path)
171
+ raise
172
+ end
125
173
  end
126
174
 
127
175
  unless Bundler.settings[:no_install]
@@ -130,6 +178,7 @@ module Bundler
130
178
  Bundler.ui.confirm message
131
179
 
132
180
  path = cached_gem(spec)
181
+ raise GemNotFound, "Could not find #{spec.file_name} for installation" unless path
133
182
  if requires_sudo?
134
183
  install_path = Bundler.tmp(spec.full_name)
135
184
  bin_path = install_path.join("bin")
@@ -140,20 +189,19 @@ module Bundler
140
189
 
141
190
  Bundler.mkdir_p bin_path, :no_sudo => true unless spec.executables.empty? || Bundler.rubygems.provides?(">= 2.7.5")
142
191
 
143
- installed_spec = nil
144
- Bundler.rubygems.preserve_paths do
145
- installed_spec = Bundler::RubyGemsGemInstaller.at(
146
- path,
147
- :install_dir => install_path.to_s,
148
- :bin_dir => bin_path.to_s,
149
- :ignore_dependencies => true,
150
- :wrappers => true,
151
- :env_shebang => true,
152
- :build_args => opts[:build_args],
153
- :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum,
154
- :bundler_extension_cache_path => extension_cache_path(spec)
155
- ).install
156
- end
192
+ require_relative "../rubygems_gem_installer"
193
+
194
+ installed_spec = Bundler::RubyGemsGemInstaller.at(
195
+ path,
196
+ :install_dir => install_path.to_s,
197
+ :bin_dir => bin_path.to_s,
198
+ :ignore_dependencies => true,
199
+ :wrappers => true,
200
+ :env_shebang => true,
201
+ :build_args => opts[:build_args],
202
+ :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum,
203
+ :bundler_extension_cache_path => extension_cache_path(spec)
204
+ ).install
157
205
  spec.full_gem_path = installed_spec.full_gem_path
158
206
 
159
207
  # SUDO HAX
@@ -190,12 +238,8 @@ module Bundler
190
238
  end
191
239
 
192
240
  def cache(spec, custom_path = nil)
193
- if builtin_gem?(spec)
194
- cached_path = cached_built_in_gem(spec)
195
- else
196
- cached_path = cached_gem(spec)
197
- end
198
- raise GemNotFound, "Missing gem file '#{spec.full_name}.gem'." unless cached_path
241
+ cached_path = cached_gem(spec)
242
+ raise GemNotFound, "Missing gem file '#{spec.file_name}'." unless cached_path
199
243
  return if File.dirname(cached_path) == Bundler.app_cache.to_s
200
244
  Bundler.ui.info " * #{File.basename(cached_path)}"
201
245
  FileUtils.cp(cached_path, Bundler.app_cache(custom_path))
@@ -222,25 +266,16 @@ module Bundler
222
266
  @remotes.unshift(uri) unless @remotes.include?(uri)
223
267
  end
224
268
 
225
- def equivalent_remotes?(other_remotes)
226
- other_remotes.map(&method(:remove_auth)) == @remotes.map(&method(:remove_auth))
227
- end
228
-
229
- def replace_remotes(other_remotes, allow_equivalent = false)
230
- return false if other_remotes == @remotes
231
-
232
- equivalent = allow_equivalent && equivalent_remotes?(other_remotes)
233
-
234
- @remotes = []
235
- other_remotes.reverse_each do |r|
236
- add_remote r.to_s
269
+ def spec_names
270
+ if @allow_remote && dependency_api_available?
271
+ remote_specs.spec_names
272
+ else
273
+ []
237
274
  end
238
-
239
- !equivalent
240
275
  end
241
276
 
242
277
  def unmet_deps
243
- if @allow_remote && api_fetchers.any?
278
+ if @allow_remote && dependency_api_available?
244
279
  remote_specs.unmet_dependency_names
245
280
  else
246
281
  []
@@ -256,7 +291,7 @@ module Bundler
256
291
 
257
292
  def double_check_for(unmet_dependency_names)
258
293
  return unless @allow_remote
259
- return unless api_fetchers.any?
294
+ return unless dependency_api_available?
260
295
 
261
296
  unmet_dependency_names = unmet_dependency_names.call
262
297
  unless unmet_dependency_names.nil?
@@ -278,21 +313,32 @@ module Bundler
278
313
  remote_specs.each do |spec|
279
314
  case spec
280
315
  when EndpointSpecification, Gem::Specification, StubSpecification, LazySpecification
281
- names.concat(spec.runtime_dependencies)
316
+ names.concat(spec.runtime_dependencies.map(&:name))
282
317
  when RemoteSpecification # from the full index
283
318
  return nil
284
319
  else
285
320
  raise "unhandled spec type (#{spec.inspect})"
286
321
  end
287
322
  end
288
- names.map!(&:name) if names
289
323
  names
290
324
  end
291
325
 
292
- protected
326
+ def dependency_api_available?
327
+ api_fetchers.any?
328
+ end
329
+
330
+ protected
331
+
332
+ def remote_names
333
+ remotes.map(&:to_s).join(", ")
334
+ end
293
335
 
294
336
  def credless_remotes
295
- remotes.map(&method(:suppress_configured_credentials))
337
+ if Bundler.settings[:allow_deployment_source_credential_changes]
338
+ remotes.map(&method(:remove_auth))
339
+ else
340
+ remotes.map(&method(:suppress_configured_credentials))
341
+ end
296
342
  end
297
343
 
298
344
  def remotes_for_spec(spec)
@@ -307,14 +353,17 @@ module Bundler
307
353
  end
308
354
 
309
355
  def cached_gem(spec)
310
- cached_gem = cached_path(spec)
311
- unless cached_gem
312
- raise Bundler::GemNotFound, "Could not find #{spec.file_name} for installation"
356
+ if spec.default_gem?
357
+ cached_built_in_gem(spec)
358
+ else
359
+ cached_path(spec)
313
360
  end
314
- cached_gem
315
361
  end
316
362
 
317
363
  def cached_path(spec)
364
+ global_cache_path = download_cache_path(spec)
365
+ @caches << global_cache_path if global_cache_path
366
+
318
367
  possibilities = @caches.map {|p| "#{p}/#{spec.file_name}" }
319
368
  possibilities.find {|p| File.exist?(p) }
320
369
  end
@@ -322,9 +371,10 @@ module Bundler
322
371
  def normalize_uri(uri)
323
372
  uri = uri.to_s
324
373
  uri = "#{uri}/" unless uri =~ %r{/$}
325
- uri = URI(uri)
374
+ require_relative "../vendored_uri"
375
+ uri = Bundler::URI(uri)
326
376
  raise ArgumentError, "The source must be an absolute URI. For example:\n" \
327
- "source 'https://rubygems.org'" if !uri.absolute? || (uri.is_a?(URI::HTTP) && uri.host.nil?)
377
+ "source 'https://rubygems.org'" if !uri.absolute? || (uri.is_a?(Bundler::URI::HTTP) && uri.host.nil?)
328
378
  uri
329
379
  end
330
380
 
@@ -348,7 +398,6 @@ module Bundler
348
398
  def installed_specs
349
399
  @installed_specs ||= Index.build do |idx|
350
400
  Bundler.rubygems.all_specs.reverse_each do |spec|
351
- next if spec.name == "bundler"
352
401
  spec.source = self
353
402
  if Bundler.rubygems.spec_missing_extensions?(spec, false)
354
403
  Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
@@ -361,16 +410,12 @@ module Bundler
361
410
 
362
411
  def cached_specs
363
412
  @cached_specs ||= begin
364
- idx = installed_specs.dup
413
+ idx = @allow_local ? installed_specs.dup : Index.new
365
414
 
366
415
  Dir["#{cache_path}/*.gem"].each do |gemfile|
367
416
  next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
368
417
  s ||= Bundler.rubygems.spec_from_gem(gemfile)
369
418
  s.source = self
370
- if Bundler.rubygems.spec_missing_extensions?(s, false)
371
- Bundler.ui.debug "Source #{self} is ignoring #{s} because it is missing extensions"
372
- next
373
- end
374
419
  idx << s
375
420
  end
376
421
 
@@ -403,11 +448,11 @@ module Bundler
403
448
  def fetch_names(fetchers, dependency_names, index, override_dupes)
404
449
  fetchers.each do |f|
405
450
  if dependency_names
406
- Bundler.ui.info "Fetching gem metadata from #{f.uri}", Bundler.ui.debug?
451
+ Bundler.ui.info "Fetching gem metadata from #{URICredentialsFilter.credential_filtered_uri(f.uri)}", Bundler.ui.debug?
407
452
  index.use f.specs_with_retry(dependency_names, self), override_dupes
408
453
  Bundler.ui.info "" unless Bundler.ui.debug? # new line now that the dots are over
409
454
  else
410
- Bundler.ui.info "Fetching source index from #{f.uri}"
455
+ Bundler.ui.info "Fetching source index from #{URICredentialsFilter.credential_filtered_uri(f.uri)}"
411
456
  index.use f.specs_with_retry(nil, self), override_dupes
412
457
  end
413
458
  end
@@ -418,19 +463,26 @@ module Bundler
418
463
 
419
464
  spec.fetch_platform
420
465
 
421
- download_path = requires_sudo? ? Bundler.tmp(spec.full_name) : rubygems_dir
422
- gem_path = "#{rubygems_dir}/cache/#{spec.full_name}.gem"
466
+ cache_path = download_cache_path(spec) || default_cache_path_for(rubygems_dir)
467
+ gem_path = "#{cache_path}/#{spec.file_name}"
468
+
469
+ if requires_sudo?
470
+ download_path = Bundler.tmp(spec.full_name)
471
+ download_cache_path = default_cache_path_for(download_path)
472
+ else
473
+ download_cache_path = cache_path
474
+ end
423
475
 
424
- SharedHelpers.filesystem_access("#{download_path}/cache") do |p|
476
+ SharedHelpers.filesystem_access(download_cache_path) do |p|
425
477
  FileUtils.mkdir_p(p)
426
478
  end
427
- download_gem(spec, download_path)
479
+ download_gem(spec, download_cache_path)
428
480
 
429
481
  if requires_sudo?
430
- SharedHelpers.filesystem_access("#{rubygems_dir}/cache") do |p|
482
+ SharedHelpers.filesystem_access(cache_path) do |p|
431
483
  Bundler.mkdir_p(p)
432
484
  end
433
- Bundler.sudo "mv #{download_path}/cache/#{spec.full_name}.gem #{gem_path}"
485
+ Bundler.sudo "mv #{download_cache_path}/#{spec.file_name} #{gem_path}"
434
486
  end
435
487
 
436
488
  gem_path
@@ -438,16 +490,8 @@ module Bundler
438
490
  Bundler.rm_rf(download_path) if requires_sudo?
439
491
  end
440
492
 
441
- def builtin_gem?(spec)
442
- # Ruby 2.1, where all included gems have this summary
443
- return true if spec.summary =~ /is bundled with Ruby/
444
-
445
- # Ruby 2.0, where gemspecs are stored in specifications/default/
446
- spec.loaded_from && spec.loaded_from.include?("specifications/default/")
447
- end
448
-
449
493
  def installed?(spec)
450
- installed_specs[spec].any?
494
+ installed_specs[spec].any? && !spec.deleted_gem?
451
495
  end
452
496
 
453
497
  def requires_sudo?
@@ -458,11 +502,15 @@ module Bundler
458
502
  Bundler.rubygems.gem_dir
459
503
  end
460
504
 
505
+ def default_cache_path_for(dir)
506
+ "#{dir}/cache"
507
+ end
508
+
461
509
  def cache_path
462
510
  Bundler.app_cache
463
511
  end
464
512
 
465
- private
513
+ private
466
514
 
467
515
  # Checks if the requested spec exists in the global cache. If it does,
468
516
  # we copy it to the download path, and if it does not, we download it.
@@ -470,45 +518,13 @@ module Bundler
470
518
  # @param [Specification] spec
471
519
  # the spec we want to download or retrieve from the cache.
472
520
  #
473
- # @param [String] download_path
521
+ # @param [String] download_cache_path
474
522
  # the local directory the .gem will end up in.
475
523
  #
476
- def download_gem(spec, download_path)
477
- local_path = File.join(download_path, "cache/#{spec.full_name}.gem")
478
-
479
- if (cache_path = download_cache_path(spec)) && cache_path.file?
480
- SharedHelpers.filesystem_access(local_path) do
481
- FileUtils.cp(cache_path, local_path)
482
- end
483
- else
484
- uri = spec.remote.uri
485
- Bundler.ui.confirm("Fetching #{version_message(spec)}")
486
- rubygems_local_path = Bundler.rubygems.download_gem(spec, uri, download_path)
487
- if rubygems_local_path != local_path
488
- FileUtils.mv(rubygems_local_path, local_path)
489
- end
490
- cache_globally(spec, local_path)
491
- end
492
- end
493
-
494
- # Checks if the requested spec exists in the global cache. If it does
495
- # not, we create the relevant global cache subdirectory if it does not
496
- # exist and copy the spec from the local cache to the global cache.
497
- #
498
- # @param [Specification] spec
499
- # the spec we want to copy to the global cache.
500
- #
501
- # @param [String] local_cache_path
502
- # the local directory from which we want to copy the .gem.
503
- #
504
- def cache_globally(spec, local_cache_path)
505
- return unless cache_path = download_cache_path(spec)
506
- return if cache_path.exist?
507
-
508
- SharedHelpers.filesystem_access(cache_path.dirname, &:mkpath)
509
- SharedHelpers.filesystem_access(cache_path) do
510
- FileUtils.cp(local_cache_path, cache_path)
511
- end
524
+ def download_gem(spec, download_cache_path)
525
+ uri = spec.remote.uri
526
+ Bundler.ui.confirm("Fetching #{version_message(spec)}")
527
+ Bundler.rubygems.download_gem(spec, uri, download_cache_path)
512
528
  end
513
529
 
514
530
  # Returns the global cache path of the calling Rubygems::Source object.
@@ -527,7 +543,7 @@ module Bundler
527
543
  return unless remote = spec.remote
528
544
  return unless cache_slug = remote.cache_slug
529
545
 
530
- Bundler.user_cache.join("gems", cache_slug, spec.file_name)
546
+ Bundler.user_cache.join("gems", cache_slug)
531
547
  end
532
548
 
533
549
  def extension_cache_slug(spec)
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class Source
5
+ class RubygemsAggregate
6
+ attr_reader :source_map, :sources
7
+
8
+ def initialize(sources, source_map)
9
+ @sources = sources
10
+ @source_map = source_map
11
+
12
+ @index = build_index
13
+ end
14
+
15
+ def specs
16
+ @index
17
+ end
18
+
19
+ def identifier
20
+ to_s
21
+ end
22
+
23
+ def to_s
24
+ "any of the sources"
25
+ end
26
+
27
+ private
28
+
29
+ def build_index
30
+ Index.build do |idx|
31
+ dependency_names = source_map.pinned_spec_names
32
+
33
+ sources.all_sources.each do |source|
34
+ source.dependency_names = dependency_names - source_map.pinned_spec_names(source)
35
+ idx.add_source source.specs
36
+ dependency_names.concat(source.unmet_deps).uniq!
37
+ end
38
+
39
+ double_check_for_index(idx, dependency_names)
40
+ end
41
+ end
42
+
43
+ # Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
44
+ # sources A and B. At this point, the API request will have found all the versions of Bar in source A,
45
+ # but will not have found any versions of Bar from source B, which is a problem if the requested version
46
+ # of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
47
+ # each spec we found, we add all possible versions from all sources to the index.
48
+ def double_check_for_index(idx, dependency_names)
49
+ pinned_names = source_map.pinned_spec_names
50
+
51
+ names = :names # do this so we only have to traverse to get dependency_names from the index once
52
+ unmet_dependency_names = lambda do
53
+ return names unless names == :names
54
+ new_names = sources.all_sources.map(&:dependency_names_to_double_check)
55
+ return names = nil if new_names.compact!
56
+ names = new_names.flatten(1).concat(dependency_names)
57
+ names.uniq!
58
+ names -= pinned_names
59
+ names
60
+ end
61
+
62
+ sources.all_sources.each do |source|
63
+ source.double_check_for(unmet_dependency_names)
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -2,11 +2,12 @@
2
2
 
3
3
  module Bundler
4
4
  class Source
5
- autoload :Gemspec, "bundler/source/gemspec"
6
- autoload :Git, "bundler/source/git"
7
- autoload :Metadata, "bundler/source/metadata"
8
- autoload :Path, "bundler/source/path"
9
- autoload :Rubygems, "bundler/source/rubygems"
5
+ autoload :Gemspec, File.expand_path("source/gemspec", __dir__)
6
+ autoload :Git, File.expand_path("source/git", __dir__)
7
+ autoload :Metadata, File.expand_path("source/metadata", __dir__)
8
+ autoload :Path, File.expand_path("source/path", __dir__)
9
+ autoload :Rubygems, File.expand_path("source/rubygems", __dir__)
10
+ autoload :RubygemsAggregate, File.expand_path("source/rubygems_aggregate", __dir__)
10
11
 
11
12
  attr_accessor :dependency_names
12
13
 
@@ -33,6 +34,18 @@ module Bundler
33
34
  spec.source == self
34
35
  end
35
36
 
37
+ def local!; end
38
+
39
+ def local_only!; end
40
+
41
+ def cached!; end
42
+
43
+ def remote!; end
44
+
45
+ def add_dependency_names(names)
46
+ @dependency_names = Array(dependency_names) | Array(names)
47
+ end
48
+
36
49
  # it's possible that gems from one source depend on gems from some
37
50
  # other source, so now we download gemspecs and iterate over those
38
51
  # dependencies, looking for gems we don't have info on yet.
@@ -42,6 +55,10 @@ module Bundler
42
55
  specs.dependency_names
43
56
  end
44
57
 
58
+ def spec_names
59
+ specs.spec_names
60
+ end
61
+
45
62
  def include?(other)
46
63
  other == self
47
64
  end
@@ -50,6 +67,10 @@ module Bundler
50
67
  "#<#{self.class}:0x#{object_id} #{self}>"
51
68
  end
52
69
 
70
+ def identifier
71
+ to_s
72
+ end
73
+
53
74
  def path?
54
75
  instance_of?(Bundler::Source::Path)
55
76
  end
@@ -63,7 +84,7 @@ module Bundler
63
84
  )
64
85
  end
65
86
 
66
- private
87
+ private
67
88
 
68
89
  def version_color(spec_version, locked_spec_version)
69
90
  if Gem::Version.correct?(spec_version) && Gem::Version.correct?(locked_spec_version)