bundler 2.1.4 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (338) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2468 -1430
  3. data/README.md +8 -10
  4. data/bundler.gemspec +10 -13
  5. data/exe/bundle +7 -8
  6. data/exe/bundler +1 -1
  7. data/lib/bundler/.document +1 -0
  8. data/lib/bundler/build_metadata.rb +3 -11
  9. data/lib/bundler/cli/add.rb +2 -2
  10. data/lib/bundler/cli/binstubs.rb +6 -2
  11. data/lib/bundler/cli/cache.rb +3 -8
  12. data/lib/bundler/cli/check.rb +5 -3
  13. data/lib/bundler/cli/clean.rb +1 -1
  14. data/lib/bundler/cli/common.rb +32 -3
  15. data/lib/bundler/cli/config.rb +10 -1
  16. data/lib/bundler/cli/console.rb +3 -3
  17. data/lib/bundler/cli/doctor.rb +23 -6
  18. data/lib/bundler/cli/exec.rb +5 -10
  19. data/lib/bundler/cli/fund.rb +36 -0
  20. data/lib/bundler/cli/gem.rb +258 -45
  21. data/lib/bundler/cli/info.rb +38 -6
  22. data/lib/bundler/cli/init.rb +7 -3
  23. data/lib/bundler/cli/inject.rb +1 -1
  24. data/lib/bundler/cli/install.rb +27 -57
  25. data/lib/bundler/cli/issue.rb +5 -4
  26. data/lib/bundler/cli/list.rb +19 -11
  27. data/lib/bundler/cli/lock.rb +11 -4
  28. data/lib/bundler/cli/open.rb +1 -2
  29. data/lib/bundler/cli/outdated.rb +106 -79
  30. data/lib/bundler/cli/platform.rb +2 -2
  31. data/lib/bundler/cli/plugin.rb +10 -0
  32. data/lib/bundler/cli/pristine.rb +5 -0
  33. data/lib/bundler/cli/remove.rb +1 -2
  34. data/lib/bundler/cli/show.rb +2 -2
  35. data/lib/bundler/cli/update.rb +20 -9
  36. data/lib/bundler/cli/viz.rb +1 -1
  37. data/lib/bundler/cli.rb +149 -85
  38. data/lib/bundler/compact_index_client/cache.rb +7 -24
  39. data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  40. data/lib/bundler/compact_index_client/updater.rb +56 -51
  41. data/lib/bundler/compact_index_client.rb +3 -9
  42. data/lib/bundler/constants.rb +1 -1
  43. data/lib/bundler/current_ruby.rb +17 -6
  44. data/lib/bundler/definition.rb +343 -440
  45. data/lib/bundler/dependency.rb +23 -77
  46. data/lib/bundler/digest.rb +71 -0
  47. data/lib/bundler/dsl.rb +77 -85
  48. data/lib/bundler/endpoint_specification.rb +20 -14
  49. data/lib/bundler/env.rb +3 -3
  50. data/lib/bundler/environment_preserver.rb +30 -2
  51. data/lib/bundler/errors.rb +31 -14
  52. data/lib/bundler/feature_flag.rb +0 -9
  53. data/lib/bundler/fetcher/base.rb +7 -9
  54. data/lib/bundler/fetcher/compact_index.rb +20 -27
  55. data/lib/bundler/fetcher/dependency.rb +1 -1
  56. data/lib/bundler/fetcher/downloader.rb +11 -11
  57. data/lib/bundler/fetcher/index.rb +2 -30
  58. data/lib/bundler/fetcher.rb +24 -29
  59. data/lib/bundler/force_platform.rb +18 -0
  60. data/lib/bundler/friendly_errors.rb +45 -49
  61. data/lib/bundler/gem_helper.rb +53 -31
  62. data/lib/bundler/gem_helpers.rb +42 -24
  63. data/lib/bundler/gem_version_promoter.rb +54 -99
  64. data/lib/bundler/graph.rb +4 -4
  65. data/lib/bundler/index.rb +14 -52
  66. data/lib/bundler/injector.rb +40 -8
  67. data/lib/bundler/inline.rb +6 -15
  68. data/lib/bundler/installer/gem_installer.rb +19 -24
  69. data/lib/bundler/installer/parallel_installer.rb +32 -42
  70. data/lib/bundler/installer/standalone.rb +58 -11
  71. data/lib/bundler/installer.rb +47 -87
  72. data/lib/bundler/lazy_specification.rb +76 -35
  73. data/lib/bundler/lockfile_generator.rb +3 -3
  74. data/lib/bundler/lockfile_parser.rb +24 -49
  75. data/lib/bundler/man/.document +1 -0
  76. data/{man → lib/bundler/man}/bundle-add.1 +21 -5
  77. data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +16 -4
  78. data/{man → lib/bundler/man}/bundle-binstubs.1 +5 -3
  79. data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
  80. data/{man → lib/bundler/man}/bundle-cache.1 +7 -1
  81. data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +7 -0
  82. data/{man → lib/bundler/man}/bundle-check.1 +1 -1
  83. data/{man → lib/bundler/man}/bundle-clean.1 +2 -2
  84. data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +1 -1
  85. data/{man → lib/bundler/man}/bundle-config.1 +65 -47
  86. data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +74 -65
  87. data/lib/bundler/man/bundle-console.1 +53 -0
  88. data/lib/bundler/man/bundle-console.1.ronn +44 -0
  89. data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
  90. data/{man → lib/bundler/man}/bundle-exec.1 +2 -2
  91. data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +1 -1
  92. data/lib/bundler/man/bundle-gem.1 +105 -0
  93. data/lib/bundler/man/bundle-gem.1.ronn +117 -0
  94. data/lib/bundler/man/bundle-help.1 +13 -0
  95. data/lib/bundler/man/bundle-help.1.ronn +12 -0
  96. data/{man → lib/bundler/man}/bundle-info.1 +1 -1
  97. data/{man → lib/bundler/man}/bundle-init.1 +1 -1
  98. data/{man → lib/bundler/man}/bundle-inject.1 +5 -2
  99. data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +3 -1
  100. data/{man → lib/bundler/man}/bundle-install.1 +35 -33
  101. data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +33 -34
  102. data/{man → lib/bundler/man}/bundle-list.1 +7 -7
  103. data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
  104. data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
  105. data/{man → lib/bundler/man}/bundle-open.1 +1 -1
  106. data/{man → lib/bundler/man}/bundle-outdated.1 +3 -10
  107. data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +1 -10
  108. data/{man → lib/bundler/man}/bundle-platform.1 +16 -6
  109. data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +14 -7
  110. data/lib/bundler/man/bundle-plugin.1 +81 -0
  111. data/lib/bundler/man/bundle-plugin.1.ronn +59 -0
  112. data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
  113. data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
  114. data/{man → lib/bundler/man}/bundle-show.1 +1 -1
  115. data/{man → lib/bundler/man}/bundle-update.1 +5 -5
  116. data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +5 -4
  117. data/lib/bundler/man/bundle-version.1 +35 -0
  118. data/lib/bundler/man/bundle-version.1.ronn +24 -0
  119. data/{man → lib/bundler/man}/bundle-viz.1 +4 -1
  120. data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +2 -0
  121. data/{man → lib/bundler/man}/bundle.1 +15 -10
  122. data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +12 -7
  123. data/{man → lib/bundler/man}/gemfile.5 +120 -83
  124. data/{man → lib/bundler/man}/gemfile.5.ronn +109 -88
  125. data/{man → lib/bundler/man}/index.txt +4 -0
  126. data/lib/bundler/match_metadata.rb +13 -0
  127. data/lib/bundler/match_platform.rb +0 -1
  128. data/lib/bundler/match_remote_metadata.rb +29 -0
  129. data/lib/bundler/mirror.rb +7 -9
  130. data/lib/bundler/plugin/api/source.rb +25 -9
  131. data/lib/bundler/plugin/dsl.rb +1 -1
  132. data/lib/bundler/plugin/index.rb +17 -5
  133. data/lib/bundler/plugin/installer/git.rb +0 -4
  134. data/lib/bundler/plugin/installer/rubygems.rb +1 -9
  135. data/lib/bundler/plugin/installer.rb +11 -11
  136. data/lib/bundler/plugin/source_list.rb +5 -1
  137. data/lib/bundler/plugin.rb +58 -11
  138. data/lib/bundler/process_lock.rb +1 -1
  139. data/lib/bundler/remote_specification.rb +15 -6
  140. data/lib/bundler/resolver/base.rb +46 -0
  141. data/lib/bundler/resolver/candidate.rb +92 -0
  142. data/lib/bundler/resolver/incompatibility.rb +15 -0
  143. data/lib/bundler/resolver/package.rb +63 -0
  144. data/lib/bundler/resolver/root.rb +25 -0
  145. data/lib/bundler/resolver/spec_group.rb +49 -74
  146. data/lib/bundler/resolver.rb +320 -344
  147. data/lib/bundler/retry.rb +2 -2
  148. data/lib/bundler/ruby_dsl.rb +1 -1
  149. data/lib/bundler/ruby_version.rb +6 -19
  150. data/lib/bundler/rubygems_ext.rb +231 -32
  151. data/lib/bundler/rubygems_gem_installer.rb +89 -16
  152. data/lib/bundler/rubygems_integration.rb +72 -162
  153. data/lib/bundler/runtime.rb +23 -31
  154. data/lib/bundler/self_manager.rb +168 -0
  155. data/lib/bundler/settings.rb +145 -72
  156. data/lib/bundler/setup.rb +2 -2
  157. data/lib/bundler/shared_helpers.rb +19 -34
  158. data/lib/bundler/similarity_detector.rb +1 -1
  159. data/lib/bundler/source/git/git_proxy.rb +244 -114
  160. data/lib/bundler/source/git.rb +62 -46
  161. data/lib/bundler/source/metadata.rb +3 -8
  162. data/lib/bundler/source/path/installer.rb +11 -32
  163. data/lib/bundler/source/path.rb +15 -9
  164. data/lib/bundler/source/rubygems/remote.rb +1 -1
  165. data/lib/bundler/source/rubygems.rb +167 -199
  166. data/lib/bundler/source/rubygems_aggregate.rb +68 -0
  167. data/lib/bundler/source.rb +25 -5
  168. data/lib/bundler/source_list.rb +112 -64
  169. data/lib/bundler/source_map.rb +71 -0
  170. data/lib/bundler/spec_set.rb +64 -61
  171. data/lib/bundler/stub_specification.rb +30 -10
  172. data/lib/bundler/templates/Executable +3 -5
  173. data/lib/bundler/templates/Executable.bundler +10 -15
  174. data/lib/bundler/templates/Executable.standalone +4 -4
  175. data/lib/bundler/templates/Gemfile +0 -2
  176. data/lib/bundler/templates/gems.rb +0 -3
  177. data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
  178. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
  179. data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
  180. data/lib/bundler/templates/newgem/Gemfile.tt +15 -1
  181. data/lib/bundler/templates/newgem/README.md.tt +13 -16
  182. data/lib/bundler/templates/newgem/Rakefile.tt +33 -5
  183. data/lib/bundler/templates/newgem/bin/console.tt +1 -0
  184. data/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
  185. data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
  186. data/lib/bundler/templates/newgem/ext/newgem/{extconf.rb.tt → extconf-c.rb.tt} +2 -0
  187. data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  188. data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
  189. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
  190. data/lib/bundler/templates/newgem/gitignore.tt +3 -0
  191. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
  192. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
  193. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
  194. data/lib/bundler/templates/newgem/newgem.gemspec.tt +34 -18
  195. data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
  196. data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  197. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
  198. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
  199. data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
  200. data/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
  201. data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/test_newgem.rb.tt} +3 -1
  202. data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  203. data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  204. data/lib/bundler/ui/shell.rb +37 -14
  205. data/lib/bundler/ui/silent.rb +21 -5
  206. data/lib/bundler/uri_credentials_filter.rb +3 -1
  207. data/lib/bundler/vendor/.document +1 -0
  208. data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  209. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
  210. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  211. data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
  212. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +41 -74
  213. data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
  214. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -408
  215. data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  216. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +82 -189
  217. data/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  218. data/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  219. data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
  220. data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  221. data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +151 -0
  222. data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  223. data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  224. data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  225. data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  226. data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +53 -0
  227. data/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  228. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  229. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +124 -0
  230. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +409 -0
  231. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +240 -0
  232. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  233. data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  234. data/lib/bundler/vendor/thor/LICENSE.md +20 -0
  235. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
  236. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +9 -7
  237. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
  238. data/lib/bundler/vendor/thor/lib/thor/actions.rb +7 -3
  239. data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
  240. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
  241. data/lib/bundler/vendor/thor/lib/thor/error.rb +10 -5
  242. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
  243. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +28 -9
  244. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +28 -7
  245. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
  246. data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
  247. data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  248. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  249. data/lib/bundler/vendor/thor/lib/thor.rb +5 -13
  250. data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  251. data/lib/bundler/vendor/tsort/lib/tsort.rb +452 -0
  252. data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
  253. data/lib/bundler/vendor/uri/lib/uri/common.rb +76 -91
  254. data/lib/bundler/vendor/uri/lib/uri/file.rb +7 -1
  255. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +2 -2
  256. data/lib/bundler/vendor/uri/lib/uri/generic.rb +32 -13
  257. data/lib/bundler/vendor/uri/lib/uri/http.rb +40 -3
  258. data/lib/bundler/vendor/uri/lib/uri/https.rb +2 -2
  259. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +2 -2
  260. data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
  261. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -3
  262. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +14 -21
  263. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +11 -17
  264. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  265. data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
  266. data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
  267. data/lib/bundler/vendor/uri/lib/uri.rb +3 -3
  268. data/lib/bundler/vendored_persistent.rb +1 -40
  269. data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
  270. data/lib/bundler/vendored_tsort.rb +4 -0
  271. data/lib/bundler/version.rb +5 -1
  272. data/lib/bundler/worker.rb +25 -12
  273. data/lib/bundler/yaml_serializer.rb +1 -1
  274. data/lib/bundler.rb +95 -108
  275. metadata +132 -118
  276. data/lib/bundler/dep_proxy.rb +0 -48
  277. data/lib/bundler/gemdeps.rb +0 -29
  278. data/lib/bundler/psyched_yaml.rb +0 -37
  279. data/lib/bundler/templates/newgem/travis.yml.tt +0 -6
  280. data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
  281. data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
  282. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  283. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -81
  284. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
  285. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
  286. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
  287. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
  288. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
  289. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
  290. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
  291. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
  292. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -158
  293. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -223
  294. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -143
  295. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  296. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -101
  297. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
  298. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -837
  299. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
  300. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
  301. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -12
  302. data/lib/bundler/version_ranges.rb +0 -122
  303. data/man/bundle-add.1.txt +0 -58
  304. data/man/bundle-binstubs.1.txt +0 -48
  305. data/man/bundle-cache.1.txt +0 -78
  306. data/man/bundle-check.1.txt +0 -33
  307. data/man/bundle-clean.1.txt +0 -26
  308. data/man/bundle-config.1.txt +0 -528
  309. data/man/bundle-doctor.1.txt +0 -44
  310. data/man/bundle-exec.1.txt +0 -178
  311. data/man/bundle-gem.1 +0 -80
  312. data/man/bundle-gem.1.txt +0 -91
  313. data/man/bundle-gem.ronn +0 -78
  314. data/man/bundle-info.1.txt +0 -21
  315. data/man/bundle-init.1.txt +0 -34
  316. data/man/bundle-inject.1.txt +0 -32
  317. data/man/bundle-install.1.txt +0 -401
  318. data/man/bundle-list.1.txt +0 -43
  319. data/man/bundle-lock.1.txt +0 -93
  320. data/man/bundle-open.1.txt +0 -29
  321. data/man/bundle-outdated.1.txt +0 -131
  322. data/man/bundle-platform.1.txt +0 -57
  323. data/man/bundle-pristine.1.txt +0 -44
  324. data/man/bundle-remove.1.txt +0 -34
  325. data/man/bundle-show.1.txt +0 -27
  326. data/man/bundle-update.1.txt +0 -390
  327. data/man/bundle-viz.1.txt +0 -39
  328. data/man/bundle.1.txt +0 -116
  329. data/man/gemfile.5.txt +0 -649
  330. /data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
  331. /data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
  332. /data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
  333. /data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
  334. /data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
  335. /data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
  336. /data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
  337. /data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
  338. /data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "erb"
4
- require "rubygems/dependency_installer"
5
3
  require_relative "worker"
6
4
  require_relative "installer/parallel_installer"
7
5
  require_relative "installer/standalone"
@@ -15,7 +13,7 @@ module Bundler
15
13
  Installer.ambiguous_gems = []
16
14
  end
17
15
 
18
- attr_reader :post_install_messages
16
+ attr_reader :post_install_messages, :definition
19
17
 
20
18
  # Begins the installation process for Bundler.
21
19
  # For more information see the #run method on this class.
@@ -68,7 +66,7 @@ module Bundler
68
66
  # require paths and save them in a `setup.rb` file. See `bundle standalone --help` for more
69
67
  # information.
70
68
  def run(options)
71
- create_bundle_path
69
+ Bundler.create_bundle_path
72
70
 
73
71
  ProcessLock.lock do
74
72
  if Bundler.frozen_bundle?
@@ -83,7 +81,6 @@ module Bundler
83
81
 
84
82
  if resolve_if_needed(options)
85
83
  ensure_specs_are_compatible!
86
- warn_on_incompatible_bundler_deps
87
84
  load_plugins
88
85
  options.delete(:jobs)
89
86
  else
@@ -91,6 +88,8 @@ module Bundler
91
88
  end
92
89
  install(options)
93
90
 
91
+ Gem::Specification.reset # invalidate gem specification cache so that installed gems are immediately available
92
+
94
93
  lock unless Bundler.frozen_bundle?
95
94
  Standalone.new(options[:standalone], @definition).generate if options[:standalone]
96
95
  end
@@ -120,7 +119,7 @@ module Bundler
120
119
  relative_gemfile_path = relative_gemfile_path
121
120
  ruby_command = Thor::Util.ruby_command
122
121
  ruby_command = ruby_command
123
- template_path = File.expand_path("../templates/Executable", __FILE__)
122
+ template_path = File.expand_path("templates/Executable", __dir__)
124
123
  if spec.name == "bundler"
125
124
  template_path += ".bundler"
126
125
  spec.executables = %(bundle)
@@ -135,12 +134,14 @@ module Bundler
135
134
  next
136
135
  end
137
136
 
138
- File.open(binstub_path, "w", 0o777 & ~File.umask) do |f|
139
- if RUBY_VERSION >= "2.6"
140
- f.puts ERB.new(template, :trim_mode => "-").result(binding)
141
- else
142
- f.puts ERB.new(template, nil, "-").result(binding)
143
- end
137
+ mode = Gem.win_platform? ? "wb:UTF-8" : "w"
138
+ require "erb"
139
+ content = ERB.new(template, :trim_mode => "-").result(binding)
140
+
141
+ File.write(binstub_path, content, :mode => mode, :perm => 0o777 & ~File.umask)
142
+ if Gem.win_platform? || options[:all_platforms]
143
+ prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
144
+ File.write("#{binstub_path}.cmd", prefix + content, :mode => mode)
144
145
  end
145
146
  end
146
147
 
@@ -159,7 +160,7 @@ module Bundler
159
160
  end
160
161
  end
161
162
 
162
- def generate_standalone_bundler_executable_stubs(spec)
163
+ def generate_standalone_bundler_executable_stubs(spec, options = {})
163
164
  # double-assignment to avoid warnings about variables that will be used by ERB
164
165
  bin_path = Bundler.bin_path
165
166
  unless path = Bundler.settings[:path]
@@ -167,7 +168,7 @@ module Bundler
167
168
  end
168
169
  standalone_path = Bundler.root.join(path).relative_path_from(bin_path)
169
170
  standalone_path = standalone_path
170
- template = File.read(File.expand_path("../templates/Executable.standalone", __FILE__))
171
+ template = File.read(File.expand_path("templates/Executable.standalone", __dir__))
171
172
  ruby_command = Thor::Util.ruby_command
172
173
  ruby_command = ruby_command
173
174
 
@@ -175,17 +176,20 @@ module Bundler
175
176
  next if executable == "bundle"
176
177
  executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
177
178
  executable_path = executable_path
178
- File.open "#{bin_path}/#{executable}", "w", 0o755 do |f|
179
- if RUBY_VERSION >= "2.6"
180
- f.puts ERB.new(template, :trim_mode => "-").result(binding)
181
- else
182
- f.puts ERB.new(template, nil, "-").result(binding)
183
- end
179
+
180
+ mode = Gem.win_platform? ? "wb:UTF-8" : "w"
181
+ require "erb"
182
+ content = ERB.new(template, :trim_mode => "-").result(binding)
183
+
184
+ File.write("#{bin_path}/#{executable}", content, :mode => mode, :perm => 0o755)
185
+ if Gem.win_platform? || options[:all_platforms]
186
+ prefix = "@ruby -x \"%~f0\" %*\n@exit /b %ERRORLEVEL%\n\n"
187
+ File.write("#{bin_path}/#{executable}.cmd", prefix + content, :mode => mode)
184
188
  end
185
189
  end
186
190
  end
187
191
 
188
- private
192
+ private
189
193
 
190
194
  # the order that the resolver provides is significant, since
191
195
  # dependencies might affect the installation of a gem.
@@ -202,27 +206,11 @@ module Bundler
202
206
  return jobs
203
207
  end
204
208
 
205
- return 1 unless can_install_in_parallel?
206
-
207
- auto_config_jobs = Bundler.feature_flag.auto_config_jobs?
208
209
  if jobs = Bundler.settings[:jobs]
209
- if auto_config_jobs
210
- jobs
211
- else
212
- [jobs.pred, 1].max
213
- end
214
- elsif auto_config_jobs
215
- processor_count
216
- else
217
- 1
210
+ return jobs
218
211
  end
219
- end
220
212
 
221
- def processor_count
222
- require "etc"
223
- Etc.nprocessors
224
- rescue StandardError
225
- 1
213
+ Bundler.settings.processor_count
226
214
  end
227
215
 
228
216
  def load_plugins
@@ -230,54 +218,28 @@ module Bundler
230
218
 
231
219
  requested_path_gems = @definition.requested_specs.select {|s| s.source.is_a?(Source::Path) }
232
220
  path_plugin_files = requested_path_gems.map do |spec|
233
- begin
234
- Bundler.rubygems.spec_matches_for_glob(spec, "rubygems_plugin#{Bundler.rubygems.suffix_pattern}")
235
- rescue TypeError
236
- error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
237
- raise Gem::InvalidSpecificationException, error_message
238
- end
221
+ Bundler.rubygems.spec_matches_for_glob(spec, "rubygems_plugin#{Bundler.rubygems.suffix_pattern}")
222
+ rescue TypeError
223
+ error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
224
+ raise Gem::InvalidSpecificationException, error_message
239
225
  end.flatten
240
226
  Bundler.rubygems.load_plugin_files(path_plugin_files)
227
+ Bundler.rubygems.load_env_plugins
241
228
  end
242
229
 
243
230
  def ensure_specs_are_compatible!
244
- system_ruby = Bundler::RubyVersion.system
245
- rubygems_version = Gem::Version.create(Gem::VERSION)
246
231
  @definition.specs.each do |spec|
247
- if required_ruby_version = spec.required_ruby_version
248
- unless required_ruby_version.satisfied_by?(system_ruby.gem_version)
249
- raise InstallError, "#{spec.full_name} requires ruby version #{required_ruby_version}, " \
250
- "which is incompatible with the current version, #{system_ruby}"
251
- end
252
- end
253
- next unless required_rubygems_version = spec.required_rubygems_version
254
- unless required_rubygems_version.satisfied_by?(rubygems_version)
255
- raise InstallError, "#{spec.full_name} requires rubygems version #{required_rubygems_version}, " \
256
- "which is incompatible with the current version, #{rubygems_version}"
232
+ unless spec.matches_current_ruby?
233
+ raise InstallError, "#{spec.full_name} requires ruby version #{spec.required_ruby_version}, " \
234
+ "which is incompatible with the current version, #{Gem.ruby_version}"
257
235
  end
258
- end
259
- end
260
-
261
- def warn_on_incompatible_bundler_deps
262
- bundler_version = Gem::Version.create(Bundler::VERSION)
263
- @definition.specs.each do |spec|
264
- spec.dependencies.each do |dep|
265
- next if dep.type == :development
266
- next unless dep.name == "bundler".freeze
267
- next if dep.requirement.satisfied_by?(bundler_version)
268
-
269
- Bundler.ui.warn "#{spec.name} (#{spec.version}) has dependency" \
270
- " #{SharedHelpers.pretty_dependency(dep)}" \
271
- ", which is unsatisfied by the current bundler version #{VERSION}" \
272
- ", so the dependency is being ignored"
236
+ unless spec.matches_current_rubygems?
237
+ raise InstallError, "#{spec.full_name} requires rubygems version #{spec.required_rubygems_version}, " \
238
+ "which is incompatible with the current version, #{Gem.rubygems_version}"
273
239
  end
274
240
  end
275
241
  end
276
242
 
277
- def can_install_in_parallel?
278
- true
279
- end
280
-
281
243
  def install_in_parallel(size, standalone, force = false)
282
244
  spec_installations = ParallelInstaller.call(self, @definition.specs, size, standalone, force)
283
245
  spec_installations.each do |installation|
@@ -285,22 +247,20 @@ module Bundler
285
247
  end
286
248
  end
287
249
 
288
- def create_bundle_path
289
- SharedHelpers.filesystem_access(Bundler.bundle_path.to_s) do |p|
290
- Bundler.mkdir_p(p)
291
- end unless Bundler.bundle_path.exist?
292
- rescue Errno::EEXIST
293
- raise PathError, "Could not install to path `#{Bundler.bundle_path}` " \
294
- "because a file already exists at that path. Either remove or rename the file so the directory can be created."
295
- end
296
-
297
250
  # returns whether or not a re-resolve was needed
298
251
  def resolve_if_needed(options)
299
- if !@definition.unlocking? && !options["force"] && !options["all-platforms"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
252
+ if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
300
253
  return false if @definition.nothing_changed? && !@definition.missing_specs?
301
254
  end
302
255
 
303
- options["local"] ? @definition.resolve_with_cache! : @definition.resolve_remotely!
256
+ if options["local"]
257
+ @definition.resolve_with_cache!
258
+ elsif options["prefer-local"]
259
+ @definition.resolve_prefering_local!
260
+ else
261
+ @definition.resolve_remotely!
262
+ end
263
+
304
264
  true
305
265
  end
306
266
 
@@ -1,29 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "match_platform"
3
+ require_relative "force_platform"
4
4
 
5
5
  module Bundler
6
6
  class LazySpecification
7
- Identifier = Struct.new(:name, :version, :source, :platform, :dependencies)
8
- class Identifier
9
- include Comparable
10
- def <=>(other)
11
- return unless other.is_a?(Identifier)
12
- [name, version, platform_string] <=> [other.name, other.version, other.platform_string]
13
- end
14
-
15
- protected
16
-
17
- def platform_string
18
- platform_string = platform.to_s
19
- platform_string == Index::RUBY ? Index::NULL : platform_string
20
- end
21
- end
22
-
23
7
  include MatchPlatform
8
+ include ForcePlatform
24
9
 
25
10
  attr_reader :name, :version, :dependencies, :platform
26
- attr_accessor :source, :remote
11
+ attr_accessor :source, :remote, :force_ruby_platform
27
12
 
28
13
  def initialize(name, version, platform, source = nil)
29
14
  @name = name
@@ -32,10 +17,11 @@ module Bundler
32
17
  @platform = platform || Gem::Platform::RUBY
33
18
  @source = source
34
19
  @specification = nil
20
+ @force_ruby_platform = default_force_ruby_platform
35
21
  end
36
22
 
37
23
  def full_name
38
- if platform == Gem::Platform::RUBY || platform.nil?
24
+ if platform == Gem::Platform::RUBY
39
25
  "#{@name}-#{@version}"
40
26
  else
41
27
  "#{@name}-#{@version}-#{platform}"
@@ -46,14 +32,38 @@ module Bundler
46
32
  identifier == other.identifier
47
33
  end
48
34
 
35
+ def eql?(other)
36
+ identifier.eql?(other.identifier)
37
+ end
38
+
39
+ def hash
40
+ identifier.hash
41
+ end
42
+
43
+ ##
44
+ # Does this locked specification satisfy +dependency+?
45
+ #
46
+ # NOTE: Rubygems default requirement is ">= 0", which doesn't match
47
+ # prereleases of 0 versions, like "0.0.0.dev" or "0.0.0.SNAPSHOT". However,
48
+ # bundler users expect those to work. We need to make sure that Gemfile
49
+ # dependencies without explicit requirements (which use ">= 0" under the
50
+ # hood by default) are still valid for locked specs using this kind of
51
+ # versions. The method implements an ad-hoc fix for that. A better solution
52
+ # might be to change default rubygems requirement of dependencies to be ">=
53
+ # 0.A" but that's a major refactoring likely to break things. Hopefully we
54
+ # can attempt it in the future.
55
+ #
56
+
49
57
  def satisfies?(dependency)
50
- @name == dependency.name && dependency.requirement.satisfied_by?(Gem::Version.new(@version))
58
+ effective_requirement = dependency.requirement == Gem::Requirement.default ? Gem::Requirement.new(">= 0.A") : dependency.requirement
59
+
60
+ @name == dependency.name && effective_requirement.satisfied_by?(Gem::Version.new(@version))
51
61
  end
52
62
 
53
63
  def to_lock
54
64
  out = String.new
55
65
 
56
- if platform == Gem::Platform::RUBY || platform.nil?
66
+ if platform == Gem::Platform::RUBY
57
67
  out << " #{name} (#{version})\n"
58
68
  else
59
69
  out << " #{name} (#{version}-#{platform})\n"
@@ -67,19 +77,34 @@ module Bundler
67
77
  out
68
78
  end
69
79
 
70
- def __materialize__
71
- search_object = Bundler.feature_flag.specific_platform? || Bundler.settings[:force_ruby_platform] ? self : Dependency.new(name, version)
72
- @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
73
- source.gemspec.tap {|s| s.source = source }
80
+ def materialize_for_installation
81
+ source.local!
82
+
83
+ candidates = if source.is_a?(Source::Path) || !ruby_platform_materializes_to_ruby_platform?
84
+ target_platform = ruby_platform_materializes_to_ruby_platform? ? platform : local_platform
85
+
86
+ GemHelpers.select_best_platform_match(source.specs.search([name, version]), target_platform)
74
87
  else
75
- search = source.specs.search(search_object).last
76
- if search && Gem::Platform.new(search.platform) != Gem::Platform.new(platform) && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
77
- Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
78
- "because it has different dependencies from the #{platform} version. " \
79
- "To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again."
80
- search = source.specs.search(self).last
88
+ source.specs.search(self)
89
+ end
90
+
91
+ return self if candidates.empty?
92
+
93
+ __materialize__(candidates)
94
+ end
95
+
96
+ def __materialize__(candidates)
97
+ @specification = begin
98
+ search = candidates.reverse.find do |spec|
99
+ spec.is_a?(StubSpecification) ||
100
+ (spec.matches_current_ruby? &&
101
+ spec.matches_current_rubygems?)
102
+ end
103
+ if search.nil? && Bundler.frozen_bundle?
104
+ search = candidates.last
105
+ else
106
+ search.dependencies = dependencies if search && search.full_name == full_name && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
81
107
  end
82
- search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
83
108
  search
84
109
  end
85
110
  end
@@ -89,7 +114,7 @@ module Bundler
89
114
  end
90
115
 
91
116
  def to_s
92
- @__to_s ||= if platform == Gem::Platform::RUBY || platform.nil?
117
+ @__to_s ||= if platform == Gem::Platform::RUBY
93
118
  "#{name} (#{version})"
94
119
  else
95
120
  "#{name} (#{version}-#{platform})"
@@ -97,7 +122,7 @@ module Bundler
97
122
  end
98
123
 
99
124
  def identifier
100
- @__identifier ||= Identifier.new(name, version, source, platform, dependencies)
125
+ @__identifier ||= [name, version, platform.to_s]
101
126
  end
102
127
 
103
128
  def git_version
@@ -105,7 +130,7 @@ module Bundler
105
130
  " #{source.revision[0..6]}"
106
131
  end
107
132
 
108
- private
133
+ private
109
134
 
110
135
  def to_ary
111
136
  nil
@@ -118,5 +143,21 @@ module Bundler
118
143
 
119
144
  @specification.send(method, *args, &blk)
120
145
  end
146
+
147
+ #
148
+ # For backwards compatibility with existing lockfiles, if the most specific
149
+ # locked platform is not a specific platform like x86_64-linux or
150
+ # universal-java-11, then we keep the previous behaviour of resolving the
151
+ # best platform variant at materiliazation time. For previous bundler
152
+ # versions (before 2.2.0) this was always the case (except when the lockfile
153
+ # only included non-ruby platforms), but we're also keeping this behaviour
154
+ # on newer bundlers unless users generate the lockfile from scratch or
155
+ # explicitly add a more specific platform.
156
+ #
157
+ def ruby_platform_materializes_to_ruby_platform?
158
+ generic_platform = generic_local_platform == Gem::Platform::JAVA ? Gem::Platform::JAVA : Gem::Platform::RUBY
159
+
160
+ !Bundler.most_specific_locked_platform?(generic_platform) || force_ruby_platform || Bundler.settings[:force_ruby_platform]
161
+ end
121
162
  end
122
163
  end
@@ -25,7 +25,7 @@ module Bundler
25
25
  out
26
26
  end
27
27
 
28
- private
28
+ private
29
29
 
30
30
  def add_sources
31
31
  definition.send(:sources).lock_sources.each_with_index do |source, idx|
@@ -60,7 +60,7 @@ module Bundler
60
60
  handled = []
61
61
  definition.dependencies.sort_by(&:to_s).each do |dep|
62
62
  next if handled.include?(dep.name)
63
- out << dep.to_lock
63
+ out << dep.to_lock << "\n"
64
64
  handled << dep.name
65
65
  end
66
66
  end
@@ -71,7 +71,7 @@ module Bundler
71
71
  end
72
72
 
73
73
  def add_bundled_with
74
- add_section("BUNDLED WITH", definition.locked_bundler_version.to_s)
74
+ add_section("BUNDLED WITH", Bundler::VERSION)
75
75
  end
76
76
 
77
77
  def add_section(name, value)
@@ -1,16 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- #--
4
- # Some versions of the Bundler 1.1 RC series introduced corrupted
5
- # lockfiles. There were two major problems:
6
- #
7
- # * multiple copies of the same GIT section appeared in the lockfile
8
- # * when this happened, those sections got multiple copies of gems
9
- # in those sections.
10
- #
11
- # As a result, Bundler 1.1 contains code that fixes the earlier
12
- # corruption. We will remove this fix-up code in Bundler 1.2.
13
-
14
3
  module Bundler
15
4
  class LockfileParser
16
5
  attr_reader :sources, :dependencies, :specs, :platforms, :bundler_version, :ruby_version
@@ -57,6 +46,16 @@ module Bundler
57
46
  attributes
58
47
  end
59
48
 
49
+ def self.bundled_with
50
+ lockfile = Bundler.default_lockfile
51
+ return unless lockfile.file?
52
+
53
+ lockfile_contents = Bundler.read_file(lockfile)
54
+ return unless lockfile_contents.include?(BUNDLED)
55
+
56
+ lockfile_contents.split(BUNDLED).last.strip
57
+ end
58
+
60
59
  def initialize(lockfile)
61
60
  @platforms = []
62
61
  @sources = []
@@ -64,9 +63,7 @@ module Bundler
64
63
  @state = nil
65
64
  @specs = {}
66
65
 
67
- @rubygems_aggregate = Source::Rubygems.new
68
-
69
- if lockfile.match(/<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|/)
66
+ if lockfile.match?(/<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|/)
70
67
  raise LockfileError, "Your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} contains merge conflicts.\n" \
71
68
  "Run `git checkout HEAD -- #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` first to get a clean lock."
72
69
  end
@@ -83,38 +80,29 @@ module Bundler
83
80
  @state = :ruby
84
81
  elsif line == BUNDLED
85
82
  @state = :bundled_with
86
- elsif line =~ /^[^\s]/
83
+ elsif /^[^\s]/.match?(line)
87
84
  @state = nil
88
85
  elsif @state
89
86
  send("parse_#{@state}", line)
90
87
  end
91
88
  end
92
- @sources << @rubygems_aggregate unless Bundler.feature_flag.disable_multisource?
93
89
  @specs = @specs.values.sort_by(&:identifier)
94
- warn_for_outdated_bundler_version
95
90
  rescue ArgumentError => e
96
91
  Bundler.ui.debug(e)
97
92
  raise LockfileError, "Your lockfile is unreadable. Run `rm #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` " \
98
93
  "and then `bundle install` to generate a new lockfile."
99
94
  end
100
95
 
101
- def warn_for_outdated_bundler_version
102
- return unless bundler_version
103
- prerelease_text = bundler_version.prerelease? ? " --pre" : ""
104
- current_version = Gem::Version.create(Bundler::VERSION)
105
- return unless current_version < bundler_version
106
- Bundler.ui.warn "Warning: the running version of Bundler (#{current_version}) is older " \
107
- "than the version that created the lockfile (#{bundler_version}). We suggest you to " \
108
- "upgrade to the version that created the lockfile by running `gem install " \
109
- "bundler:#{bundler_version}#{prerelease_text}`.\n"
96
+ def may_include_redundant_platform_specific_gems?
97
+ bundler_version.nil? || bundler_version < Gem::Version.new("1.16.2")
110
98
  end
111
99
 
112
- private
100
+ private
113
101
 
114
102
  TYPES = {
115
- GIT => Bundler::Source::Git,
116
- GEM => Bundler::Source::Rubygems,
117
- PATH => Bundler::Source::Path,
103
+ GIT => Bundler::Source::Git,
104
+ GEM => Bundler::Source::Rubygems,
105
+ PATH => Bundler::Source::Path,
118
106
  PLUGIN => Bundler::Plugin,
119
107
  }.freeze
120
108
 
@@ -127,23 +115,11 @@ module Bundler
127
115
  @sources << @current_source
128
116
  when GIT
129
117
  @current_source = TYPES[@type].from_lock(@opts)
130
- # Strip out duplicate GIT sections
131
- if @sources.include?(@current_source)
132
- @current_source = @sources.find {|s| s == @current_source }
133
- else
134
- @sources << @current_source
135
- end
118
+ @sources << @current_source
136
119
  when GEM
137
- if Bundler.feature_flag.disable_multisource?
138
- @opts["remotes"] = @opts.delete("remote")
139
- @current_source = TYPES[@type].from_lock(@opts)
140
- @sources << @current_source
141
- else
142
- Array(@opts["remote"]).each do |url|
143
- @rubygems_aggregate.add_remote(url)
144
- end
145
- @current_source = @rubygems_aggregate
146
- end
120
+ @opts["remotes"] = Array(@opts.delete("remote")).reverse
121
+ @current_source = TYPES[@type].from_lock(@opts)
122
+ @sources << @current_source
147
123
  when PLUGIN
148
124
  @current_source = Plugin.source_from_lock(@opts)
149
125
  @sources << @current_source
@@ -221,10 +197,9 @@ module Bundler
221
197
  platform = platform ? Gem::Platform.new(platform) : Gem::Platform::RUBY
222
198
  @current_spec = LazySpecification.new(name, version, platform)
223
199
  @current_spec.source = @current_source
200
+ @current_source.add_dependency_names(name)
224
201
 
225
- # Avoid introducing multiple copies of the same spec (caused by
226
- # duplicate GIT sections)
227
- @specs[@current_spec.identifier] ||= @current_spec
202
+ @specs[@current_spec.identifier] = @current_spec
228
203
  elsif spaces.size == 6
229
204
  version = version.split(",").map(&:strip) if version
230
205
  dep = Gem::Dependency.new(name, version)
@@ -0,0 +1 @@
1
+ # Ignore all files in this directory
@@ -1,13 +1,13 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-ADD" "1" "January 2020" "" ""
4
+ .TH "BUNDLE\-ADD" "1" "December 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBbundle add\fR \fIGEM_NAME\fR [\-\-group=GROUP] [\-\-version=VERSION] [\-\-source=SOURCE] [\-\-git=GIT] [\-\-branch=BRANCH] [\-\-skip\-install] [\-\-strict] [\-\-optimistic]
10
+ \fBbundle add\fR \fIGEM_NAME\fR [\-\-group=GROUP] [\-\-version=VERSION] [\-\-source=SOURCE] [\-\-path=PATH] [\-\-git=GIT] [\-\-github=GITHUB] [\-\-branch=BRANCH] [\-\-ref=REF] [\-\-skip\-install] [\-\-strict] [\-\-optimistic]
11
11
  .
12
12
  .SH "DESCRIPTION"
13
13
  Adds the named gem to the Gemfile and run \fBbundle install\fR\. \fBbundle install\fR can be avoided by using the flag \fB\-\-skip\-install\fR\.
@@ -41,26 +41,42 @@ Specify version requirements(s) for the added gem\.
41
41
  Specify the group(s) for the added gem\. Multiple groups should be separated by commas\.
42
42
  .
43
43
  .TP
44
- \fB\-\-source\fR, , \fB\-s\fR
44
+ \fB\-\-source\fR, \fB\-s\fR
45
45
  Specify the source for the added gem\.
46
46
  .
47
47
  .TP
48
+ \fB\-\-require\fR, \fB\-r\fR
49
+ Adds require path to gem\. Provide false, or a path as a string\.
50
+ .
51
+ .TP
52
+ \fB\-\-path\fR
53
+ Specify the file system path for the added gem\.
54
+ .
55
+ .TP
48
56
  \fB\-\-git\fR
49
57
  Specify the git source for the added gem\.
50
58
  .
51
59
  .TP
60
+ \fB\-\-github\fR
61
+ Specify the github source for the added gem\.
62
+ .
63
+ .TP
52
64
  \fB\-\-branch\fR
53
65
  Specify the git branch for the added gem\.
54
66
  .
55
67
  .TP
68
+ \fB\-\-ref\fR
69
+ Specify the git ref for the added gem\.
70
+ .
71
+ .TP
56
72
  \fB\-\-skip\-install\fR
57
73
  Adds the gem to the Gemfile but does not install it\.
58
74
  .
59
75
  .TP
60
76
  \fB\-\-optimistic\fR
61
- Adds optimistic declaration of version
77
+ Adds optimistic declaration of version\.
62
78
  .
63
79
  .TP
64
80
  \fB\-\-strict\fR
65
- Adds strict declaration of version
81
+ Adds strict declaration of version\.
66
82