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
@@ -21,16 +21,7 @@ module Bundler
21
21
  class InstallError < BundlerError; status_code(5); end
22
22
 
23
23
  # Internal error, should be rescued
24
- class VersionConflict < BundlerError
25
- attr_reader :conflicts
26
-
27
- def initialize(conflicts, msg = nil)
28
- super(msg)
29
- @conflicts = conflicts
30
- end
31
-
32
- status_code(6)
33
- end
24
+ class SolveFailure < BundlerError; status_code(6); end
34
25
 
35
26
  class GemNotFound < BundlerError; status_code(7); end
36
27
  class InstallHookError < BundlerError; status_code(8); end
@@ -41,21 +32,23 @@ module Bundler
41
32
  class GemspecError < BundlerError; status_code(14); end
42
33
  class InvalidOption < BundlerError; status_code(15); end
43
34
  class ProductionError < BundlerError; status_code(16); end
35
+
44
36
  class HTTPError < BundlerError
45
37
  status_code(17)
46
38
  def filter_uri(uri)
47
39
  URICredentialsFilter.credential_filtered_uri(uri)
48
40
  end
49
41
  end
42
+
50
43
  class RubyVersionMismatch < BundlerError; status_code(18); end
51
44
  class SecurityError < BundlerError; status_code(19); end
52
45
  class LockfileError < BundlerError; status_code(20); end
53
46
  class CyclicDependencyError < BundlerError; status_code(21); end
54
47
  class GemfileLockNotFound < BundlerError; status_code(22); end
55
48
  class PluginError < BundlerError; status_code(29); end
56
- class SudoNotPermittedError < BundlerError; status_code(30); end
57
49
  class ThreadCreationError < BundlerError; status_code(33); end
58
50
  class APIResponseMismatchError < BundlerError; status_code(34); end
51
+ class APIResponseInvalidDependenciesError < BundlerError; status_code(35); end
59
52
  class GemfileEvalError < GemfileError; end
60
53
  class MarshalError < StandardError; end
61
54
 
@@ -74,10 +67,22 @@ module Bundler
74
67
  end
75
68
  end
76
69
 
70
+ def permission_type
71
+ case @permission_type
72
+ when :create
73
+ "executable permissions for all parent directories and write permissions for `#{parent_folder}`"
74
+ else
75
+ "#{@permission_type} permissions for that path"
76
+ end
77
+ end
78
+
79
+ def parent_folder
80
+ File.dirname(@path)
81
+ end
82
+
77
83
  def message
78
84
  "There was an error while trying to #{action} `#{@path}`. " \
79
- "It is likely that you need to grant #{@permission_type} permissions " \
80
- "for that path."
85
+ "It is likely that you need to grant #{permission_type}."
81
86
  end
82
87
 
83
88
  status_code(23)
@@ -121,7 +126,7 @@ module Bundler
121
126
 
122
127
  class VirtualProtocolError < BundlerError
123
128
  def message
124
- "There was an error relating to virtualization and file access." \
129
+ "There was an error relating to virtualization and file access. " \
125
130
  "It is likely that you need to grant access to or mount some file system correctly."
126
131
  end
127
132
 
@@ -155,4 +160,16 @@ module Bundler
155
160
 
156
161
  status_code(32)
157
162
  end
163
+
164
+ class DirectoryRemovalError < BundlerError
165
+ def initialize(orig_exception, msg)
166
+ full_message = "#{msg}.\n" \
167
+ "The underlying error was #{orig_exception.class}: #{orig_exception.message}, with backtrace:\n" \
168
+ " #{orig_exception.backtrace.join("\n ")}\n\n" \
169
+ "Bundler Error Backtrace:"
170
+ super(full_message)
171
+ end
172
+
173
+ status_code(36)
174
+ end
158
175
  end
@@ -27,27 +27,18 @@ module Bundler
27
27
 
28
28
  (1..10).each {|v| define_method("bundler_#{v}_mode?") { major_version >= v } }
29
29
 
30
- settings_flag(:allow_bundler_dependency_conflicts) { bundler_3_mode? }
31
30
  settings_flag(:allow_offline_install) { bundler_3_mode? }
32
31
  settings_flag(:auto_clean_without_path) { bundler_3_mode? }
33
- settings_flag(:auto_config_jobs) { bundler_3_mode? }
34
32
  settings_flag(:cache_all) { bundler_3_mode? }
35
33
  settings_flag(:default_install_uses_path) { bundler_3_mode? }
36
- settings_flag(:deployment_means_frozen) { bundler_3_mode? }
37
- settings_flag(:disable_multisource) { bundler_3_mode? }
38
34
  settings_flag(:forget_cli_options) { bundler_3_mode? }
39
35
  settings_flag(:global_gem_cache) { bundler_3_mode? }
40
- settings_flag(:only_update_to_newer_versions) { bundler_3_mode? }
41
36
  settings_flag(:path_relative_to_cwd) { bundler_3_mode? }
42
37
  settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
43
38
  settings_flag(:print_only_version_number) { bundler_3_mode? }
44
39
  settings_flag(:setup_makes_kernel_gem_public) { !bundler_3_mode? }
45
- settings_flag(:skip_default_git_sources) { bundler_3_mode? }
46
- settings_flag(:specific_platform) { bundler_3_mode? }
47
40
  settings_flag(:suppress_install_using_messages) { bundler_3_mode? }
48
- settings_flag(:unlock_source_unlocks_spec) { !bundler_3_mode? }
49
41
  settings_flag(:update_requires_all_flag) { bundler_4_mode? }
50
- settings_flag(:use_gem_version_promoter_for_major_updates) { bundler_3_mode? }
51
42
 
52
43
  settings_option(:default_cli_command) { bundler_3_mode? ? :cli_help : :install }
53
44
 
@@ -19,14 +19,12 @@ module Bundler
19
19
  end
20
20
 
21
21
  def fetch_uri
22
- @fetch_uri ||= begin
23
- if remote_uri.host == "rubygems.org"
24
- uri = remote_uri.dup
25
- uri.host = "index.rubygems.org"
26
- uri
27
- else
28
- remote_uri
29
- end
22
+ @fetch_uri ||= if remote_uri.host == "rubygems.org"
23
+ uri = remote_uri.dup
24
+ uri.host = "index.rubygems.org"
25
+ uri
26
+ else
27
+ remote_uri
30
28
  end
31
29
  end
32
30
 
@@ -38,7 +36,7 @@ module Bundler
38
36
  false
39
37
  end
40
38
 
41
- private
39
+ private
42
40
 
43
41
  def log_specs(debug_msg)
44
42
  if Bundler.ui.debug?
@@ -12,17 +12,15 @@ module Bundler
12
12
  method = instance_method(method_name)
13
13
  undef_method(method_name)
14
14
  define_method(method_name) do |*args, &blk|
15
- begin
16
- method.bind(self).call(*args, &blk)
17
- rescue NetworkDownError, CompactIndexClient::Updater::MisMatchedChecksumError => e
18
- raise HTTPError, e.message
19
- rescue AuthenticationRequiredError
20
- # Fail since we got a 401 from the server.
21
- raise
22
- rescue HTTPError => e
23
- Bundler.ui.trace(e)
24
- nil
25
- end
15
+ method.bind(self).call(*args, &blk)
16
+ rescue NetworkDownError, CompactIndexClient::Updater::MisMatchedChecksumError => e
17
+ raise HTTPError, e.message
18
+ rescue AuthenticationRequiredError
19
+ # Fail since we got a 401 from the server.
20
+ raise
21
+ rescue HTTPError => e
22
+ Bundler.ui.trace(e)
23
+ nil
26
24
  end
27
25
  end
28
26
 
@@ -57,22 +55,17 @@ module Bundler
57
55
  gem_info
58
56
  end
59
57
 
60
- def fetch_spec(spec)
61
- spec -= [nil, "ruby", ""]
62
- contents = compact_index_client.spec(*spec)
63
- return nil if contents.nil?
64
- contents.unshift(spec.first)
65
- contents[3].map! {|d| Gem::Dependency.new(*d) }
66
- EndpointSpecification.new(*contents)
67
- end
68
- compact_index_request :fetch_spec
69
-
70
58
  def available?
71
- return nil unless SharedHelpers.md5_available?
72
- user_home = Bundler.user_home
73
- return nil unless user_home.directory? && user_home.writable?
59
+ unless SharedHelpers.md5_available?
60
+ Bundler.ui.debug("FIPS mode is enabled, bundler can't use the CompactIndex API")
61
+ return nil
62
+ end
63
+ if fetch_uri.scheme == "file"
64
+ Bundler.ui.debug("Using a local server, bundler won't use the CompactIndex API")
65
+ return false
66
+ end
74
67
  # Read info file checksums out of /versions, so we can know if gems are up to date
75
- fetch_uri.scheme != "file" && compact_index_client.update_and_parse_checksums!
68
+ compact_index_client.update_and_parse_checksums!
76
69
  rescue CompactIndexClient::Updater::MisMatchedChecksumError => e
77
70
  Bundler.ui.debug(e.message)
78
71
  nil
@@ -83,7 +76,7 @@ module Bundler
83
76
  true
84
77
  end
85
78
 
86
- private
79
+ private
87
80
 
88
81
  def compact_index_client
89
82
  @compact_index_client ||=
@@ -111,7 +104,7 @@ module Bundler
111
104
  def bundle_worker(func = nil)
112
105
  @bundle_worker ||= begin
113
106
  worker_name = "Compact Index (#{display_uri.host})"
114
- Bundler::Worker.new(Bundler.current_ruby.rbx? ? 1 : 25, worker_name, func)
107
+ Bundler::Worker.new(Bundler.settings.processor_count, worker_name, func)
115
108
  end
116
109
  @bundle_worker.tap do |worker|
117
110
  worker.instance_variable_set(:@func, func) if func
@@ -55,7 +55,7 @@ module Bundler
55
55
  gem_list = []
56
56
  gem_names.each_slice(Source::Rubygems::API_REQUEST_SIZE) do |names|
57
57
  marshalled_deps = downloader.fetch(dependency_api_uri(names)).body
58
- gem_list.concat(Bundler.load_marshal(marshalled_deps))
58
+ gem_list.concat(Bundler.safe_load_marshal(marshalled_deps))
59
59
  end
60
60
  gem_list
61
61
  end
@@ -14,8 +14,10 @@ module Bundler
14
14
  def fetch(uri, headers = {}, counter = 0)
15
15
  raise HTTPError, "Too many redirects" if counter >= redirect_limit
16
16
 
17
+ filtered_uri = URICredentialsFilter.credential_filtered_uri(uri)
18
+
17
19
  response = request(uri, headers)
18
- Bundler.ui.debug("HTTP #{response.code} #{response.message} #{uri}")
20
+ Bundler.ui.debug("HTTP #{response.code} #{response.message} #{filtered_uri}")
19
21
 
20
22
  case response
21
23
  when Net::HTTPSuccess, Net::HTTPNotModified
@@ -40,7 +42,7 @@ module Bundler
40
42
  raise BadAuthenticationError, uri.host if uri.userinfo
41
43
  raise AuthenticationRequiredError, uri.host
42
44
  when Net::HTTPNotFound
43
- raise FallbackError, "Net::HTTPNotFound: #{URICredentialsFilter.credential_filtered_uri(uri)}"
45
+ raise FallbackError, "Net::HTTPNotFound: #{filtered_uri}"
44
46
  else
45
47
  raise HTTPError, "#{response.class}#{": #{response.body}" unless response.body.empty?}"
46
48
  end
@@ -49,7 +51,9 @@ module Bundler
49
51
  def request(uri, headers)
50
52
  validate_uri_scheme!(uri)
51
53
 
52
- Bundler.ui.debug "HTTP GET #{uri}"
54
+ filtered_uri = URICredentialsFilter.credential_filtered_uri(uri)
55
+
56
+ Bundler.ui.debug "HTTP GET #{filtered_uri}"
53
57
  req = Net::HTTP::Get.new uri.request_uri, headers
54
58
  if uri.user
55
59
  user = CGI.unescape(uri.user)
@@ -57,27 +61,23 @@ module Bundler
57
61
  req.basic_auth(user, password)
58
62
  end
59
63
  connection.request(uri, req)
60
- rescue NoMethodError => e
61
- raise unless ["undefined method", "use_ssl="].all? {|snippet| e.message.include? snippet }
62
- raise LoadError.new("cannot load such file -- openssl")
63
64
  rescue OpenSSL::SSL::SSLError
64
65
  raise CertificateFailureError.new(uri)
65
66
  rescue *HTTP_ERRORS => e
66
67
  Bundler.ui.trace e
67
- case e.message
68
- when /host down:/, /getaddrinfo: nodename nor servname provided/
68
+ if e.is_a?(SocketError) || e.message.to_s.include?("host down:")
69
69
  raise NetworkDownError, "Could not reach host #{uri.host}. Check your network " \
70
70
  "connection and try again."
71
71
  else
72
- raise HTTPError, "Network error while fetching #{URICredentialsFilter.credential_filtered_uri(uri)}" \
72
+ raise HTTPError, "Network error while fetching #{filtered_uri}" \
73
73
  " (#{e})"
74
74
  end
75
75
  end
76
76
 
77
- private
77
+ private
78
78
 
79
79
  def validate_uri_scheme!(uri)
80
- return if uri.scheme =~ /\Ahttps?\z/
80
+ return if /\Ahttps?\z/.match?(uri.scheme)
81
81
  raise InvalidOption,
82
82
  "The request uri `#{uri}` has an invalid scheme (`#{uri.scheme}`). " \
83
83
  "Did you mean `http` or `https`?"
@@ -1,14 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "base"
4
- require "rubygems/remote_fetcher"
5
4
 
6
5
  module Bundler
7
6
  class Fetcher
8
7
  class Index < Base
9
8
  def specs(_gem_names)
10
9
  Bundler.rubygems.fetch_all_remote_specs(remote)
11
- rescue Gem::RemoteFetcher::FetchError, OpenSSL::SSL::SSLError, Net::HTTPFatalError => e
10
+ rescue Gem::RemoteFetcher::FetchError => e
12
11
  case e.message
13
12
  when /certificate verify failed/
14
13
  raise CertificateFailureError.new(display_uri)
@@ -19,36 +18,9 @@ module Bundler
19
18
  raise BadAuthenticationError, remote_uri if remote_uri.userinfo
20
19
  raise AuthenticationRequiredError, remote_uri
21
20
  else
22
- Bundler.ui.trace e
23
- raise HTTPError, "Could not fetch specs from #{display_uri}"
21
+ raise HTTPError, "Could not fetch specs from #{display_uri} due to underlying error <#{e.message}>"
24
22
  end
25
23
  end
26
-
27
- def fetch_spec(spec)
28
- spec -= [nil, "ruby", ""]
29
- spec_file_name = "#{spec.join "-"}.gemspec"
30
-
31
- uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz")
32
- if uri.scheme == "file"
33
- path = Bundler.rubygems.correct_for_windows_path(uri.path)
34
- Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path))
35
- elsif cached_spec_path = gemspec_cached_path(spec_file_name)
36
- Bundler.load_gemspec(cached_spec_path)
37
- else
38
- Bundler.load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body)
39
- end
40
- rescue MarshalError
41
- raise HTTPError, "Gemspec #{spec} contained invalid data.\n" \
42
- "Your network or your gem server is probably having issues right now."
43
- end
44
-
45
- private
46
-
47
- # cached gem specification path, if one exists
48
- def gemspec_cached_path(spec_file_name)
49
- paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }
50
- paths.find {|path| File.file? path }
51
- end
52
24
  end
53
25
  end
54
26
  end
@@ -20,6 +20,7 @@ module Bundler
20
20
  class TooManyRequestsError < HTTPError; end
21
21
  # This error is raised if the API returns a 413 (only printed in verbose)
22
22
  class FallbackError < HTTPError; end
23
+
23
24
  # This is the error raised if OpenSSL fails the cert verification
24
25
  class CertificateFailureError < HTTPError
25
26
  def initialize(remote_uri)
@@ -28,28 +29,29 @@ module Bundler
28
29
  " is a chance you are experiencing a man-in-the-middle attack, but" \
29
30
  " most likely your system doesn't have the CA certificates needed" \
30
31
  " for verification. For information about OpenSSL certificates, see" \
31
- " http://bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile" \
32
- " sources and change 'https' to 'http'."
32
+ " https://railsapps.github.io/openssl-certificate-verify-failed.html."
33
33
  end
34
34
  end
35
+
35
36
  # This is the error raised when a source is HTTPS and OpenSSL didn't load
36
37
  class SSLError < HTTPError
37
38
  def initialize(msg = nil)
38
39
  super msg || "Could not load OpenSSL.\n" \
39
- "You must recompile Ruby with OpenSSL support or change the sources in your " \
40
- "Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL " \
41
- "using RVM are available at rvm.io/packages/openssl."
40
+ "You must recompile Ruby with OpenSSL support."
42
41
  end
43
42
  end
43
+
44
44
  # This error is raised if HTTP authentication is required, but not provided.
45
45
  class AuthenticationRequiredError < HTTPError
46
46
  def initialize(remote_uri)
47
47
  remote_uri = filter_uri(remote_uri)
48
48
  super "Authentication is required for #{remote_uri}.\n" \
49
49
  "Please supply credentials for this source. You can do this by running:\n" \
50
- " bundle config set #{remote_uri} username:password"
50
+ "`bundle config set --global #{remote_uri} username:password`\n" \
51
+ "or by storing the credentials in the `#{Settings.key_for(remote_uri)}` environment variable"
51
52
  end
52
53
  end
54
+
53
55
  # This error is raised if HTTP authentication is provided, but incorrect.
54
56
  class BadAuthenticationError < HTTPError
55
57
  def initialize(remote_uri)
@@ -69,8 +71,8 @@ module Bundler
69
71
  :HTTPUnsupportedMediaType, :HTTPVersionNotSupported].freeze
70
72
  FAIL_ERRORS = begin
71
73
  fail_errors = [AuthenticationRequiredError, BadAuthenticationError, FallbackError]
72
- fail_errors << Gem::Requirement::BadRequirementError if defined?(Gem::Requirement::BadRequirementError)
73
- fail_errors.concat(NET_ERRORS.map {|e| SharedHelpers.const_get_safely(e, Net) }.compact)
74
+ fail_errors << Gem::Requirement::BadRequirementError
75
+ fail_errors.concat(NET_ERRORS.map {|e| Net.const_get(e) })
74
76
  end.freeze
75
77
 
76
78
  class << self
@@ -120,7 +122,6 @@ module Bundler
120
122
 
121
123
  # return the specs in the bundler format as an index
122
124
  def specs(gem_names, source)
123
- old = Bundler.rubygems.sources
124
125
  index = Bundler::Index.new
125
126
 
126
127
  if Bundler::Fetcher.disable_endpoint
@@ -128,18 +129,15 @@ module Bundler
128
129
  specs = fetchers.last.specs(gem_names)
129
130
  else
130
131
  specs = []
131
- fetchers.shift until fetchers.first.available? || fetchers.empty?
132
- fetchers.dup.each do |f|
133
- break unless f.api_fetcher? && !gem_names || !specs = f.specs(gem_names)
134
- fetchers.delete(f)
132
+ @fetchers = fetchers.drop_while do |f|
133
+ !f.available? || (f.api_fetcher? && !gem_names) || !specs = f.specs(gem_names)
135
134
  end
136
135
  @use_api = false if fetchers.none?(&:api_fetcher?)
137
136
  end
138
137
 
139
138
  specs.each do |name, version, platform, dependencies, metadata|
140
- next if name == "bundler"
141
139
  spec = if dependencies
142
- EndpointSpecification.new(name, version, platform, dependencies, metadata)
140
+ EndpointSpecification.new(name, version, platform, self, dependencies, metadata)
143
141
  else
144
142
  RemoteSpecification.new(name, version, platform, self)
145
143
  end
@@ -152,8 +150,6 @@ module Bundler
152
150
  rescue CertificateFailureError
153
151
  Bundler.ui.info "" if gem_names && use_api # newline after dots
154
152
  raise
155
- ensure
156
- Bundler.rubygems.sources = old
157
153
  end
158
154
 
159
155
  def use_api
@@ -216,7 +212,7 @@ module Bundler
216
212
  "#<#{self.class}:0x#{object_id} uri=#{uri}>"
217
213
  end
218
214
 
219
- private
215
+ private
220
216
 
221
217
  FETCHERS = [CompactIndex, Dependency, Index].freeze
222
218
 
@@ -229,6 +225,8 @@ module Bundler
229
225
  "BUILDBOX" => "buildbox",
230
226
  "GO_SERVER_URL" => "go",
231
227
  "SNAP_CI" => "snap",
228
+ "GITLAB_CI" => "gitlab",
229
+ "GITHUB_ACTIONS" => "github",
232
230
  "CI_NAME" => ENV["CI_NAME"],
233
231
  "CI" => "ci",
234
232
  }
@@ -238,12 +236,12 @@ module Bundler
238
236
  def connection
239
237
  @connection ||= begin
240
238
  needs_ssl = remote_uri.scheme == "https" ||
241
- Bundler.settings[:ssl_verify_mode] ||
242
- Bundler.settings[:ssl_client_cert]
239
+ Bundler.settings[:ssl_verify_mode] ||
240
+ Bundler.settings[:ssl_client_cert]
243
241
  raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
244
242
 
245
243
  con = PersistentHTTP.new :name => "bundler", :proxy => :ENV
246
- if gem_proxy = Bundler.rubygems.configuration[:http_proxy]
244
+ if gem_proxy = Gem.configuration[:http_proxy]
247
245
  con.proxy = Bundler::URI.parse(gem_proxy) if gem_proxy != :no_proxy
248
246
  end
249
247
 
@@ -254,8 +252,8 @@ module Bundler
254
252
  end
255
253
 
256
254
  ssl_client_cert = Bundler.settings[:ssl_client_cert] ||
257
- (Bundler.rubygems.configuration.ssl_client_cert if
258
- Bundler.rubygems.configuration.respond_to?(:ssl_client_cert))
255
+ (Gem.configuration.ssl_client_cert if
256
+ Gem.configuration.respond_to?(:ssl_client_cert))
259
257
  if ssl_client_cert
260
258
  pem = File.read(ssl_client_cert)
261
259
  con.cert = OpenSSL::X509::Certificate.new(pem)
@@ -273,8 +271,7 @@ module Bundler
273
271
  # cached gem specification path, if one exists
274
272
  def gemspec_cached_path(spec_file_name)
275
273
  paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }
276
- paths = paths.select {|path| File.file? path }
277
- paths.first
274
+ paths.find {|path| File.file? path }
278
275
  end
279
276
 
280
277
  HTTP_ERRORS = [
@@ -287,8 +284,8 @@ module Bundler
287
284
  def bundler_cert_store
288
285
  store = OpenSSL::X509::Store.new
289
286
  ssl_ca_cert = Bundler.settings[:ssl_ca_cert] ||
290
- (Bundler.rubygems.configuration.ssl_ca_cert if
291
- Bundler.rubygems.configuration.respond_to?(:ssl_ca_cert))
287
+ (Gem.configuration.ssl_ca_cert if
288
+ Gem.configuration.respond_to?(:ssl_ca_cert))
292
289
  if ssl_ca_cert
293
290
  if File.directory? ssl_ca_cert
294
291
  store.add_path ssl_ca_cert
@@ -302,8 +299,6 @@ module Bundler
302
299
  store
303
300
  end
304
301
 
305
- private
306
-
307
302
  def remote_uri
308
303
  @remote.uri
309
304
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ module ForcePlatform
5
+ private
6
+
7
+ # The `:force_ruby_platform` value used by dependencies for resolution, and
8
+ # by locked specifications for materialization is `false` by default, except
9
+ # for TruffleRuby. TruffleRuby generally needs to force the RUBY platform
10
+ # variant unless the name is explicitly allowlisted.
11
+
12
+ def default_force_ruby_platform
13
+ return false unless RUBY_ENGINE == "truffleruby"
14
+
15
+ !Gem::Platform::REUSE_AS_BINARY_ON_TRUFFLERUBY.include?(name)
16
+ end
17
+ end
18
+ end