bundler 1.11.1 → 2.2.6

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

Potentially problematic release.


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

Files changed (328) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +2125 -840
  3. data/LICENSE.md +18 -19
  4. data/README.md +33 -11
  5. data/bundler.gemspec +34 -21
  6. data/exe/bundle +36 -6
  7. data/exe/bundler +2 -18
  8. data/lib/bundler.rb +435 -160
  9. data/lib/bundler/build_metadata.rb +45 -0
  10. data/lib/bundler/capistrano.rb +9 -3
  11. data/lib/bundler/cli.rb +550 -130
  12. data/lib/bundler/cli/add.rb +47 -0
  13. data/lib/bundler/cli/binstubs.rb +26 -10
  14. data/lib/bundler/cli/cache.rb +25 -17
  15. data/lib/bundler/cli/check.rb +8 -7
  16. data/lib/bundler/cli/clean.rb +8 -8
  17. data/lib/bundler/cli/common.rb +69 -9
  18. data/lib/bundler/cli/config.rb +170 -76
  19. data/lib/bundler/cli/console.rb +6 -1
  20. data/lib/bundler/cli/doctor.rb +140 -0
  21. data/lib/bundler/cli/exec.rb +63 -21
  22. data/lib/bundler/cli/fund.rb +36 -0
  23. data/lib/bundler/cli/gem.rb +158 -42
  24. data/lib/bundler/cli/info.rb +73 -0
  25. data/lib/bundler/cli/init.rb +22 -7
  26. data/lib/bundler/cli/inject.rb +38 -10
  27. data/lib/bundler/cli/install.rb +139 -104
  28. data/lib/bundler/cli/issue.rb +40 -0
  29. data/lib/bundler/cli/list.rb +60 -0
  30. data/lib/bundler/cli/lock.rb +27 -5
  31. data/lib/bundler/cli/open.rb +13 -5
  32. data/lib/bundler/cli/outdated.rb +251 -46
  33. data/lib/bundler/cli/platform.rb +6 -2
  34. data/lib/bundler/cli/plugin.rb +41 -0
  35. data/lib/bundler/cli/pristine.rb +52 -0
  36. data/lib/bundler/cli/remove.rb +18 -0
  37. data/lib/bundler/cli/show.rb +5 -4
  38. data/lib/bundler/cli/update.rb +67 -26
  39. data/lib/bundler/cli/viz.rb +11 -6
  40. data/lib/bundler/compact_index_client.rb +125 -0
  41. data/lib/bundler/compact_index_client/cache.rb +110 -0
  42. data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  43. data/lib/bundler/compact_index_client/updater.rb +104 -0
  44. data/lib/bundler/constants.rb +2 -0
  45. data/lib/bundler/current_ruby.rb +51 -174
  46. data/lib/bundler/definition.rb +533 -216
  47. data/lib/bundler/dep_proxy.rb +18 -8
  48. data/lib/bundler/dependency.rb +39 -12
  49. data/lib/bundler/deployment.rb +7 -0
  50. data/lib/bundler/deprecate.rb +31 -2
  51. data/lib/bundler/dsl.rb +188 -91
  52. data/lib/bundler/endpoint_specification.rb +51 -10
  53. data/lib/bundler/env.rb +116 -48
  54. data/lib/bundler/environment_preserver.rb +82 -0
  55. data/lib/bundler/errors.rb +108 -31
  56. data/lib/bundler/feature_flag.rb +60 -0
  57. data/lib/bundler/fetcher.rb +81 -52
  58. data/lib/bundler/fetcher/base.rb +15 -3
  59. data/lib/bundler/fetcher/compact_index.rb +140 -0
  60. data/lib/bundler/fetcher/dependency.rb +36 -42
  61. data/lib/bundler/fetcher/downloader.rb +39 -12
  62. data/lib/bundler/fetcher/index.rb +34 -9
  63. data/lib/bundler/friendly_errors.rb +132 -88
  64. data/lib/bundler/gem_helper.rb +92 -50
  65. data/lib/bundler/gem_helpers.rb +90 -5
  66. data/lib/bundler/gem_tasks.rb +3 -1
  67. data/lib/bundler/gem_version_promoter.rb +190 -0
  68. data/lib/bundler/gemdeps.rb +29 -0
  69. data/lib/bundler/graph.rb +20 -41
  70. data/lib/bundler/index.rb +74 -57
  71. data/lib/bundler/injector.rb +242 -31
  72. data/lib/bundler/inline.rb +49 -23
  73. data/lib/bundler/installer.rb +190 -74
  74. data/lib/bundler/installer/gem_installer.rb +33 -20
  75. data/lib/bundler/installer/parallel_installer.rb +201 -97
  76. data/lib/bundler/installer/standalone.rb +10 -6
  77. data/lib/bundler/lazy_specification.rb +74 -10
  78. data/lib/bundler/lockfile_generator.rb +95 -0
  79. data/lib/bundler/lockfile_parser.rb +126 -74
  80. data/lib/bundler/{ssl_certs → man}/.document +0 -0
  81. data/lib/bundler/man/bundle-add.1 +66 -0
  82. data/lib/bundler/man/bundle-add.1.ronn +46 -0
  83. data/lib/bundler/man/bundle-binstubs.1 +42 -0
  84. data/lib/bundler/man/bundle-binstubs.1.ronn +41 -0
  85. data/lib/bundler/man/bundle-cache.1 +55 -0
  86. data/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +22 -16
  87. data/lib/bundler/man/bundle-check.1 +31 -0
  88. data/lib/bundler/man/bundle-check.1.ronn +26 -0
  89. data/lib/bundler/man/bundle-clean.1 +24 -0
  90. data/lib/bundler/man/bundle-clean.1.ronn +18 -0
  91. data/lib/bundler/man/bundle-config.1 +488 -0
  92. data/lib/bundler/man/bundle-config.1.ronn +388 -0
  93. data/lib/bundler/man/bundle-doctor.1 +44 -0
  94. data/lib/bundler/man/bundle-doctor.1.ronn +33 -0
  95. data/lib/bundler/man/bundle-exec.1 +165 -0
  96. data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +20 -4
  97. data/lib/bundler/man/bundle-gem.1 +102 -0
  98. data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +37 -13
  99. data/lib/bundler/man/bundle-info.1 +20 -0
  100. data/lib/bundler/man/bundle-info.1.ronn +17 -0
  101. data/lib/bundler/man/bundle-init.1 +25 -0
  102. data/lib/bundler/man/bundle-init.1.ronn +29 -0
  103. data/lib/bundler/man/bundle-inject.1 +33 -0
  104. data/lib/bundler/man/bundle-inject.1.ronn +22 -0
  105. data/lib/bundler/man/bundle-install.1 +338 -0
  106. data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +82 -76
  107. data/lib/bundler/man/bundle-list.1 +50 -0
  108. data/lib/bundler/man/bundle-list.1.ronn +33 -0
  109. data/lib/bundler/man/bundle-lock.1 +84 -0
  110. data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +47 -0
  111. data/lib/bundler/man/bundle-open.1 +32 -0
  112. data/lib/bundler/man/bundle-open.1.ronn +19 -0
  113. data/lib/bundler/man/bundle-outdated.1 +155 -0
  114. data/lib/bundler/man/bundle-outdated.1.ronn +111 -0
  115. data/lib/bundler/man/bundle-platform.1 +61 -0
  116. data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +1 -1
  117. data/lib/bundler/man/bundle-pristine.1 +34 -0
  118. data/lib/bundler/man/bundle-pristine.1.ronn +34 -0
  119. data/lib/bundler/man/bundle-remove.1 +31 -0
  120. data/lib/bundler/man/bundle-remove.1.ronn +23 -0
  121. data/lib/bundler/man/bundle-show.1 +23 -0
  122. data/lib/bundler/man/bundle-show.1.ronn +21 -0
  123. data/lib/bundler/man/bundle-update.1 +394 -0
  124. data/lib/bundler/man/bundle-update.1.ronn +350 -0
  125. data/lib/bundler/man/bundle-viz.1 +39 -0
  126. data/lib/bundler/man/bundle-viz.1.ronn +30 -0
  127. data/lib/bundler/man/bundle.1 +136 -0
  128. data/lib/bundler/man/bundle.1.ronn +111 -0
  129. data/lib/bundler/man/gemfile.5 +686 -0
  130. data/{man → lib/bundler/man}/gemfile.5.ronn +117 -95
  131. data/lib/bundler/man/index.txt +25 -0
  132. data/lib/bundler/match_platform.rb +15 -4
  133. data/lib/bundler/mirror.rb +223 -0
  134. data/lib/bundler/plugin.rb +330 -0
  135. data/lib/bundler/plugin/api.rb +81 -0
  136. data/lib/bundler/plugin/api/source.rb +304 -0
  137. data/lib/bundler/plugin/dsl.rb +53 -0
  138. data/lib/bundler/plugin/events.rb +61 -0
  139. data/lib/bundler/plugin/index.rb +182 -0
  140. data/lib/bundler/plugin/installer.rb +109 -0
  141. data/lib/bundler/plugin/installer/git.rb +38 -0
  142. data/lib/bundler/plugin/installer/rubygems.rb +27 -0
  143. data/lib/bundler/plugin/source_list.rb +27 -0
  144. data/lib/bundler/process_lock.rb +24 -0
  145. data/lib/bundler/psyched_yaml.rb +2 -6
  146. data/lib/bundler/remote_specification.rb +42 -9
  147. data/lib/bundler/resolver.rb +312 -225
  148. data/lib/bundler/resolver/spec_group.rb +122 -0
  149. data/lib/bundler/retry.rb +11 -5
  150. data/lib/bundler/ruby_dsl.rb +9 -2
  151. data/lib/bundler/ruby_version.rb +84 -61
  152. data/lib/bundler/rubygems_ext.rb +92 -53
  153. data/lib/bundler/rubygems_gem_installer.rb +84 -0
  154. data/lib/bundler/rubygems_integration.rb +320 -395
  155. data/lib/bundler/runtime.rb +87 -75
  156. data/lib/bundler/settings.rb +297 -119
  157. data/lib/bundler/settings/validator.rb +102 -0
  158. data/lib/bundler/setup.rb +13 -12
  159. data/lib/bundler/shared_helpers.rb +234 -53
  160. data/lib/bundler/similarity_detector.rb +5 -3
  161. data/lib/bundler/source.rb +63 -4
  162. data/lib/bundler/source/gemspec.rb +18 -0
  163. data/lib/bundler/source/git.rb +97 -50
  164. data/lib/bundler/source/git/git_proxy.rb +138 -65
  165. data/lib/bundler/source/metadata.rb +67 -0
  166. data/lib/bundler/source/path.rb +83 -47
  167. data/lib/bundler/source/path/installer.rb +42 -11
  168. data/lib/bundler/source/rubygems.rb +231 -116
  169. data/lib/bundler/source/rubygems/remote.rb +30 -1
  170. data/lib/bundler/source_list.rb +103 -21
  171. data/lib/bundler/spec_set.rb +96 -51
  172. data/lib/bundler/stub_specification.rb +87 -4
  173. data/lib/bundler/templates/.document +1 -0
  174. data/lib/bundler/templates/Executable +14 -1
  175. data/lib/bundler/templates/Executable.bundler +114 -0
  176. data/lib/bundler/templates/Executable.standalone +6 -4
  177. data/lib/bundler/templates/Gemfile +4 -1
  178. data/lib/bundler/templates/gems.rb +8 -0
  179. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +79 -44
  180. data/lib/bundler/templates/newgem/Gemfile.tt +18 -2
  181. data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
  182. data/lib/bundler/templates/newgem/README.md.tt +16 -10
  183. data/lib/bundler/templates/newgem/Rakefile.tt +22 -8
  184. data/lib/bundler/templates/newgem/bin/console.tt +2 -1
  185. data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
  186. data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
  187. data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +4 -4
  188. data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
  189. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
  190. data/lib/bundler/templates/newgem/gitignore.tt +5 -1
  191. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  192. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +9 -6
  193. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +6 -4
  194. data/lib/bundler/templates/newgem/newgem.gemspec.tt +27 -28
  195. data/lib/bundler/templates/newgem/rspec.tt +1 -0
  196. data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
  197. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +4 -4
  198. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -2
  199. data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +3 -1
  200. data/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
  201. data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  202. data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  203. data/lib/bundler/templates/newgem/{.travis.yml.tt → travis.yml.tt} +2 -0
  204. data/lib/bundler/ui.rb +5 -3
  205. data/lib/bundler/ui/rg_proxy.rb +3 -1
  206. data/lib/bundler/ui/shell.rb +54 -21
  207. data/lib/bundler/ui/silent.rb +26 -1
  208. data/lib/bundler/uri_credentials_filter.rb +43 -0
  209. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
  210. data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
  211. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
  212. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
  213. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1764 -0
  214. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +11 -5
  215. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
  216. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +81 -0
  217. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +113 -134
  218. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
  219. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
  220. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
  221. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
  222. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
  223. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
  224. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
  225. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
  226. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +158 -0
  227. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +82 -8
  228. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +4 -1
  229. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +2 -0
  230. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +6 -2
  231. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +555 -150
  232. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +6 -3
  233. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +19 -12
  234. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +310 -467
  235. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
  236. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
  237. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
  238. data/lib/bundler/vendor/thor/lib/thor.rb +58 -25
  239. data/lib/bundler/vendor/thor/lib/thor/actions.rb +50 -33
  240. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
  241. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +5 -3
  242. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +9 -19
  243. data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +16 -8
  244. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +79 -22
  245. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +33 -20
  246. data/lib/bundler/vendor/thor/lib/thor/base.rb +110 -67
  247. data/lib/bundler/vendor/thor/lib/thor/command.rb +33 -24
  248. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
  249. data/lib/bundler/vendor/thor/lib/thor/error.rb +81 -3
  250. data/lib/bundler/vendor/thor/lib/thor/group.rb +16 -16
  251. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +5 -5
  252. data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
  253. data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
  254. data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
  255. data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  256. data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
  257. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
  258. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +18 -18
  259. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +60 -26
  260. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +31 -13
  261. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
  262. data/lib/bundler/vendor/thor/lib/thor/runner.rb +42 -39
  263. data/lib/bundler/vendor/thor/lib/thor/shell.rb +5 -5
  264. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +109 -39
  265. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +7 -3
  266. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +5 -5
  267. data/lib/bundler/vendor/thor/lib/thor/util.rb +26 -9
  268. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  269. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
  270. data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  271. data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
  272. data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
  273. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  274. data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
  275. data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
  276. data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  277. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  278. data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
  279. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
  280. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  281. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
  282. data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  283. data/lib/bundler/vendored_fileutils.rb +4 -0
  284. data/lib/bundler/vendored_molinillo.rb +3 -1
  285. data/lib/bundler/vendored_persistent.rb +45 -9
  286. data/lib/bundler/vendored_thor.rb +8 -3
  287. data/lib/bundler/vendored_tmpdir.rb +4 -0
  288. data/lib/bundler/vendored_uri.rb +4 -0
  289. data/lib/bundler/version.rb +7 -4
  290. data/lib/bundler/version_ranges.rb +122 -0
  291. data/lib/bundler/vlad.rb +8 -2
  292. data/lib/bundler/worker.rb +38 -6
  293. data/lib/bundler/yaml_serializer.rb +89 -0
  294. metadata +164 -158
  295. data/.gitignore +0 -16
  296. data/.rspec +0 -3
  297. data/.rubocop.yml +0 -105
  298. data/.rubocop_todo.yml +0 -120
  299. data/.travis.yml +0 -97
  300. data/CODE_OF_CONDUCT.md +0 -42
  301. data/CONTRIBUTING.md +0 -32
  302. data/DEVELOPMENT.md +0 -118
  303. data/ISSUES.md +0 -96
  304. data/Rakefile +0 -309
  305. data/bin/rake +0 -14
  306. data/bin/rspec +0 -10
  307. data/bin/rubocop +0 -11
  308. data/exe/bundle_ruby +0 -60
  309. data/lib/bundler/cli/package.rb +0 -45
  310. data/lib/bundler/environment.rb +0 -41
  311. data/lib/bundler/gem_path_manipulation.rb +0 -8
  312. data/lib/bundler/gem_remote_fetcher.rb +0 -41
  313. data/lib/bundler/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
  314. data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +0 -32
  315. data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
  316. data/lib/bundler/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
  317. data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
  318. data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +0 -20
  319. data/lib/bundler/ssl_certs/certificate_manager.rb +0 -64
  320. data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
  321. data/lib/bundler/vendor/net/http/faster.rb +0 -26
  322. data/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +0 -128
  323. data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -10
  324. data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -98
  325. data/man/bundle-config.ronn +0 -187
  326. data/man/bundle-update.ronn +0 -188
  327. data/man/bundle.ronn +0 -98
  328. data/man/index.txt +0 -8
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bundler
2
4
  class Source
3
5
  class Rubygems
@@ -14,7 +16,30 @@ module Bundler
14
16
  @anonymized_uri = remove_auth(@uri).freeze
15
17
  end
16
18
 
17
- private
19
+ # @return [String] A slug suitable for use as a cache key for this
20
+ # remote.
21
+ #
22
+ def cache_slug
23
+ @cache_slug ||= begin
24
+ return nil unless SharedHelpers.md5_available?
25
+
26
+ cache_uri = original_uri || uri
27
+
28
+ host = cache_uri.to_s.start_with?("file://") ? nil : cache_uri.host
29
+
30
+ uri_parts = [host, cache_uri.user, cache_uri.port, cache_uri.path]
31
+ uri_digest = SharedHelpers.digest(:MD5).hexdigest(uri_parts.compact.join("."))
32
+
33
+ uri_parts[-1] = uri_digest
34
+ uri_parts.compact.join(".")
35
+ end
36
+ end
37
+
38
+ def to_s
39
+ "rubygems remote at #{anonymized_uri}"
40
+ end
41
+
42
+ private
18
43
 
19
44
  def apply_auth(uri, auth)
20
45
  if auth && uri.userinfo.nil?
@@ -23,6 +48,10 @@ module Bundler
23
48
  end
24
49
 
25
50
  uri
51
+ rescue Bundler::URI::InvalidComponentError
52
+ error_message = "Please CGI escape your usernames and passwords before " \
53
+ "setting them for authentication."
54
+ raise HTTPError.new(error_message)
26
55
  end
27
56
 
28
57
  def remove_auth(uri)
@@ -1,34 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "set"
4
+
1
5
  module Bundler
2
6
  class SourceList
3
7
  attr_reader :path_sources,
4
- :git_sources
8
+ :git_sources,
9
+ :plugin_sources,
10
+ :global_rubygems_source,
11
+ :metadata_source
5
12
 
6
13
  def initialize
7
- @path_sources = []
8
- @git_sources = []
9
- @rubygems_aggregate = Source::Rubygems.new
10
- @rubygems_sources = []
14
+ @path_sources = []
15
+ @git_sources = []
16
+ @plugin_sources = []
17
+ @global_rubygems_source = nil
18
+ @rubygems_aggregate = rubygems_aggregate_class.new
19
+ @rubygems_sources = []
20
+ @metadata_source = Source::Metadata.new
11
21
  end
12
22
 
13
23
  def add_path_source(options = {})
14
- add_source_to_list Source::Path.new(options), path_sources
24
+ if options["gemspec"]
25
+ add_source_to_list Source::Gemspec.new(options), path_sources
26
+ else
27
+ add_source_to_list Source::Path.new(options), path_sources
28
+ end
15
29
  end
16
30
 
17
31
  def add_git_source(options = {})
18
- add_source_to_list Source::Git.new(options), git_sources
32
+ add_source_to_list(Source::Git.new(options), git_sources).tap do |source|
33
+ warn_on_git_protocol(source)
34
+ end
19
35
  end
20
36
 
21
37
  def add_rubygems_source(options = {})
22
38
  add_source_to_list Source::Rubygems.new(options), @rubygems_sources
23
39
  end
24
40
 
41
+ def add_plugin_source(source, options = {})
42
+ add_source_to_list Plugin.source(source).new(options), @plugin_sources
43
+ end
44
+
45
+ def global_rubygems_source=(uri)
46
+ if Bundler.feature_flag.disable_multisource?
47
+ @global_rubygems_source ||= rubygems_aggregate_class.new("remotes" => uri)
48
+ end
49
+ add_rubygems_remote(uri)
50
+ end
51
+
25
52
  def add_rubygems_remote(uri)
53
+ return if Bundler.feature_flag.disable_multisource?
26
54
  @rubygems_aggregate.add_remote(uri)
27
55
  @rubygems_aggregate
28
56
  end
29
57
 
58
+ def default_source
59
+ global_rubygems_source || @rubygems_aggregate
60
+ end
61
+
30
62
  def rubygems_sources
31
- @rubygems_sources + [@rubygems_aggregate]
63
+ @rubygems_sources + [default_source]
32
64
  end
33
65
 
34
66
  def rubygems_remotes
@@ -36,34 +68,40 @@ module Bundler
36
68
  end
37
69
 
38
70
  def all_sources
39
- path_sources + git_sources + rubygems_sources
71
+ path_sources + git_sources + plugin_sources + rubygems_sources + [metadata_source]
40
72
  end
41
73
 
42
74
  def get(source)
43
- source_list_for(source).find {|s| source == s }
75
+ source_list_for(source).find {|s| equal_source?(source, s) || equivalent_source?(source, s) }
44
76
  end
45
77
 
46
78
  def lock_sources
47
- lock_sources = (path_sources + git_sources).sort_by(&:to_s)
48
- lock_sources << combine_rubygems_sources
79
+ lock_sources = (path_sources + git_sources + plugin_sources).sort_by(&:to_s)
80
+ if Bundler.feature_flag.disable_multisource?
81
+ lock_sources + rubygems_sources.sort_by(&:to_s)
82
+ else
83
+ lock_sources << combine_rubygems_sources
84
+ end
49
85
  end
50
86
 
87
+ # Returns true if there are changes
51
88
  def replace_sources!(replacement_sources)
52
89
  return true if replacement_sources.empty?
53
90
 
54
- [path_sources, git_sources].each do |source_list|
91
+ [path_sources, git_sources, plugin_sources].each do |source_list|
55
92
  source_list.map! do |source|
56
93
  replacement_sources.find {|s| s == source } || source
57
94
  end
58
95
  end
59
96
 
60
- replacement_rubygems =
97
+ replacement_rubygems = !Bundler.feature_flag.disable_multisource? &&
61
98
  replacement_sources.detect {|s| s.is_a?(Source::Rubygems) }
62
99
  @rubygems_aggregate = replacement_rubygems if replacement_rubygems
63
100
 
64
- # Return true if there were changes
65
- lock_sources.to_set != replacement_sources.to_set ||
66
- rubygems_remotes.to_set != replacement_rubygems.remotes.to_set
101
+ return true if !equal_sources?(lock_sources, replacement_sources) && !equivalent_sources?(lock_sources, replacement_sources)
102
+ return true if replacement_rubygems && rubygems_remotes.to_set != replacement_rubygems.remotes.to_set
103
+
104
+ false
67
105
  end
68
106
 
69
107
  def cached!
@@ -78,7 +116,11 @@ module Bundler
78
116
  @rubygems_aggregate.remotes
79
117
  end
80
118
 
81
- private
119
+ private
120
+
121
+ def rubygems_aggregate_class
122
+ Source::Rubygems
123
+ end
82
124
 
83
125
  def add_source_to_list(source, list)
84
126
  list.unshift(source).uniq!
@@ -87,9 +129,10 @@ module Bundler
87
129
 
88
130
  def source_list_for(source)
89
131
  case source
90
- when Source::Git then git_sources
91
- when Source::Path then path_sources
92
- when Source::Rubygems then rubygems_sources
132
+ when Source::Git then git_sources
133
+ when Source::Path then path_sources
134
+ when Source::Rubygems then rubygems_sources
135
+ when Plugin::API::Source then plugin_sources
93
136
  else raise ArgumentError, "Invalid source: #{source.inspect}"
94
137
  end
95
138
  end
@@ -97,5 +140,44 @@ module Bundler
97
140
  def combine_rubygems_sources
98
141
  Source::Rubygems.new("remotes" => rubygems_remotes)
99
142
  end
143
+
144
+ def warn_on_git_protocol(source)
145
+ return if Bundler.settings["git.allow_insecure"]
146
+
147
+ if source.uri =~ /^git\:/
148
+ Bundler.ui.warn "The git source `#{source.uri}` uses the `git` protocol, " \
149
+ "which transmits data without encryption. Disable this warning with " \
150
+ "`bundle config set --local git.allow_insecure true`, or switch to the `https` " \
151
+ "protocol to keep your data secure."
152
+ end
153
+ end
154
+
155
+ def equal_sources?(lock_sources, replacement_sources)
156
+ lock_sources.to_set == replacement_sources.to_set
157
+ end
158
+
159
+ def equal_source?(source, other_source)
160
+ source == other_source
161
+ end
162
+
163
+ def equivalent_source?(source, other_source)
164
+ return false unless Bundler.settings[:allow_deployment_source_credential_changes] && source.is_a?(Source::Rubygems)
165
+
166
+ equivalent_rubygems_sources?([source], [other_source])
167
+ end
168
+
169
+ def equivalent_sources?(lock_sources, replacement_sources)
170
+ return false unless Bundler.settings[:allow_deployment_source_credential_changes]
171
+
172
+ lock_rubygems_sources, lock_other_sources = lock_sources.partition {|s| s.is_a?(Source::Rubygems) }
173
+ replacement_rubygems_sources, replacement_other_sources = replacement_sources.partition {|s| s.is_a?(Source::Rubygems) }
174
+
175
+ equivalent_rubygems_sources?(lock_rubygems_sources, replacement_rubygems_sources) && equal_sources?(lock_other_sources, replacement_other_sources)
176
+ end
177
+
178
+ def equivalent_rubygems_sources?(lock_sources, replacement_sources)
179
+ actual_remotes = replacement_sources.map(&:remotes).flatten.uniq
180
+ lock_sources.all? {|s| s.equivalent_remotes?(actual_remotes) }
181
+ end
100
182
  end
101
183
  end
@@ -1,48 +1,43 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "tsort"
2
- require "forwardable"
4
+ require "set"
3
5
 
4
6
  module Bundler
5
7
  class SpecSet
6
- extend Forwardable
7
- include TSort, Enumerable
8
-
9
- def_delegators :@specs, :<<, :length, :add, :remove
10
- def_delegators :sorted, :each
8
+ include Enumerable
9
+ include TSort
11
10
 
12
11
  def initialize(specs)
13
- @specs = specs.sort_by(&:name)
12
+ @specs = specs
14
13
  end
15
14
 
16
- def for(dependencies, skip = [], check = false, match_current_platform = false)
17
- handled = {}
15
+ def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
16
+ handled = Set.new
18
17
  deps = dependencies.dup
19
18
  specs = []
20
- skip << "bundler"
21
-
22
- until deps.empty?
23
- dep = deps.shift
24
- next if handled[dep] || skip.include?(dep.name)
19
+ skip += ["bundler"]
25
20
 
26
- spec = lookup[dep.name].find do |s|
27
- if match_current_platform
28
- Gem::Platform.match(s.platform)
29
- else
30
- s.match_platform(dep.__platform)
31
- end
32
- end
21
+ loop do
22
+ break unless dep = deps.shift
23
+ next if !handled.add?(dep) || skip.include?(dep.name)
33
24
 
34
- handled[dep] = true
25
+ specs_for_dep = spec_for_dependency(dep, match_current_platform)
26
+ if specs_for_dep.any?
27
+ specs += specs_for_dep
35
28
 
36
- if spec
37
- specs << spec
38
-
39
- spec.dependencies.each do |d|
29
+ specs_for_dep.first.dependencies.each do |d|
40
30
  next if d.type == :development
41
- d = DepProxy.new(d, dep.__platform) unless match_current_platform
31
+ d = DepProxy.get_proxy(d, dep.__platform) unless match_current_platform
42
32
  deps << d
43
33
  end
44
34
  elsif check
45
35
  return false
36
+ elsif raise_on_missing
37
+ others = lookup[dep.name] if match_current_platform
38
+ message = "Unable to find a spec satisfying #{dep} in the set. Perhaps the lockfile is corrupted?"
39
+ message += " Found #{others.join(", ")} that did not match the current platform." if others && !others.empty?
40
+ raise GemNotFound, message
46
41
  end
47
42
  end
48
43
 
@@ -66,7 +61,6 @@ module Bundler
66
61
  @specs << value
67
62
  @lookup = nil
68
63
  @sorted = nil
69
- value
70
64
  end
71
65
 
72
66
  def sort!
@@ -82,32 +76,80 @@ module Bundler
82
76
  end
83
77
 
84
78
  def materialize(deps, missing_specs = nil)
85
- materialized = self.for(deps, [], false, true).to_a
79
+ materialized = self.for(deps, [], false, true, !missing_specs).to_a
86
80
  deps = materialized.map(&:name).uniq
87
81
  materialized.map! do |s|
88
82
  next s unless s.is_a?(LazySpecification)
89
83
  s.source.dependency_names = deps if s.source.respond_to?(:dependency_names=)
90
84
  spec = s.__materialize__
91
- if missing_specs
92
- missing_specs << s unless spec
93
- else
94
- raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
85
+ unless spec
86
+ unless missing_specs
87
+ raise GemNotFound, "Could not find #{s.full_name} in any of the sources"
88
+ end
89
+ missing_specs << s
95
90
  end
96
- spec if spec
91
+ spec
92
+ end
93
+ SpecSet.new(missing_specs ? materialized.compact : materialized)
94
+ end
95
+
96
+ # Materialize for all the specs in the spec set, regardless of what platform they're for
97
+ # This is in contrast to how for does platform filtering (and specifically different from how `materialize` calls `for` only for the current platform)
98
+ # @return [Array<Gem::Specification>]
99
+ def materialized_for_all_platforms
100
+ names = @specs.map(&:name).uniq
101
+ @specs.map do |s|
102
+ next s unless s.is_a?(LazySpecification)
103
+ s.source.dependency_names = names if s.source.respond_to?(:dependency_names=)
104
+ s.source.remote!
105
+ spec = s.__materialize__
106
+ raise GemNotFound, "Could not find #{s.full_name} in any of the sources" unless spec
107
+ spec
97
108
  end
98
- SpecSet.new(materialized.compact)
99
109
  end
100
110
 
101
111
  def merge(set)
102
112
  arr = sorted.dup
103
- set.each do |s|
104
- next if arr.any? {|s2| s2.name == s.name && s2.version == s.version && s2.platform == s.platform }
105
- arr << s
113
+ set.each do |set_spec|
114
+ full_name = set_spec.full_name
115
+ next if arr.any? {|spec| spec.full_name == full_name }
116
+ arr << set_spec
106
117
  end
107
118
  SpecSet.new(arr)
108
119
  end
109
120
 
110
- private
121
+ def find_by_name_and_platform(name, platform)
122
+ @specs.detect {|spec| spec.name == name && spec.match_platform(platform) }
123
+ end
124
+
125
+ def what_required(spec)
126
+ unless req = find {|s| s.dependencies.any? {|d| d.type == :runtime && d.name == spec.name } }
127
+ return [spec]
128
+ end
129
+ what_required(req) << spec
130
+ end
131
+
132
+ def <<(spec)
133
+ @specs << spec
134
+ end
135
+
136
+ def length
137
+ @specs.length
138
+ end
139
+
140
+ def size
141
+ @specs.size
142
+ end
143
+
144
+ def empty?
145
+ @specs.empty?
146
+ end
147
+
148
+ def each(&b)
149
+ sorted.each(&b)
150
+ end
151
+
152
+ private
111
153
 
112
154
  def sorted
113
155
  rake = @specs.find {|s| s.name == "rake" }
@@ -116,26 +158,19 @@ module Bundler
116
158
  rescue TSort::Cyclic => error
117
159
  cgems = extract_circular_gems(error)
118
160
  raise CyclicDependencyError, "Your bundle requires gems that depend" \
119
- " depend on each other, creating an infinite loop. Please remove" \
120
- " either gem '#{cgems[1]}' or gem '#{cgems[0]}' and try again."
161
+ " on each other, creating an infinite loop. Please remove either" \
162
+ " gem '#{cgems[1]}' or gem '#{cgems[0]}' and try again."
121
163
  end
122
164
  end
123
165
 
124
166
  def extract_circular_gems(error)
125
- if Bundler.current_ruby.mri? && Bundler.current_ruby.on_19?
126
- error.message.scan(/(\w+) \([^)]/).flatten
127
- else
128
- error.message.scan(/@name="(.*?)"/).flatten
129
- end
167
+ error.message.scan(/@name="(.*?)"/).flatten
130
168
  end
131
169
 
132
170
  def lookup
133
171
  @lookup ||= begin
134
172
  lookup = Hash.new {|h, k| h[k] = [] }
135
- specs = @specs.sort_by do |s|
136
- s.platform.to_s == "ruby" ? "\0" : s.platform.to_s
137
- end
138
- specs.reverse_each do |s|
173
+ Index.sort_specs(@specs).reverse_each do |s|
139
174
  lookup[s.name] << s
140
175
  end
141
176
  lookup
@@ -143,7 +178,17 @@ module Bundler
143
178
  end
144
179
 
145
180
  def tsort_each_node
146
- @specs.each {|s| yield s }
181
+ # MUST sort by name for backwards compatibility
182
+ @specs.sort_by(&:name).each {|s| yield s }
183
+ end
184
+
185
+ def spec_for_dependency(dep, match_current_platform)
186
+ specs_for_platforms = lookup[dep.name]
187
+ if match_current_platform
188
+ GemHelpers.select_best_platform_match(specs_for_platforms, Bundler.local_platform)
189
+ else
190
+ GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform)
191
+ end
147
192
  end
148
193
 
149
194
  def tsort_each_child(s)