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
data/lib/bundler.rb CHANGED
@@ -1,65 +1,81 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/compatibility_guard"
4
-
5
- require "bundler/vendored_fileutils"
3
+ require_relative "bundler/vendored_fileutils"
6
4
  require "pathname"
7
5
  require "rbconfig"
8
- require "thread"
9
-
10
- require "bundler/errors"
11
- require "bundler/environment_preserver"
12
- require "bundler/plugin"
13
- require "bundler/rubygems_ext"
14
- require "bundler/rubygems_integration"
15
- require "bundler/version"
16
- require "bundler/constants"
17
- require "bundler/current_ruby"
18
- require "bundler/build_metadata"
19
6
 
7
+ require_relative "bundler/errors"
8
+ require_relative "bundler/environment_preserver"
9
+ require_relative "bundler/plugin"
10
+ require_relative "bundler/rubygems_ext"
11
+ require_relative "bundler/rubygems_integration"
12
+ require_relative "bundler/version"
13
+ require_relative "bundler/constants"
14
+ require_relative "bundler/current_ruby"
15
+ require_relative "bundler/build_metadata"
16
+
17
+ # Bundler provides a consistent environment for Ruby projects by
18
+ # tracking and installing the exact gems and versions that are needed.
19
+ #
20
+ # Since Ruby 2.6, Bundler is a part of Ruby's standard library.
21
+ #
22
+ # Bunder is used by creating _gemfiles_ listing all the project dependencies
23
+ # and (optionally) their versions and then using
24
+ #
25
+ # require 'bundler/setup'
26
+ #
27
+ # or Bundler.setup to setup environment where only specified gems and their
28
+ # specified versions could be used.
29
+ #
30
+ # See {Bundler website}[https://bundler.io/docs.html] for extensive documentation
31
+ # on gemfiles creation and Bundler usage.
32
+ #
33
+ # As a standard library inside project, Bundler could be used for introspection
34
+ # of loaded and required modules.
35
+ #
20
36
  module Bundler
21
- environment_preserver = EnvironmentPreserver.new(ENV, EnvironmentPreserver::BUNDLER_KEYS)
37
+ environment_preserver = EnvironmentPreserver.from_env
22
38
  ORIGINAL_ENV = environment_preserver.restore
23
- ENV.replace(environment_preserver.backup)
24
- SUDO_MUTEX = Mutex.new
25
-
26
- autoload :Definition, "bundler/definition"
27
- autoload :Dependency, "bundler/dependency"
28
- autoload :DepProxy, "bundler/dep_proxy"
29
- autoload :Deprecate, "bundler/deprecate"
30
- autoload :Dsl, "bundler/dsl"
31
- autoload :EndpointSpecification, "bundler/endpoint_specification"
32
- autoload :Env, "bundler/env"
33
- autoload :Fetcher, "bundler/fetcher"
34
- autoload :FeatureFlag, "bundler/feature_flag"
35
- autoload :GemHelper, "bundler/gem_helper"
36
- autoload :GemHelpers, "bundler/gem_helpers"
37
- autoload :GemRemoteFetcher, "bundler/gem_remote_fetcher"
38
- autoload :GemVersionPromoter, "bundler/gem_version_promoter"
39
- autoload :Graph, "bundler/graph"
40
- autoload :Index, "bundler/index"
41
- autoload :Injector, "bundler/injector"
42
- autoload :Installer, "bundler/installer"
43
- autoload :LazySpecification, "bundler/lazy_specification"
44
- autoload :LockfileParser, "bundler/lockfile_parser"
45
- autoload :MatchPlatform, "bundler/match_platform"
46
- autoload :ProcessLock, "bundler/process_lock"
47
- autoload :RemoteSpecification, "bundler/remote_specification"
48
- autoload :Resolver, "bundler/resolver"
49
- autoload :Retry, "bundler/retry"
50
- autoload :RubyDsl, "bundler/ruby_dsl"
51
- autoload :RubyGemsGemInstaller, "bundler/rubygems_gem_installer"
52
- autoload :RubyVersion, "bundler/ruby_version"
53
- autoload :Runtime, "bundler/runtime"
54
- autoload :Settings, "bundler/settings"
55
- autoload :SharedHelpers, "bundler/shared_helpers"
56
- autoload :Source, "bundler/source"
57
- autoload :SourceList, "bundler/source_list"
58
- autoload :SpecSet, "bundler/spec_set"
59
- autoload :StubSpecification, "bundler/stub_specification"
60
- autoload :UI, "bundler/ui"
61
- autoload :URICredentialsFilter, "bundler/uri_credentials_filter"
62
- autoload :VersionRanges, "bundler/version_ranges"
39
+ environment_preserver.replace_with_backup
40
+ SUDO_MUTEX = Thread::Mutex.new
41
+
42
+ autoload :Definition, File.expand_path("bundler/definition", __dir__)
43
+ autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
44
+ autoload :DepProxy, File.expand_path("bundler/dep_proxy", __dir__)
45
+ autoload :Deprecate, File.expand_path("bundler/deprecate", __dir__)
46
+ autoload :Digest, File.expand_path("bundler/digest", __dir__)
47
+ autoload :Dsl, File.expand_path("bundler/dsl", __dir__)
48
+ autoload :EndpointSpecification, File.expand_path("bundler/endpoint_specification", __dir__)
49
+ autoload :Env, File.expand_path("bundler/env", __dir__)
50
+ autoload :Fetcher, File.expand_path("bundler/fetcher", __dir__)
51
+ autoload :FeatureFlag, File.expand_path("bundler/feature_flag", __dir__)
52
+ autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
53
+ autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
54
+ autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
55
+ autoload :Graph, File.expand_path("bundler/graph", __dir__)
56
+ autoload :Index, File.expand_path("bundler/index", __dir__)
57
+ autoload :Injector, File.expand_path("bundler/injector", __dir__)
58
+ autoload :Installer, File.expand_path("bundler/installer", __dir__)
59
+ autoload :LazySpecification, File.expand_path("bundler/lazy_specification", __dir__)
60
+ autoload :LockfileParser, File.expand_path("bundler/lockfile_parser", __dir__)
61
+ autoload :MatchPlatform, File.expand_path("bundler/match_platform", __dir__)
62
+ autoload :ProcessLock, File.expand_path("bundler/process_lock", __dir__)
63
+ autoload :RemoteSpecification, File.expand_path("bundler/remote_specification", __dir__)
64
+ autoload :Resolver, File.expand_path("bundler/resolver", __dir__)
65
+ autoload :Retry, File.expand_path("bundler/retry", __dir__)
66
+ autoload :RubyDsl, File.expand_path("bundler/ruby_dsl", __dir__)
67
+ autoload :RubyVersion, File.expand_path("bundler/ruby_version", __dir__)
68
+ autoload :Runtime, File.expand_path("bundler/runtime", __dir__)
69
+ autoload :Settings, File.expand_path("bundler/settings", __dir__)
70
+ autoload :SharedHelpers, File.expand_path("bundler/shared_helpers", __dir__)
71
+ autoload :Source, File.expand_path("bundler/source", __dir__)
72
+ autoload :SourceList, File.expand_path("bundler/source_list", __dir__)
73
+ autoload :SourceMap, File.expand_path("bundler/source_map", __dir__)
74
+ autoload :SpecSet, File.expand_path("bundler/spec_set", __dir__)
75
+ autoload :StubSpecification, File.expand_path("bundler/stub_specification", __dir__)
76
+ autoload :UI, File.expand_path("bundler/ui", __dir__)
77
+ autoload :URICredentialsFilter, File.expand_path("bundler/uri_credentials_filter", __dir__)
78
+ autoload :VersionRanges, File.expand_path("bundler/version_ranges", __dir__)
63
79
 
64
80
  class << self
65
81
  def configure
@@ -67,11 +83,11 @@ module Bundler
67
83
  end
68
84
 
69
85
  def ui
70
- (defined?(@ui) && @ui) || (self.ui = UI::Silent.new)
86
+ (defined?(@ui) && @ui) || (self.ui = UI::Shell.new)
71
87
  end
72
88
 
73
89
  def ui=(ui)
74
- Bundler.rubygems.ui = ui ? UI::RGProxy.new(ui) : nil
90
+ Bundler.rubygems.ui = UI::RGProxy.new(ui)
75
91
  @ui = ui
76
92
  end
77
93
 
@@ -94,6 +110,33 @@ module Bundler
94
110
  end
95
111
  end
96
112
 
113
+ # Turns on the Bundler runtime. After +Bundler.setup+ call, all +load+ or
114
+ # +require+ of the gems would be allowed only if they are part of
115
+ # the Gemfile or Ruby's standard library. If the versions specified
116
+ # in Gemfile, only those versions would be loaded.
117
+ #
118
+ # Assuming Gemfile
119
+ #
120
+ # gem 'first_gem', '= 1.0'
121
+ # group :test do
122
+ # gem 'second_gem', '= 1.0'
123
+ # end
124
+ #
125
+ # The code using Bundler.setup works as follows:
126
+ #
127
+ # require 'third_gem' # allowed, required from global gems
128
+ # require 'first_gem' # allowed, loads the last installed version
129
+ # Bundler.setup
130
+ # require 'fourth_gem' # fails with LoadError
131
+ # require 'second_gem' # loads exactly version 1.0
132
+ #
133
+ # +Bundler.setup+ can be called only once, all subsequent calls are no-op.
134
+ #
135
+ # If _groups_ list is provided, only gems from specified groups would
136
+ # be allowed (gems specified outside groups belong to special +:default+ group).
137
+ #
138
+ # To require all gems from Gemfile (or only some groups), see Bundler.require.
139
+ #
97
140
  def setup(*groups)
98
141
  # Return if all groups are already loaded
99
142
  return @setup if defined?(@setup) && @setup
@@ -110,6 +153,24 @@ module Bundler
110
153
  end
111
154
  end
112
155
 
156
+ # Setups Bundler environment (see Bundler.setup) if it is not already set,
157
+ # and loads all gems from groups specified. Unlike ::setup, can be called
158
+ # multiple times with different groups (if they were allowed by setup).
159
+ #
160
+ # Assuming Gemfile
161
+ #
162
+ # gem 'first_gem', '= 1.0'
163
+ # group :test do
164
+ # gem 'second_gem', '= 1.0'
165
+ # end
166
+ #
167
+ # The code will work as follows:
168
+ #
169
+ # Bundler.setup # allow all groups
170
+ # Bundler.require(:default) # requires only first_gem
171
+ # # ...later
172
+ # Bundler.require(:test) # requires second_gem
173
+ #
113
174
  def require(*groups)
114
175
  setup(*groups).require(*groups)
115
176
  end
@@ -119,7 +180,7 @@ module Bundler
119
180
  end
120
181
 
121
182
  def environment
122
- SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load"
183
+ SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load", :print_caller_location => true
123
184
  load
124
185
  end
125
186
 
@@ -138,7 +199,7 @@ module Bundler
138
199
 
139
200
  def frozen_bundle?
140
201
  frozen = settings[:deployment]
141
- frozen ||= settings[:frozen] unless feature_flag.deployment_means_frozen?
202
+ frozen ||= settings[:frozen]
142
203
  frozen
143
204
  end
144
205
 
@@ -152,8 +213,14 @@ module Bundler
152
213
  end
153
214
  end
154
215
 
216
+ def most_specific_locked_platform?(platform)
217
+ return false unless defined?(@definition) && @definition
218
+
219
+ definition.most_specific_locked_platform == platform
220
+ end
221
+
155
222
  def ruby_scope
156
- "#{Bundler.rubygems.ruby_engine}/#{Bundler.rubygems.config_map[:ruby_version]}"
223
+ "#{Bundler.rubygems.ruby_engine}/#{RbConfig::CONFIG["ruby_version"]}"
157
224
  end
158
225
 
159
226
  def user_home
@@ -170,9 +237,9 @@ module Bundler
170
237
  end
171
238
 
172
239
  if warning
173
- Kernel.send(:require, "etc")
174
- user_home = tmp_home_path(Etc.getlogin, warning)
175
- Bundler.ui.warn "#{warning}\nBundler will use `#{user_home}' as your home directory temporarily.\n"
240
+ Bundler.ui.warn "#{warning}\n"
241
+ user_home = tmp_home_path
242
+ Bundler.ui.warn "Bundler will use `#{user_home}' as your home directory temporarily.\n"
176
243
  user_home
177
244
  else
178
245
  Pathname.new(home)
@@ -180,37 +247,22 @@ module Bundler
180
247
  end
181
248
  end
182
249
 
183
- def tmp_home_path(login, warning)
184
- login ||= "unknown"
185
- Kernel.send(:require, "tmpdir")
186
- path = Pathname.new(Dir.tmpdir).join("bundler", "home")
187
- SharedHelpers.filesystem_access(path) do |tmp_home_path|
188
- unless tmp_home_path.exist?
189
- tmp_home_path.mkpath
190
- tmp_home_path.chmod(0o777)
191
- end
192
- tmp_home_path.join(login).tap(&:mkpath)
193
- end
194
- rescue RuntimeError => e
195
- raise e.exception("#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}")
196
- end
197
-
198
250
  def user_bundle_path(dir = "home")
199
251
  env_var, fallback = case dir
200
252
  when "home"
201
- ["BUNDLE_USER_HOME", Pathname.new(user_home).join(".bundle")]
253
+ ["BUNDLE_USER_HOME", proc { Pathname.new(user_home).join(".bundle") }]
202
254
  when "cache"
203
- ["BUNDLE_USER_CACHE", user_bundle_path.join("cache")]
255
+ ["BUNDLE_USER_CACHE", proc { user_bundle_path.join("cache") }]
204
256
  when "config"
205
- ["BUNDLE_USER_CONFIG", user_bundle_path.join("config")]
257
+ ["BUNDLE_USER_CONFIG", proc { user_bundle_path.join("config") }]
206
258
  when "plugin"
207
- ["BUNDLE_USER_PLUGIN", user_bundle_path.join("plugin")]
259
+ ["BUNDLE_USER_PLUGIN", proc { user_bundle_path.join("plugin") }]
208
260
  else
209
261
  raise BundlerError, "Unknown user path requested: #{dir}"
210
262
  end
211
263
  # `fallback` will already be a Pathname, but Pathname.new() is
212
264
  # idempotent so it's OK
213
- Pathname.new(ENV.fetch(env_var, fallback))
265
+ Pathname.new(ENV.fetch(env_var, &fallback))
214
266
  end
215
267
 
216
268
  def user_cache
@@ -241,7 +293,13 @@ module Bundler
241
293
 
242
294
  def app_config_path
243
295
  if app_config = ENV["BUNDLE_APP_CONFIG"]
244
- Pathname.new(app_config).expand_path(root)
296
+ app_config_pathname = Pathname.new(app_config)
297
+
298
+ if app_config_pathname.absolute?
299
+ app_config_pathname
300
+ else
301
+ app_config_pathname.expand_path(root)
302
+ end
245
303
  else
246
304
  root.join(".bundle")
247
305
  end
@@ -263,7 +321,7 @@ module Bundler
263
321
  message = <<EOF
264
322
  It is a security vulnerability to allow your home directory to be world-writable, and bundler can not continue.
265
323
  You should probably consider fixing this issue by running `chmod o-w ~` on *nix.
266
- Please refer to http://ruby-doc.org/stdlib-2.1.2/libdoc/fileutils/rdoc/FileUtils.html#method-c-remove_entry_secure for details.
324
+ Please refer to https://ruby-doc.org/stdlib-2.1.2/libdoc/fileutils/rdoc/FileUtils.html#method-c-remove_entry_secure for details.
267
325
  EOF
268
326
  File.world_writable?(path) ? Bundler.ui.warn(message) : raise
269
327
  raise PathError, "Please fix the world-writable issue with your #{path} directory"
@@ -280,10 +338,20 @@ EOF
280
338
  ORIGINAL_ENV.clone
281
339
  end
282
340
 
283
- # @deprecated Use `original_env` instead
284
- # @return [Hash] Environment with all bundler-related variables removed
341
+ # @deprecated Use `unbundled_env` instead
285
342
  def clean_env
286
- Bundler::SharedHelpers.major_deprecation(2, "`Bundler.clean_env` has weird edge cases, use `.original_env` instead")
343
+ Bundler::SharedHelpers.major_deprecation(
344
+ 2,
345
+ "`Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
346
+ "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`",
347
+ :print_caller_location => true
348
+ )
349
+
350
+ unbundled_env
351
+ end
352
+
353
+ # @return [Hash] Environment with all bundler-related variables removed
354
+ def unbundled_env
287
355
  env = original_env
288
356
 
289
357
  if env.key?("BUNDLER_ORIG_MANPATH")
@@ -293,7 +361,10 @@ EOF
293
361
  env.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
294
362
 
295
363
  if env.key?("RUBYOPT")
296
- env["RUBYOPT"] = env["RUBYOPT"].sub "-rbundler/setup", ""
364
+ rubyopt = env["RUBYOPT"].split(" ")
365
+ rubyopt.delete("-r#{File.expand_path("bundler/setup", __dir__)}")
366
+ rubyopt.delete("-rbundler/setup")
367
+ env["RUBYOPT"] = rubyopt.join(" ")
297
368
  end
298
369
 
299
370
  if env.key?("RUBYLIB")
@@ -305,24 +376,74 @@ EOF
305
376
  env
306
377
  end
307
378
 
379
+ # Run block with environment present before Bundler was activated
308
380
  def with_original_env
309
381
  with_env(original_env) { yield }
310
382
  end
311
383
 
384
+ # @deprecated Use `with_unbundled_env` instead
312
385
  def with_clean_env
313
- with_env(clean_env) { yield }
386
+ Bundler::SharedHelpers.major_deprecation(
387
+ 2,
388
+ "`Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
389
+ "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`",
390
+ :print_caller_location => true
391
+ )
392
+
393
+ with_env(unbundled_env) { yield }
394
+ end
395
+
396
+ # Run block with all bundler-related variables removed
397
+ def with_unbundled_env
398
+ with_env(unbundled_env) { yield }
399
+ end
400
+
401
+ # Run subcommand with the environment present before Bundler was activated
402
+ def original_system(*args)
403
+ with_original_env { Kernel.system(*args) }
314
404
  end
315
405
 
406
+ # @deprecated Use `unbundled_system` instead
316
407
  def clean_system(*args)
317
- with_clean_env { Kernel.system(*args) }
408
+ Bundler::SharedHelpers.major_deprecation(
409
+ 2,
410
+ "`Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. " \
411
+ "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`",
412
+ :print_caller_location => true
413
+ )
414
+
415
+ with_env(unbundled_env) { Kernel.system(*args) }
416
+ end
417
+
418
+ # Run subcommand in an environment with all bundler related variables removed
419
+ def unbundled_system(*args)
420
+ with_unbundled_env { Kernel.system(*args) }
421
+ end
422
+
423
+ # Run a `Kernel.exec` to a subcommand with the environment present before Bundler was activated
424
+ def original_exec(*args)
425
+ with_original_env { Kernel.exec(*args) }
318
426
  end
319
427
 
428
+ # @deprecated Use `unbundled_exec` instead
320
429
  def clean_exec(*args)
321
- with_clean_env { Kernel.exec(*args) }
430
+ Bundler::SharedHelpers.major_deprecation(
431
+ 2,
432
+ "`Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. " \
433
+ "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`",
434
+ :print_caller_location => true
435
+ )
436
+
437
+ with_env(unbundled_env) { Kernel.exec(*args) }
438
+ end
439
+
440
+ # Run a `Kernel.exec` to a subcommand in an environment with all bundler related variables removed
441
+ def unbundled_exec(*args)
442
+ with_env(unbundled_env) { Kernel.exec(*args) }
322
443
  end
323
444
 
324
445
  def local_platform
325
- return Gem::Platform::RUBY if settings[:force_ruby_platform]
446
+ return Gem::Platform::RUBY if settings[:force_ruby_platform] || Gem.platforms == [Gem::Platform::RUBY]
326
447
  Gem::Platform.local
327
448
  end
328
449
 
@@ -343,10 +464,14 @@ EOF
343
464
  # system binaries. If you put '-n foo' in your .gemrc, RubyGems will
344
465
  # install binstubs there instead. Unfortunately, RubyGems doesn't expose
345
466
  # that directory at all, so rather than parse .gemrc ourselves, we allow
346
- # the directory to be set as well, via `bundle config bindir foo`.
467
+ # the directory to be set as well, via `bundle config set --local bindir foo`.
347
468
  Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
348
469
  end
349
470
 
471
+ def preferred_gemfile_name
472
+ Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile"
473
+ end
474
+
350
475
  def use_system_gems?
351
476
  configured_bundle_path.use_system_gems?
352
477
  end
@@ -408,7 +533,8 @@ EOF
408
533
  Your user account isn't allowed to install to the system RubyGems.
409
534
  You can cancel this installation and run:
410
535
 
411
- bundle install --path vendor/bundle
536
+ bundle config set --local path 'vendor/bundle'
537
+ bundle install
412
538
 
413
539
  to install the gems into ./vendor/bundle/, or you can enter your password
414
540
  and install the bundled gems to RubyGems using sudo.
@@ -484,6 +610,11 @@ EOF
484
610
  reset_rubygems!
485
611
  end
486
612
 
613
+ def reset_settings_and_root!
614
+ @settings = nil
615
+ @root = nil
616
+ end
617
+
487
618
  def reset_paths!
488
619
  @bin_path = nil
489
620
  @bundler_major_version = nil
@@ -506,10 +637,16 @@ EOF
506
637
  @rubygems = nil
507
638
  end
508
639
 
509
- private
640
+ def configure_gem_home_and_path(path = bundle_path)
641
+ configure_gem_path
642
+ configure_gem_home(path)
643
+ Bundler.rubygems.clear_paths
644
+ end
645
+
646
+ private
510
647
 
511
648
  def eval_yaml_gemspec(path, contents)
512
- Kernel.send(:require, "bundler/psyched_yaml")
649
+ require_relative "bundler/psyched_yaml"
513
650
 
514
651
  # If the YAML is invalid, Syck raises an ArgumentError, and Psych
515
652
  # raises a Psych::SyntaxError. See psyched_yaml.rb for more info.
@@ -523,36 +660,29 @@ EOF
523
660
  rescue ScriptError, StandardError => e
524
661
  msg = "There was an error while loading `#{path.basename}`: #{e.message}"
525
662
 
526
- if e.is_a?(LoadError) && RUBY_VERSION >= "1.9"
527
- msg += "\nDoes it try to require a relative path? That's been removed in Ruby 1.9"
528
- end
529
-
530
663
  raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents)
531
664
  end
532
665
 
533
- def configure_gem_home_and_path
534
- configure_gem_path
535
- configure_gem_home
536
- bundle_path
537
- end
538
-
539
- def configure_gem_path(env = ENV)
540
- blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
541
- if !use_system_gems?
666
+ def configure_gem_path
667
+ unless use_system_gems?
542
668
  # this needs to be empty string to cause
543
669
  # PathSupport.split_gem_path to only load up the
544
670
  # Bundler --path setting as the GEM_PATH.
545
- env["GEM_PATH"] = ""
546
- elsif blank_home
547
- possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
548
- paths = possibles.flatten.compact.uniq.reject(&:empty?)
549
- env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
671
+ Bundler::SharedHelpers.set_env "GEM_PATH", ""
550
672
  end
551
673
  end
552
674
 
553
- def configure_gem_home
554
- Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root)
555
- Bundler.rubygems.clear_paths
675
+ def configure_gem_home(path)
676
+ Bundler::SharedHelpers.set_env "GEM_HOME", path.to_s
677
+ end
678
+
679
+ def tmp_home_path
680
+ Kernel.send(:require, "tmpdir")
681
+ SharedHelpers.filesystem_access(Dir.tmpdir) do
682
+ path = Bundler.tmp
683
+ at_exit { Bundler.rm_rf(path) }
684
+ path
685
+ end
556
686
  end
557
687
 
558
688
  # @param env [Hash]