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
@@ -12,36 +12,23 @@ module Bundler
12
12
  def setup(*groups)
13
13
  @definition.ensure_equivalent_gemfile_and_lockfile if Bundler.frozen_bundle?
14
14
 
15
- groups.map!(&:to_sym)
16
-
17
15
  # Has to happen first
18
16
  clean_load_path
19
17
 
20
- specs = groups.any? ? @definition.specs_for(groups) : requested_specs
18
+ specs = @definition.specs_for(groups)
21
19
 
22
20
  SharedHelpers.set_bundle_environment
23
21
  Bundler.rubygems.replace_entrypoints(specs)
24
22
 
25
23
  # Activate the specs
26
24
  load_paths = specs.map do |spec|
27
- unless spec.loaded_from
28
- raise GemNotFound, "#{spec.full_name} is missing. Run `bundle install` to get it."
29
- end
30
-
31
25
  check_for_activated_spec!(spec)
32
26
 
33
27
  Bundler.rubygems.mark_loaded(spec)
34
28
  spec.load_paths.reject {|path| $LOAD_PATH.include?(path) }
35
29
  end.reverse.flatten
36
30
 
37
- # See Gem::Specification#add_self_to_load_path (since RubyGems 1.8)
38
- if insert_index = Bundler.rubygems.load_path_insert_index
39
- # Gem directories must come after -I and ENV['RUBYLIB']
40
- $LOAD_PATH.insert(insert_index, *load_paths)
41
- else
42
- # We are probably testing in core, -I and RUBYLIB don't apply
43
- $LOAD_PATH.unshift(*load_paths)
44
- end
31
+ Bundler.rubygems.add_to_load_path(load_paths)
45
32
 
46
33
  setup_manpath
47
34
 
@@ -50,14 +37,6 @@ module Bundler
50
37
  self
51
38
  end
52
39
 
53
- REQUIRE_ERRORS = [
54
- /^no such file to load -- (.+)$/i,
55
- /^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
56
- /^Missing API definition file in (.+)$/i,
57
- /^cannot load such file -- (.+)$/i,
58
- /^dlopen\([^)]*\): Library not loaded: (.+)$/i,
59
- ].freeze
60
-
61
40
  def require(*groups)
62
41
  groups.map!(&:to_sym)
63
42
  groups = [:default] if groups.empty?
@@ -86,16 +65,14 @@ module Bundler
86
65
  end
87
66
  end
88
67
  rescue LoadError => e
89
- REQUIRE_ERRORS.find {|r| r =~ e.message }
90
- raise if dep.autorequire || $1 != required_file
68
+ raise if dep.autorequire || e.path != required_file
91
69
 
92
70
  if dep.autorequire.nil? && dep.name.include?("-")
93
71
  begin
94
72
  namespaced_file = dep.name.tr("-", "/")
95
73
  Kernel.require namespaced_file
96
74
  rescue LoadError => e
97
- REQUIRE_ERRORS.find {|r| r =~ e.message }
98
- raise if $1 != namespaced_file
75
+ raise if e.path != namespaced_file
99
76
  end
100
77
  end
101
78
  end
@@ -123,7 +100,7 @@ module Bundler
123
100
 
124
101
  alias_method :gems, :specs
125
102
 
126
- def cache(custom_path = nil)
103
+ def cache(custom_path = nil, local = false)
127
104
  cache_path = Bundler.app_cache(custom_path)
128
105
  SharedHelpers.filesystem_access(cache_path) do |p|
129
106
  FileUtils.mkdir_p(p)
@@ -131,7 +108,20 @@ module Bundler
131
108
 
132
109
  Bundler.ui.info "Updating files in #{Bundler.settings.app_cache_path}"
133
110
 
134
- specs_to_cache = Bundler.settings[:cache_all_platforms] ? @definition.resolve.materialized_for_all_platforms : specs
111
+ specs_to_cache = if Bundler.settings[:cache_all_platforms]
112
+ @definition.resolve.materialized_for_all_platforms
113
+ else
114
+ begin
115
+ specs
116
+ rescue GemNotFound
117
+ if local
118
+ Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
119
+ end
120
+
121
+ raise
122
+ end
123
+ end
124
+
135
125
  specs_to_cache.each do |spec|
136
126
  next if spec.name == "bundler"
137
127
  next if spec.source.is_a?(Source::Gemspec)
@@ -163,7 +153,7 @@ module Bundler
163
153
  gem_dirs = Dir["#{Gem.dir}/gems/*"]
164
154
  gem_files = Dir["#{Gem.dir}/cache/*.gem"]
165
155
  gemspec_files = Dir["#{Gem.dir}/specifications/*.gemspec"]
166
- extension_dirs = Dir["#{Gem.dir}/extensions/*/*/*"]
156
+ extension_dirs = Dir["#{Gem.dir}/extensions/*/*/*"] + Dir["#{Gem.dir}/bundler/gems/extensions/*/*/*"]
167
157
  spec_gem_paths = []
168
158
  # need to keep git sources around
169
159
  spec_git_paths = @definition.spec_git_paths
@@ -172,7 +162,7 @@ module Bundler
172
162
  spec_cache_paths = []
173
163
  spec_gemspec_paths = []
174
164
  spec_extension_paths = []
175
- specs.each do |spec|
165
+ Bundler.rubygems.add_default_gems_to(specs).values.each do |spec|
176
166
  spec_gem_paths << spec.full_gem_path
177
167
  # need to check here in case gems are nested like for the rails git repo
178
168
  md = %r{(.+bundler/gems/.+-[a-f0-9]{7,12})}.match(spec.full_gem_path)
@@ -220,7 +210,7 @@ module Bundler
220
210
  output
221
211
  end
222
212
 
223
- private
213
+ private
224
214
 
225
215
  def prune_gem_cache(resolve, cache_path)
226
216
  cached = Dir["#{cache_path}/*.gem"]
@@ -275,7 +265,7 @@ module Bundler
275
265
 
276
266
  return if manuals.empty?
277
267
  Bundler::SharedHelpers.set_env "MANPATH", manuals.concat(
278
- ENV["MANPATH"].to_s.split(File::PATH_SEPARATOR)
268
+ ENV["MANPATH"] ? ENV["MANPATH"].to_s.split(File::PATH_SEPARATOR) : [""]
279
269
  ).uniq.join(File::PATH_SEPARATOR)
280
270
  end
281
271
 
@@ -301,7 +291,7 @@ module Bundler
301
291
  return unless activated_spec = Bundler.rubygems.loaded_specs(spec.name)
302
292
  return if activated_spec.version == spec.version
303
293
 
304
- suggestion = if Bundler.rubygems.spec_default_gem?(activated_spec)
294
+ suggestion = if activated_spec.default_gem?
305
295
  "Since #{spec.name} is a default gem, you can either remove your dependency on it" \
306
296
  " or try updating to a newer version of bundler that supports #{spec.name} as a default gem."
307
297
  else
@@ -1,64 +1,51 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "uri"
4
-
5
3
  module Bundler
6
4
  class Settings
7
- autoload :Mirror, "bundler/mirror"
8
- autoload :Mirrors, "bundler/mirror"
9
- autoload :Validator, "bundler/settings/validator"
5
+ autoload :Mirror, File.expand_path("mirror", __dir__)
6
+ autoload :Mirrors, File.expand_path("mirror", __dir__)
7
+ autoload :Validator, File.expand_path("settings/validator", __dir__)
10
8
 
11
9
  BOOL_KEYS = %w[
12
- allow_bundler_dependency_conflicts
13
10
  allow_deployment_source_credential_changes
14
11
  allow_offline_install
15
12
  auto_clean_without_path
16
13
  auto_install
17
- auto_config_jobs
18
14
  cache_all
19
15
  cache_all_platforms
20
- cache_command_is_package
21
- console_command
16
+ clean
22
17
  default_install_uses_path
23
18
  deployment
24
- deployment_means_frozen
25
19
  disable_checksum_validation
26
20
  disable_exec_load
27
21
  disable_local_branch_check
28
- disable_multisource
29
- disable_platform_warnings
22
+ disable_local_revision_check
30
23
  disable_shared_gems
31
24
  disable_version_check
32
- error_on_stderr
33
25
  force_ruby_platform
34
26
  forget_cli_options
35
27
  frozen
28
+ gem.changelog
36
29
  gem.coc
37
30
  gem.mit
38
- global_path_appends_ruby_scope
31
+ git.allow_insecure
39
32
  global_gem_cache
40
33
  ignore_messages
41
34
  init_gems_rb
42
- list_command
43
- lockfile_uses_separate_rubygems_sources
44
- major_deprecations
35
+ inline
45
36
  no_install
46
37
  no_prune
47
- only_update_to_newer_versions
48
38
  path_relative_to_cwd
49
39
  path.system
50
40
  plugins
51
- prefer_gems_rb
41
+ prefer_patch
52
42
  print_only_version_number
53
43
  setup_makes_kernel_gem_public
44
+ silence_deprecations
54
45
  silence_root_warning
55
- skip_default_git_sources
56
- specific_platform
57
46
  suppress_install_using_messages
58
- unlock_source_unlocks_spec
59
47
  update_requires_all_flag
60
48
  use_gem_version_promoter_for_major_updates
61
- viz_command
62
49
  ].freeze
63
50
 
64
51
  NUMBER_KEYS = %w[
@@ -74,29 +61,42 @@ module Bundler
74
61
  without
75
62
  ].freeze
76
63
 
64
+ STRING_KEYS = %w[
65
+ bin
66
+ cache_path
67
+ console
68
+ gem.ci
69
+ gem.github_username
70
+ gem.linter
71
+ gem.rubocop
72
+ gem.test
73
+ gemfile
74
+ path
75
+ shebang
76
+ system_bindir
77
+ trust-policy
78
+ ].freeze
79
+
77
80
  DEFAULT_CONFIG = {
78
- :disable_version_check => true,
79
- :redirect => 5,
80
- :retry => 3,
81
- :timeout => 10,
81
+ "BUNDLE_SILENCE_DEPRECATIONS" => false,
82
+ "BUNDLE_DISABLE_VERSION_CHECK" => true,
83
+ "BUNDLE_PREFER_PATCH" => false,
84
+ "BUNDLE_REDIRECT" => 5,
85
+ "BUNDLE_RETRY" => 3,
86
+ "BUNDLE_TIMEOUT" => 10,
82
87
  }.freeze
83
88
 
84
89
  def initialize(root = nil)
85
90
  @root = root
86
91
  @local_config = load_config(local_config_file)
92
+ @env_config = ENV.to_h.select {|key, _value| key =~ /\ABUNDLE_.+/ }
87
93
  @global_config = load_config(global_config_file)
88
94
  @temporary = {}
89
95
  end
90
96
 
91
97
  def [](name)
92
98
  key = key_for(name)
93
- value = @temporary.fetch(key) do
94
- @local_config.fetch(key) do
95
- ENV.fetch(key) do
96
- @global_config.fetch(key) do
97
- DEFAULT_CONFIG.fetch(name) do
98
- nil
99
- end end end end end
99
+ value = configs.values.map {|config| config[key] }.compact.first
100
100
 
101
101
  converted_value(value, name)
102
102
  end
@@ -106,18 +106,6 @@ module Bundler
106
106
  temporary(key => value)
107
107
  value
108
108
  else
109
- command = if value.nil?
110
- "bundle config --delete #{key}"
111
- else
112
- "bundle config #{key} #{Array(value).join(":")}"
113
- end
114
-
115
- Bundler::SharedHelpers.major_deprecation 2,\
116
- "flags passed to commands " \
117
- "will no longer be automatically remembered. Instead please set flags " \
118
- "you want remembered between commands using `bundle config " \
119
- "<setting name> <setting value>`, i.e. `#{command}`"
120
-
121
109
  set_local(key, value)
122
110
  end
123
111
  end
@@ -151,13 +139,11 @@ module Bundler
151
139
  end
152
140
 
153
141
  def all
154
- env_keys = ENV.keys.grep(/\ABUNDLE_.+/)
155
-
156
- keys = @temporary.keys | @global_config.keys | @local_config.keys | env_keys
142
+ keys = @temporary.keys | @global_config.keys | @local_config.keys | @env_config.keys
157
143
 
158
144
  keys.map do |key|
159
- key.sub(/^BUNDLE_/, "").gsub(/__/, ".").downcase
160
- end
145
+ key.sub(/^BUNDLE_/, "").gsub(/___/, "-").gsub(/__/, ".").downcase
146
+ end.sort
161
147
  end
162
148
 
163
149
  def local_overrides
@@ -169,7 +155,11 @@ module Bundler
169
155
  end
170
156
 
171
157
  def mirror_for(uri)
172
- uri = URI(uri.to_s) unless uri.is_a?(URI)
158
+ if uri.is_a?(String)
159
+ require_relative "vendored_uri"
160
+ uri = Bundler::URI(uri)
161
+ end
162
+
173
163
  gem_mirrors.for(uri.to_s).uri
174
164
  end
175
165
 
@@ -186,13 +176,11 @@ module Bundler
186
176
 
187
177
  def locations(key)
188
178
  key = key_for(key)
189
- locations = {}
190
- locations[:temporary] = @temporary[key] if @temporary.key?(key)
191
- locations[:local] = @local_config[key] if @local_config.key?(key)
192
- locations[:env] = ENV[key] if ENV[key]
193
- locations[:global] = @global_config[key] if @global_config.key?(key)
194
- locations[:default] = DEFAULT_CONFIG[key] if DEFAULT_CONFIG.key?(key)
195
- locations
179
+ configs.keys.inject({}) do |partial_locations, level|
180
+ value_on_level = configs[level][key]
181
+ partial_locations[level] = value_on_level unless value_on_level.nil?
182
+ partial_locations
183
+ end
196
184
  end
197
185
 
198
186
  def pretty_values_for(exposed_key)
@@ -200,50 +188,58 @@ module Bundler
200
188
 
201
189
  locations = []
202
190
 
203
- if @temporary.key?(key)
204
- locations << "Set for the current command: #{converted_value(@temporary[key], exposed_key).inspect}"
191
+ if value = @temporary[key]
192
+ locations << "Set for the current command: #{printable_value(value, exposed_key).inspect}"
205
193
  end
206
194
 
207
- if @local_config.key?(key)
208
- locations << "Set for your local app (#{local_config_file}): #{converted_value(@local_config[key], exposed_key).inspect}"
195
+ if value = @local_config[key]
196
+ locations << "Set for your local app (#{local_config_file}): #{printable_value(value, exposed_key).inspect}"
209
197
  end
210
198
 
211
- if value = ENV[key]
212
- locations << "Set via #{key}: #{converted_value(value, exposed_key).inspect}"
199
+ if value = @env_config[key]
200
+ locations << "Set via #{key}: #{printable_value(value, exposed_key).inspect}"
213
201
  end
214
202
 
215
- if @global_config.key?(key)
216
- locations << "Set for the current user (#{global_config_file}): #{converted_value(@global_config[key], exposed_key).inspect}"
203
+ if value = @global_config[key]
204
+ locations << "Set for the current user (#{global_config_file}): #{printable_value(value, exposed_key).inspect}"
217
205
  end
218
206
 
219
207
  return ["You have not configured a value for `#{exposed_key}`"] if locations.empty?
220
208
  locations
221
209
  end
222
210
 
223
- # for legacy reasons, in Bundler 1, the ruby scope isnt appended when the setting comes from ENV or the global config,
224
- # nor do we respect :disable_shared_gems
211
+ def processor_count
212
+ require "etc"
213
+ Etc.nprocessors
214
+ rescue StandardError
215
+ 1
216
+ end
217
+
218
+ # for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
225
219
  def path
226
- key = key_for(:path)
227
- path = ENV[key] || @global_config[key]
228
- if path && !@temporary.key?(key) && !@local_config.key?(key)
229
- return Path.new(path, Bundler.feature_flag.global_path_appends_ruby_scope?, false, false)
220
+ configs.each do |_level, settings|
221
+ path = value_for("path", settings)
222
+ path_system = value_for("path.system", settings)
223
+ disabled_shared_gems = value_for("disable_shared_gems", settings)
224
+ next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
225
+ system_path = path_system || (disabled_shared_gems == false)
226
+ return Path.new(path, system_path)
230
227
  end
231
228
 
232
- system_path = self["path.system"] || (self[:disable_shared_gems] == false)
233
- Path.new(self[:path], true, system_path, Bundler.feature_flag.default_install_uses_path?)
229
+ Path.new(nil, false)
234
230
  end
235
231
 
236
- Path = Struct.new(:explicit_path, :append_ruby_scope, :system_path, :default_install_uses_path) do
232
+ Path = Struct.new(:explicit_path, :system_path) do
237
233
  def path
238
234
  path = base_path
239
- path = File.join(path, Bundler.ruby_scope) if append_ruby_scope && !use_system_gems?
235
+ path = File.join(path, Bundler.ruby_scope) unless use_system_gems?
240
236
  path
241
237
  end
242
238
 
243
239
  def use_system_gems?
244
240
  return true if system_path
245
241
  return false if explicit_path
246
- !default_install_uses_path
242
+ !Bundler.feature_flag.default_install_uses_path?
247
243
  end
248
244
 
249
245
  def base_path
@@ -296,20 +292,32 @@ module Bundler
296
292
 
297
293
  def validate!
298
294
  all.each do |raw_key|
299
- [@local_config, ENV, @global_config].each do |settings|
300
- value = converted_value(settings[key_for(raw_key)], raw_key)
301
- Validator.validate!(raw_key, value, settings.to_hash.dup)
295
+ [@local_config, @env_config, @global_config].each do |settings|
296
+ value = value_for(raw_key, settings)
297
+ Validator.validate!(raw_key, value, settings.dup)
302
298
  end
303
299
  end
304
300
  end
305
301
 
306
302
  def key_for(key)
307
- key = Settings.normalize_uri(key).to_s if key.is_a?(String) && /https?:/ =~ key
308
- key = key.to_s.gsub(".", "__").upcase
309
- "BUNDLE_#{key}"
303
+ self.class.key_for(key)
310
304
  end
311
305
 
312
- private
306
+ private
307
+
308
+ def configs
309
+ {
310
+ :temporary => @temporary,
311
+ :local => @local_config,
312
+ :env => @env_config,
313
+ :global => @global_config,
314
+ :default => DEFAULT_CONFIG,
315
+ }
316
+ end
317
+
318
+ def value_for(name, config)
319
+ converted_value(config[key_for(name)], name)
320
+ end
313
321
 
314
322
  def parent_setting_for(name)
315
323
  split_specific_setting_for(name)[0]
@@ -327,6 +335,10 @@ module Bundler
327
335
  BOOL_KEYS.include?(name.to_s) || BOOL_KEYS.include?(parent_setting_for(name.to_s))
328
336
  end
329
337
 
338
+ def is_string(name)
339
+ STRING_KEYS.include?(name.to_s) || name.to_s.start_with?("local.") || name.to_s.start_with?("mirror.") || name.to_s.start_with?("build.")
340
+ end
341
+
330
342
  def to_bool(value)
331
343
  case value
332
344
  when nil, /\A(false|f|no|n|0|)\z/i, false
@@ -344,6 +356,14 @@ module Bundler
344
356
  ARRAY_KEYS.include?(key.to_s)
345
357
  end
346
358
 
359
+ def is_credential(key)
360
+ key == "gem.push_key"
361
+ end
362
+
363
+ def is_userinfo(value)
364
+ value.include?(":")
365
+ end
366
+
347
367
  def to_array(value)
348
368
  return [] unless value
349
369
  value.split(":").map(&:to_sym)
@@ -371,7 +391,7 @@ module Bundler
371
391
  return unless file
372
392
  SharedHelpers.filesystem_access(file) do |p|
373
393
  FileUtils.mkdir_p(p.dirname)
374
- require "bundler/yaml_serializer"
394
+ require_relative "yaml_serializer"
375
395
  p.open("w") {|f| f.write(YAMLSerializer.dump(hash)) }
376
396
  end
377
397
  end
@@ -390,15 +410,38 @@ module Bundler
390
410
  end
391
411
  end
392
412
 
413
+ def printable_value(value, key)
414
+ converted = converted_value(value, key)
415
+ return converted unless converted.is_a?(String)
416
+
417
+ if is_string(key)
418
+ converted
419
+ elsif is_credential(key)
420
+ "[REDACTED]"
421
+ elsif is_userinfo(converted)
422
+ username, pass = converted.split(":", 2)
423
+
424
+ if pass == "x-oauth-basic"
425
+ username = "[REDACTED]"
426
+ else
427
+ pass = "[REDACTED]"
428
+ end
429
+
430
+ [username, pass].join(":")
431
+ else
432
+ converted
433
+ end
434
+ end
435
+
393
436
  def global_config_file
394
437
  if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
395
438
  Pathname.new(ENV["BUNDLE_CONFIG"])
396
- else
397
- begin
398
- Bundler.user_bundle_path("config")
399
- rescue PermissionError, GenericSystemCallError
400
- nil
401
- end
439
+ elsif ENV["BUNDLE_USER_CONFIG"] && !ENV["BUNDLE_USER_CONFIG"].empty?
440
+ Pathname.new(ENV["BUNDLE_USER_CONFIG"])
441
+ elsif ENV["BUNDLE_USER_HOME"] && !ENV["BUNDLE_USER_HOME"].empty?
442
+ Pathname.new(ENV["BUNDLE_USER_HOME"]).join("config")
443
+ elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty?
444
+ Pathname.new(Bundler.rubygems.user_home).join(".bundle/config")
402
445
  end
403
446
  end
404
447
 
@@ -406,27 +449,26 @@ module Bundler
406
449
  Pathname.new(@root).join("config") if @root
407
450
  end
408
451
 
409
- CONFIG_REGEX = %r{ # rubocop:disable Style/RegexpLiteral
410
- ^
411
- (BUNDLE_.+):\s # the key
412
- (?: !\s)? # optional exclamation mark found with ruby 1.9.3
413
- (['"]?) # optional opening quote
414
- (.* # contents of the value
415
- (?: # optionally, up until the next key
416
- (\n(?!BUNDLE).+)*
417
- )
418
- )
419
- \2 # matching closing quote
420
- $
421
- }xo
422
-
423
452
  def load_config(config_file)
424
453
  return {} if !config_file || ignore_config?
425
454
  SharedHelpers.filesystem_access(config_file, :read) do |file|
426
455
  valid_file = file.exist? && !file.size.zero?
427
456
  return {} unless valid_file
428
- require "bundler/yaml_serializer"
429
- YAMLSerializer.load file.read
457
+ require_relative "yaml_serializer"
458
+ YAMLSerializer.load(file.read).inject({}) do |config, (k, v)|
459
+ new_k = k
460
+
461
+ if k.include?("-")
462
+ Bundler.ui.warn "Your #{file} config includes `#{k}`, which contains the dash character (`-`).\n" \
463
+ "This is deprecated, because configuration through `ENV` should be possible, but `ENV` keys cannot include dashes.\n" \
464
+ "Please edit #{file} and replace any dashes in configuration keys with a triple underscore (`___`)."
465
+
466
+ new_k = k.gsub("-", "___")
467
+ end
468
+
469
+ config[new_k] = v
470
+ config
471
+ end
430
472
  end
431
473
  end
432
474
 
@@ -441,7 +483,13 @@ module Bundler
441
483
  (https?.*?) # URI
442
484
  (\.#{Regexp.union(PER_URI_OPTIONS)})? # optional suffix key
443
485
  \z
444
- /ix
486
+ /ix.freeze
487
+
488
+ def self.key_for(key)
489
+ key = normalize_uri(key).to_s if key.is_a?(String) && /https?:/ =~ key
490
+ key = key.to_s.gsub(".", "__").gsub("-", "___").upcase
491
+ "BUNDLE_#{key}"
492
+ end
445
493
 
446
494
  # TODO: duplicates Rubygems#normalize_uri
447
495
  # TODO: is this the correct place to validate mirror URIs?
@@ -453,7 +501,8 @@ module Bundler
453
501
  suffix = $3
454
502
  end
455
503
  uri = "#{uri}/" unless uri.end_with?("/")
456
- uri = URI(uri)
504
+ require_relative "vendored_uri"
505
+ uri = Bundler::URI(uri)
457
506
  unless uri.absolute?
458
507
  raise ArgumentError, format("Gem sources must be absolute. You provided '%s'.", uri)
459
508
  end
data/lib/bundler/setup.rb CHANGED
@@ -1,28 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/shared_helpers"
3
+ require_relative "shared_helpers"
4
4
 
5
5
  if Bundler::SharedHelpers.in_bundle?
6
- require "bundler"
6
+ require_relative "../bundler"
7
7
 
8
8
  if STDOUT.tty? || ENV["BUNDLER_FORCE_TTY"]
9
9
  begin
10
- Bundler.setup
10
+ Bundler.ui.silence { Bundler.setup }
11
11
  rescue Bundler::BundlerError => e
12
- puts "\e[31m#{e.message}\e[0m"
13
- puts e.backtrace.join("\n") if ENV["DEBUG"]
12
+ Bundler.ui.error e.message
13
+ Bundler.ui.warn e.backtrace.join("\n") if ENV["DEBUG"]
14
14
  if e.is_a?(Bundler::GemNotFound)
15
- puts "\e[33mRun `bundle install` to install missing gems.\e[0m"
15
+ Bundler.ui.warn "Run `bundle install` to install missing gems."
16
16
  end
17
17
  exit e.status_code
18
18
  end
19
19
  else
20
- Bundler.setup
20
+ Bundler.ui.silence { Bundler.setup }
21
21
  end
22
22
 
23
- # Add bundler to the load path after disabling system gems
24
- bundler_lib = File.expand_path("../..", __FILE__)
25
- $LOAD_PATH.unshift(bundler_lib) unless $LOAD_PATH.include?(bundler_lib)
26
-
27
- Bundler.ui = nil
23
+ # We might be in the middle of shelling out to rubygems
24
+ # (RUBYOPT=-rbundler/setup), so we need to give rubygems the opportunity of
25
+ # not being silent.
26
+ Gem::DefaultUserInteraction.ui = nil
28
27
  end