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
@@ -2,53 +2,34 @@
2
2
 
3
3
  require "pathname"
4
4
 
5
- if defined?(Gem::QuickLoader)
6
- # Gem Prelude makes me a sad panda :'(
7
- Gem::QuickLoader.load_full_rubygems_library
8
- end
9
-
10
- require "rubygems"
11
5
  require "rubygems/specification"
12
6
 
13
- begin
14
- # Possible use in Gem::Specification#source below and require
15
- # shouldn't be deferred.
16
- require "rubygems/source"
17
- rescue LoadError
18
- # Not available before RubyGems 2.0.0, ignore
19
- nil
20
- end
7
+ # Possible use in Gem::Specification#source below and require
8
+ # shouldn't be deferred.
9
+ require "rubygems/source"
21
10
 
22
- require "bundler/match_platform"
11
+ require_relative "match_platform"
23
12
 
24
13
  module Gem
25
- @loaded_stacks = Hash.new {|h, k| h[k] = [] }
26
-
27
14
  class Specification
28
15
  attr_accessor :remote, :location, :relative_loaded_from
29
16
 
30
- if instance_methods(false).map(&:to_sym).include?(:source)
31
- remove_method :source
32
- attr_writer :source
33
- def source
34
- (defined?(@source) && @source) || Gem::Source::Installed.new
35
- end
36
- else
37
- attr_accessor :source
17
+ remove_method :source
18
+ attr_writer :source
19
+ def source
20
+ (defined?(@source) && @source) || Gem::Source::Installed.new
38
21
  end
39
22
 
40
23
  alias_method :rg_full_gem_path, :full_gem_path
41
24
  alias_method :rg_loaded_from, :loaded_from
42
25
 
43
- attr_writer :full_gem_path unless instance_methods.include?(:full_gem_path=)
44
-
45
26
  def full_gem_path
46
27
  # this cannot check source.is_a?(Bundler::Plugin::API::Source)
47
28
  # because that _could_ trip the autoload, and if there are unresolved
48
29
  # gems at that time, this method could be called inside another require,
49
30
  # thus raising with that constant being undefined. Better to check a method
50
31
  if source.respond_to?(:path) || (source.respond_to?(:bundler_plugin_api_source?) && source.bundler_plugin_api_source?)
51
- Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.untaint
32
+ Pathname.new(loaded_from).dirname.expand_path(source.root).to_s.tap{|x| x.untaint if RUBY_VERSION < "2.7" }
52
33
  else
53
34
  rg_full_gem_path
54
35
  end
@@ -63,32 +44,20 @@ module Gem
63
44
  end
64
45
 
65
46
  def load_paths
66
- return full_require_paths if respond_to?(:full_require_paths)
67
-
68
- require_paths.map do |require_path|
69
- if require_path.include?(full_gem_path)
70
- require_path
71
- else
72
- File.join(full_gem_path, require_path)
73
- end
74
- end
47
+ full_require_paths
75
48
  end
76
49
 
77
- if method_defined?(:extension_dir)
78
- alias_method :rg_extension_dir, :extension_dir
79
- def extension_dir
80
- @bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
81
- File.expand_path(File.join(extensions_dir, source.extension_dir_name))
82
- else
83
- rg_extension_dir
84
- end
50
+ alias_method :rg_extension_dir, :extension_dir
51
+ def extension_dir
52
+ @bundler_extension_dir ||= if source.respond_to?(:extension_dir_name)
53
+ unique_extension_dir = [source.extension_dir_name, File.basename(full_gem_path)].uniq.join("-")
54
+ File.expand_path(File.join(extensions_dir, unique_extension_dir))
55
+ else
56
+ rg_extension_dir
85
57
  end
86
58
  end
87
59
 
88
- # RubyGems 1.8+ used only.
89
- methods = instance_methods(false)
90
- gem_dir = methods.first.is_a?(String) ? "gem_dir" : :gem_dir
91
- remove_method :gem_dir if methods.include?(gem_dir)
60
+ remove_method :gem_dir if instance_methods(false).include?(:gem_dir)
92
61
  def gem_dir
93
62
  full_gem_path
94
63
  end
@@ -116,7 +85,11 @@ module Gem
116
85
  dependencies - development_dependencies
117
86
  end
118
87
 
119
- private
88
+ def deleted_gem?
89
+ !default_gem? && !File.directory?(full_gem_path)
90
+ end
91
+
92
+ private
120
93
 
121
94
  def dependencies_to_gemfile(dependencies, group = nil)
122
95
  gemfile = String.new
@@ -136,7 +109,7 @@ module Gem
136
109
  end
137
110
 
138
111
  class Dependency
139
- attr_accessor :source, :groups, :all_sources
112
+ attr_accessor :source, :groups
140
113
 
141
114
  alias_method :eql?, :==
142
115
 
@@ -147,7 +120,7 @@ module Gem
147
120
  end
148
121
 
149
122
  def to_yaml_properties
150
- instance_variables.reject {|p| ["@source", "@groups", "@all_sources"].include?(p.to_s) }
123
+ instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) }
151
124
  end
152
125
 
153
126
  def to_lock
@@ -158,48 +131,99 @@ module Gem
158
131
  end
159
132
  out
160
133
  end
134
+ end
161
135
 
162
- # Backport of performance enhancement added to RubyGems 1.4
163
- def matches_spec?(spec)
164
- # name can be a Regexp, so use ===
165
- return false unless name === spec.name
166
- return true if requirement.none?
136
+ # comparison is done order independently since rubygems 3.2.0.rc.2
137
+ unless Gem::Requirement.new("> 1", "< 2") == Gem::Requirement.new("< 2", "> 1")
138
+ class Requirement
139
+ module OrderIndependentComparison
140
+ def ==(other)
141
+ if _requirements_sorted? && other._requirements_sorted?
142
+ super
143
+ else
144
+ _with_sorted_requirements == other._with_sorted_requirements
145
+ end
146
+ end
147
+
148
+ protected
167
149
 
168
- requirement.satisfied_by?(spec.version)
169
- end unless allocate.respond_to?(:matches_spec?)
150
+ def _requirements_sorted?
151
+ return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
152
+ strings = as_list
153
+ @_are_requirements_sorted = strings == strings.sort
154
+ end
155
+
156
+ def _with_sorted_requirements
157
+ @_with_sorted_requirements ||= _requirements_sorted? ? self : self.class.new(as_list.sort)
158
+ end
159
+ end
160
+
161
+ prepend OrderIndependentComparison
162
+ end
170
163
  end
171
164
 
172
- class Requirement
173
- # Backport of performance enhancement added to RubyGems 1.4
174
- def none?
175
- # note that it might be tempting to replace with with RubyGems 2.0's
176
- # improved implementation. Don't. It requires `DefaultRequirement` to be
177
- # defined, and more importantantly, these overrides are not used when the
178
- # running RubyGems defines these methods
179
- to_s == ">= 0"
180
- end unless allocate.respond_to?(:none?)
181
-
182
- # Backport of performance enhancement added to RubyGems 2.2
183
- def exact?
184
- return false unless @requirements.size == 1
185
- @requirements[0][0] == "="
186
- end unless allocate.respond_to?(:exact?)
165
+ if Gem::Requirement.new("~> 2.0").hash == Gem::Requirement.new("~> 2.0.0").hash
166
+ class Requirement
167
+ module CorrectHashForLambdaOperator
168
+ def hash
169
+ if requirements.any? {|r| r.first == "~>" }
170
+ requirements.map {|r| r.first == "~>" ? [r[0], r[1].to_s] : r }.sort.hash
171
+ else
172
+ super
173
+ end
174
+ end
175
+ end
176
+
177
+ prepend CorrectHashForLambdaOperator
178
+ end
187
179
  end
188
180
 
181
+ require "rubygems/platform"
182
+
189
183
  class Platform
190
184
  JAVA = Gem::Platform.new("java") unless defined?(JAVA)
191
185
  MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
192
186
  MSWIN64 = Gem::Platform.new("mswin64") unless defined?(MSWIN64)
193
187
  MINGW = Gem::Platform.new("x86-mingw32") unless defined?(MINGW)
194
188
  X64_MINGW = Gem::Platform.new("x64-mingw32") unless defined?(X64_MINGW)
189
+ end
190
+
191
+ Platform.singleton_class.module_eval do
192
+ unless Platform.singleton_methods.include?(:match_spec?)
193
+ def match_spec?(spec)
194
+ match_gem?(spec.platform, spec.name)
195
+ end
196
+
197
+ def match_gem?(platform, gem_name)
198
+ match_platforms?(platform, Gem.platforms)
199
+ end
200
+
201
+ private
195
202
 
196
- undef_method :hash if method_defined? :hash
197
- def hash
198
- @cpu.hash ^ @os.hash ^ @version.hash
203
+ def match_platforms?(platform, platforms)
204
+ platforms.any? do |local_platform|
205
+ platform.nil? ||
206
+ local_platform == platform ||
207
+ (local_platform != Gem::Platform::RUBY && local_platform =~ platform)
208
+ end
209
+ end
199
210
  end
211
+ end
200
212
 
201
- undef_method :eql? if method_defined? :eql?
202
- alias_method :eql?, :==
213
+ require "rubygems/util"
214
+
215
+ Util.singleton_class.module_eval do
216
+ if Util.singleton_methods.include?(:glob_files_in_dir) # since 3.0.0.beta.2
217
+ remove_method :glob_files_in_dir
218
+ end
219
+
220
+ def glob_files_in_dir(glob, base_path)
221
+ if RUBY_VERSION >= "2.5"
222
+ Dir.glob(glob, :base => base_path).map! {|f| File.expand_path(f, base_path) }
223
+ else
224
+ Dir.glob(File.join(base_path.to_s.gsub(/[\[\]]/, '\\\\\\&'), glob)).map! {|f| File.expand_path(f) }
225
+ end
226
+ end
203
227
  end
204
228
  end
205
229
 
@@ -4,14 +4,60 @@ require "rubygems/installer"
4
4
 
5
5
  module Bundler
6
6
  class RubyGemsGemInstaller < Gem::Installer
7
- unless respond_to?(:at)
8
- def self.at(*args)
9
- new(*args)
7
+ def check_executable_overwrite(filename)
8
+ # Bundler needs to install gems regardless of binstub overwriting
9
+ end
10
+
11
+ def install
12
+ pre_install_checks
13
+
14
+ run_pre_install_hooks
15
+
16
+ spec.loaded_from = spec_file
17
+
18
+ # Completely remove any previous gem files
19
+ strict_rm_rf gem_dir
20
+ strict_rm_rf spec.extension_dir
21
+
22
+ SharedHelpers.filesystem_access(gem_dir, :create) do
23
+ FileUtils.mkdir_p gem_dir, :mode => 0o755
24
+ end
25
+
26
+ extract_files
27
+
28
+ build_extensions
29
+ write_build_info_file
30
+ run_post_build_hooks
31
+
32
+ generate_bin
33
+ generate_plugins
34
+
35
+ write_spec
36
+
37
+ SharedHelpers.filesystem_access("#{gem_home}/cache", :write) do
38
+ write_cache_file
10
39
  end
40
+
41
+ say spec.post_install_message unless spec.post_install_message.nil?
42
+
43
+ run_post_install_hooks
44
+
45
+ spec
11
46
  end
12
47
 
13
- def check_executable_overwrite(filename)
14
- # Bundler needs to install gems regardless of binstub overwriting
48
+ def generate_plugins
49
+ return unless Gem::Installer.instance_methods(false).include?(:generate_plugins)
50
+
51
+ latest = Gem::Specification.stubs_for(spec.name).first
52
+ return if latest && latest.version > spec.version
53
+
54
+ ensure_writable_dir @plugins_dir
55
+
56
+ if spec.plugins.empty?
57
+ remove_plugins_for(spec, @plugins_dir)
58
+ else
59
+ regenerate_plugins_for(spec, @plugins_dir)
60
+ end
15
61
  end
16
62
 
17
63
  def pre_install_checks
@@ -20,7 +66,10 @@ module Bundler
20
66
 
21
67
  def build_extensions
22
68
  extension_cache_path = options[:bundler_extension_cache_path]
23
- return super unless extension_cache_path && extension_dir = Bundler.rubygems.spec_extension_dir(spec)
69
+ unless extension_cache_path && extension_dir = spec.extension_dir
70
+ require "shellwords" # compensate missing require in rubygems before version 3.2.25
71
+ return super
72
+ end
24
73
 
25
74
  extension_dir = Pathname.new(extension_dir)
26
75
  build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
@@ -30,6 +79,7 @@ module Bundler
30
79
  FileUtils.cp_r extension_cache_path, spec.extension_dir
31
80
  end
32
81
  else
82
+ require "shellwords" # compensate missing require in rubygems before version 3.2.25
33
83
  super
34
84
  if extension_dir.directory? # not made for gems without extensions
35
85
  SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
@@ -40,7 +90,18 @@ module Bundler
40
90
  end
41
91
  end
42
92
 
43
- private
93
+ private
94
+
95
+ def strict_rm_rf(dir)
96
+ # FileUtils.rm_rf should probably rise in case of permission issues like
97
+ # `rm -rf` does. However, it fails to delete the folder silently due to
98
+ # https://github.com/ruby/fileutils/issues/57. It should probably be fixed
99
+ # inside `fileutils` but for now I`m checking whether the folder was
100
+ # removed after it completes, and raising otherwise.
101
+ FileUtils.rm_rf dir
102
+
103
+ raise PermissionError.new(dir, :delete) if File.directory?(dir)
104
+ end
44
105
 
45
106
  def validate_bundler_checksum(checksum)
46
107
  return true if Bundler.settings[:disable_checksum_validation]
@@ -66,7 +127,7 @@ module Bundler
66
127
 
67
128
  If you wish to continue installing the downloaded gem, and are certain it does not pose a \
68
129
  security issue despite the mismatching checksum, do the following:
69
- 1. run `bundle config disable_checksum_validation true` to turn off checksum verification
130
+ 1. run `bundle config set --local disable_checksum_validation true` to turn off checksum verification
70
131
  2. run `bundle install`
71
132
 
72
133
  (More info: The expected SHA256 checksum was #{checksum.inspect}, but the \