bundler 2.2.27 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (353) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1328 -4
  3. data/README.md +4 -8
  4. data/bundler.gemspec +11 -11
  5. data/exe/bundle +5 -26
  6. data/exe/bundler +1 -1
  7. data/lib/bundler/.document +1 -0
  8. data/lib/bundler/build_metadata.rb +4 -4
  9. data/lib/bundler/capistrano.rb +1 -1
  10. data/lib/bundler/checksum.rb +254 -0
  11. data/lib/bundler/ci_detector.rb +75 -0
  12. data/lib/bundler/cli/add.rb +7 -5
  13. data/lib/bundler/cli/binstubs.rb +10 -6
  14. data/lib/bundler/cli/cache.rb +1 -1
  15. data/lib/bundler/cli/check.rb +4 -4
  16. data/lib/bundler/cli/common.rb +13 -3
  17. data/lib/bundler/cli/config.rb +18 -8
  18. data/lib/bundler/cli/console.rb +2 -5
  19. data/lib/bundler/cli/doctor.rb +16 -9
  20. data/lib/bundler/cli/exec.rb +2 -1
  21. data/lib/bundler/cli/fund.rb +1 -1
  22. data/lib/bundler/cli/gem.rb +153 -40
  23. data/lib/bundler/cli/info.rb +27 -17
  24. data/lib/bundler/cli/init.rb +6 -2
  25. data/lib/bundler/cli/inject.rb +1 -1
  26. data/lib/bundler/cli/install.rb +34 -42
  27. data/lib/bundler/cli/issue.rb +5 -4
  28. data/lib/bundler/cli/lock.rb +54 -28
  29. data/lib/bundler/cli/open.rb +9 -9
  30. data/lib/bundler/cli/outdated.rb +34 -29
  31. data/lib/bundler/cli/platform.rb +8 -6
  32. data/lib/bundler/cli/plugin.rb +9 -15
  33. data/lib/bundler/cli/pristine.rb +38 -30
  34. data/lib/bundler/cli/remove.rb +1 -2
  35. data/lib/bundler/cli/show.rb +5 -5
  36. data/lib/bundler/cli/update.rb +12 -7
  37. data/lib/bundler/cli/viz.rb +1 -1
  38. data/lib/bundler/cli.rb +265 -313
  39. data/lib/bundler/compact_index_client/cache.rb +53 -67
  40. data/lib/bundler/compact_index_client/cache_file.rb +148 -0
  41. data/lib/bundler/compact_index_client/gem_parser.rb +7 -3
  42. data/lib/bundler/compact_index_client/parser.rb +84 -0
  43. data/lib/bundler/compact_index_client/updater.rb +73 -77
  44. data/lib/bundler/compact_index_client.rb +59 -87
  45. data/lib/bundler/constants.rb +9 -2
  46. data/lib/bundler/current_ruby.rb +12 -16
  47. data/lib/bundler/definition.rb +604 -347
  48. data/lib/bundler/dependency.rb +33 -71
  49. data/lib/bundler/digest.rb +71 -0
  50. data/lib/bundler/dsl.rb +136 -102
  51. data/lib/bundler/endpoint_specification.rb +42 -16
  52. data/lib/bundler/env.rb +5 -7
  53. data/lib/bundler/environment_preserver.rb +8 -22
  54. data/lib/bundler/errors.rb +113 -13
  55. data/lib/bundler/feature_flag.rb +1 -2
  56. data/lib/bundler/fetcher/base.rb +11 -11
  57. data/lib/bundler/fetcher/compact_index.rb +32 -52
  58. data/lib/bundler/fetcher/dependency.rb +3 -7
  59. data/lib/bundler/fetcher/downloader.rb +17 -16
  60. data/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
  61. data/lib/bundler/fetcher/index.rb +2 -29
  62. data/lib/bundler/fetcher.rb +98 -83
  63. data/lib/bundler/force_platform.rb +16 -0
  64. data/lib/bundler/friendly_errors.rb +29 -40
  65. data/lib/bundler/gem_helper.rb +12 -24
  66. data/lib/bundler/gem_helpers.rb +47 -7
  67. data/lib/bundler/gem_version_promoter.rb +68 -109
  68. data/lib/bundler/graph.rb +9 -9
  69. data/lib/bundler/index.rb +71 -79
  70. data/lib/bundler/injector.rb +25 -13
  71. data/lib/bundler/inline.rb +41 -28
  72. data/lib/bundler/installer/gem_installer.rb +22 -13
  73. data/lib/bundler/installer/parallel_installer.rb +19 -66
  74. data/lib/bundler/installer/standalone.rb +58 -17
  75. data/lib/bundler/installer.rb +31 -93
  76. data/lib/bundler/lazy_specification.rb +151 -72
  77. data/lib/bundler/lockfile_generator.rb +13 -4
  78. data/lib/bundler/lockfile_parser.rb +146 -71
  79. data/lib/bundler/man/bundle-add.1 +54 -44
  80. data/lib/bundler/man/bundle-add.1.ronn +62 -21
  81. data/lib/bundler/man/bundle-binstubs.1 +10 -19
  82. data/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
  83. data/lib/bundler/man/bundle-cache.1 +38 -25
  84. data/lib/bundler/man/bundle-cache.1.ronn +40 -4
  85. data/lib/bundler/man/bundle-check.1 +7 -14
  86. data/lib/bundler/man/bundle-check.1.ronn +7 -2
  87. data/lib/bundler/man/bundle-clean.1 +4 -11
  88. data/lib/bundler/man/bundle-clean.1.ronn +1 -1
  89. data/lib/bundler/man/bundle-config.1 +48 -227
  90. data/lib/bundler/man/bundle-config.1.ronn +41 -34
  91. data/lib/bundler/man/bundle-console.1 +33 -0
  92. data/lib/bundler/man/bundle-console.1.ronn +39 -0
  93. data/lib/bundler/man/bundle-doctor.1 +5 -19
  94. data/lib/bundler/man/bundle-doctor.1.ronn +1 -1
  95. data/lib/bundler/man/bundle-env.1 +9 -0
  96. data/lib/bundler/man/bundle-env.1.ronn +10 -0
  97. data/lib/bundler/man/bundle-exec.1 +20 -78
  98. data/lib/bundler/man/bundle-exec.1.ronn +12 -10
  99. data/lib/bundler/man/bundle-fund.1 +22 -0
  100. data/lib/bundler/man/bundle-fund.1.ronn +25 -0
  101. data/lib/bundler/man/bundle-gem.1 +57 -72
  102. data/lib/bundler/man/bundle-gem.1.ronn +57 -9
  103. data/lib/bundler/man/bundle-help.1 +9 -0
  104. data/lib/bundler/man/bundle-help.1.ronn +12 -0
  105. data/lib/bundler/man/bundle-info.1 +8 -11
  106. data/lib/bundler/man/bundle-info.1.ronn +9 -5
  107. data/lib/bundler/man/bundle-init.1 +7 -12
  108. data/lib/bundler/man/bundle-init.1.ronn +4 -1
  109. data/lib/bundler/man/bundle-inject.1 +17 -19
  110. data/lib/bundler/man/bundle-inject.1.ronn +12 -2
  111. data/lib/bundler/man/bundle-install.1 +43 -163
  112. data/lib/bundler/man/bundle-install.1.ronn +33 -51
  113. data/lib/bundler/man/bundle-issue.1 +45 -0
  114. data/lib/bundler/man/bundle-issue.1.ronn +37 -0
  115. data/lib/bundler/man/bundle-licenses.1 +9 -0
  116. data/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  117. data/lib/bundler/man/bundle-list.1 +4 -19
  118. data/lib/bundler/man/bundle-list.1.ronn +4 -1
  119. data/lib/bundler/man/bundle-lock.1 +25 -34
  120. data/lib/bundler/man/bundle-lock.1.ronn +25 -4
  121. data/lib/bundler/man/bundle-open.1 +18 -18
  122. data/lib/bundler/man/bundle-open.1.ronn +10 -1
  123. data/lib/bundler/man/bundle-outdated.1 +23 -75
  124. data/lib/bundler/man/bundle-outdated.1.ronn +21 -22
  125. data/lib/bundler/man/bundle-platform.1 +16 -28
  126. data/lib/bundler/man/bundle-platform.1.ronn +14 -7
  127. data/lib/bundler/man/bundle-plugin.1 +58 -0
  128. data/lib/bundler/man/bundle-plugin.1.ronn +63 -0
  129. data/lib/bundler/man/bundle-pristine.1 +5 -16
  130. data/lib/bundler/man/bundle-pristine.1.ronn +1 -1
  131. data/lib/bundler/man/bundle-remove.1 +4 -14
  132. data/lib/bundler/man/bundle-remove.1.ronn +1 -1
  133. data/lib/bundler/man/bundle-show.1 +7 -11
  134. data/lib/bundler/man/bundle-show.1.ronn +4 -0
  135. data/lib/bundler/man/bundle-update.1 +31 -144
  136. data/lib/bundler/man/bundle-update.1.ronn +16 -7
  137. data/lib/bundler/man/bundle-version.1 +22 -0
  138. data/lib/bundler/man/bundle-version.1.ronn +24 -0
  139. data/lib/bundler/man/bundle-viz.1 +9 -18
  140. data/lib/bundler/man/bundle-viz.1.ronn +9 -3
  141. data/lib/bundler/man/bundle.1 +17 -51
  142. data/lib/bundler/man/bundle.1.ronn +12 -7
  143. data/lib/bundler/man/gemfile.5 +132 -346
  144. data/lib/bundler/man/gemfile.5.ronn +127 -86
  145. data/lib/bundler/man/index.txt +8 -0
  146. data/lib/bundler/match_metadata.rb +17 -0
  147. data/lib/bundler/match_platform.rb +1 -2
  148. data/lib/bundler/match_remote_metadata.rb +29 -0
  149. data/lib/bundler/materialization.rb +59 -0
  150. data/lib/bundler/mirror.rb +8 -10
  151. data/lib/bundler/plugin/api/source.rb +11 -14
  152. data/lib/bundler/plugin/events.rb +24 -0
  153. data/lib/bundler/plugin/index.rb +13 -5
  154. data/lib/bundler/plugin/installer/git.rb +0 -4
  155. data/lib/bundler/plugin/installer/path.rb +18 -0
  156. data/lib/bundler/plugin/installer/rubygems.rb +0 -8
  157. data/lib/bundler/plugin/installer.rb +43 -20
  158. data/lib/bundler/plugin/source_list.rb +4 -4
  159. data/lib/bundler/plugin.rb +35 -7
  160. data/lib/bundler/process_lock.rb +10 -14
  161. data/lib/bundler/remote_specification.rb +17 -6
  162. data/lib/bundler/resolver/base.rb +117 -0
  163. data/lib/bundler/resolver/candidate.rb +82 -0
  164. data/lib/bundler/resolver/incompatibility.rb +15 -0
  165. data/lib/bundler/resolver/package.rb +90 -0
  166. data/lib/bundler/resolver/root.rb +25 -0
  167. data/lib/bundler/resolver/spec_group.rb +54 -66
  168. data/lib/bundler/resolver.rb +440 -306
  169. data/lib/bundler/retry.rb +2 -2
  170. data/lib/bundler/ruby_dsl.rb +42 -7
  171. data/lib/bundler/ruby_version.rb +22 -22
  172. data/lib/bundler/rubygems_ext.rb +323 -84
  173. data/lib/bundler/rubygems_gem_installer.rb +93 -65
  174. data/lib/bundler/rubygems_integration.rb +89 -237
  175. data/lib/bundler/runtime.rb +30 -20
  176. data/lib/bundler/safe_marshal.rb +31 -0
  177. data/lib/bundler/self_manager.rb +205 -0
  178. data/lib/bundler/settings.rb +145 -58
  179. data/lib/bundler/setup.rb +13 -1
  180. data/lib/bundler/shared_helpers.rb +94 -51
  181. data/lib/bundler/source/git/git_proxy.rb +283 -82
  182. data/lib/bundler/source/git.rb +187 -78
  183. data/lib/bundler/source/metadata.rb +16 -16
  184. data/lib/bundler/source/path/installer.rb +1 -22
  185. data/lib/bundler/source/path.rb +17 -27
  186. data/lib/bundler/source/rubygems/remote.rb +1 -1
  187. data/lib/bundler/source/rubygems.rb +165 -245
  188. data/lib/bundler/source/rubygems_aggregate.rb +1 -1
  189. data/lib/bundler/source.rb +7 -6
  190. data/lib/bundler/source_list.rb +41 -33
  191. data/lib/bundler/source_map.rb +15 -2
  192. data/lib/bundler/spec_set.rb +193 -58
  193. data/lib/bundler/stub_specification.rb +39 -7
  194. data/lib/bundler/templates/Executable +3 -5
  195. data/lib/bundler/templates/Executable.bundler +7 -12
  196. data/lib/bundler/templates/Executable.standalone +4 -4
  197. data/lib/bundler/templates/Gemfile +0 -2
  198. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
  199. data/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
  200. data/lib/bundler/templates/newgem/Gemfile.tt +5 -2
  201. data/lib/bundler/templates/newgem/README.md.tt +12 -12
  202. data/lib/bundler/templates/newgem/Rakefile.tt +28 -4
  203. data/lib/bundler/templates/newgem/bin/console.tt +0 -4
  204. data/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
  205. data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
  206. data/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
  207. data/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  208. data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +1 -1
  209. data/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
  210. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +20 -10
  211. data/lib/bundler/templates/newgem/gitignore.tt +3 -0
  212. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +13 -4
  213. data/lib/bundler/templates/newgem/newgem.gemspec.tt +26 -18
  214. data/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
  215. data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  216. data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
  217. data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
  218. data/lib/bundler/ui/rg_proxy.rb +1 -1
  219. data/lib/bundler/ui/shell.rb +61 -16
  220. data/lib/bundler/ui/silent.rb +33 -6
  221. data/lib/bundler/uri_credentials_filter.rb +3 -3
  222. data/lib/bundler/uri_normalizer.rb +23 -0
  223. data/lib/bundler/vendor/.document +1 -0
  224. data/lib/bundler/vendor/connection_pool/.document +1 -0
  225. data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  226. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
  227. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  228. data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
  229. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +92 -78
  230. data/lib/bundler/vendor/fileutils/.document +1 -0
  231. data/lib/bundler/vendor/fileutils/COPYING +56 -0
  232. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1350 -418
  233. data/lib/bundler/vendor/net-http-persistent/.document +1 -0
  234. data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  235. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +4 -3
  236. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +23 -11
  237. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +1 -1
  238. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +102 -64
  239. data/lib/bundler/vendor/pub_grub/.document +1 -0
  240. data/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  241. data/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  242. data/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +189 -0
  243. data/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  244. data/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
  245. data/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  246. data/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  247. data/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  248. data/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  249. data/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
  250. data/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  251. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  252. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
  253. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +411 -0
  254. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +248 -0
  255. data/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  256. data/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  257. data/lib/bundler/vendor/securerandom/.document +1 -0
  258. data/lib/bundler/vendor/securerandom/COPYING +56 -0
  259. data/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
  260. data/lib/bundler/vendor/thor/.document +1 -0
  261. data/lib/bundler/vendor/thor/LICENSE.md +20 -0
  262. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
  263. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +1 -1
  264. data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
  265. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +15 -19
  266. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +16 -6
  267. data/lib/bundler/vendor/thor/lib/thor/actions.rb +21 -17
  268. data/lib/bundler/vendor/thor/lib/thor/base.rb +140 -14
  269. data/lib/bundler/vendor/thor/lib/thor/command.rb +13 -4
  270. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +10 -0
  271. data/lib/bundler/vendor/thor/lib/thor/error.rb +16 -20
  272. data/lib/bundler/vendor/thor/lib/thor/group.rb +12 -1
  273. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -1
  274. data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +2 -2
  275. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +17 -1
  276. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +33 -17
  277. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +28 -9
  278. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +65 -8
  279. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +2 -2
  280. data/lib/bundler/vendor/thor/lib/thor/runner.rb +40 -30
  281. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +56 -162
  282. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -46
  283. data/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
  284. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -46
  285. data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +118 -0
  286. data/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
  287. data/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
  288. data/lib/bundler/vendor/thor/lib/thor/shell.rb +2 -2
  289. data/lib/bundler/vendor/thor/lib/thor/util.rb +9 -8
  290. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  291. data/lib/bundler/vendor/thor/lib/thor.rb +166 -8
  292. data/lib/bundler/vendor/tsort/.document +1 -0
  293. data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  294. data/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
  295. data/lib/bundler/vendor/uri/.document +1 -0
  296. data/lib/bundler/vendor/uri/COPYING +56 -0
  297. data/lib/bundler/vendor/uri/lib/uri/common.rb +351 -219
  298. data/lib/bundler/vendor/uri/lib/uri/file.rb +10 -4
  299. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +3 -3
  300. data/lib/bundler/vendor/uri/lib/uri/generic.rb +49 -39
  301. data/lib/bundler/vendor/uri/lib/uri/http.rb +40 -3
  302. data/lib/bundler/vendor/uri/lib/uri/https.rb +2 -2
  303. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +2 -2
  304. data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +2 -1
  305. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +2 -3
  306. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +26 -26
  307. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +131 -50
  308. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  309. data/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
  310. data/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
  311. data/lib/bundler/vendor/uri/lib/uri.rb +12 -12
  312. data/lib/bundler/vendored_net_http.rb +23 -0
  313. data/lib/bundler/vendored_persistent.rb +0 -36
  314. data/lib/bundler/{vendored_molinillo.rb → vendored_pub_grub.rb} +1 -1
  315. data/lib/bundler/vendored_securerandom.rb +12 -0
  316. data/lib/bundler/vendored_timeout.rb +12 -0
  317. data/lib/bundler/{vendored_tmpdir.rb → vendored_tsort.rb} +1 -1
  318. data/lib/bundler/vendored_uri.rb +18 -1
  319. data/lib/bundler/version.rb +5 -1
  320. data/lib/bundler/vlad.rb +1 -1
  321. data/lib/bundler/worker.rb +7 -9
  322. data/lib/bundler/yaml_serializer.rb +22 -13
  323. data/lib/bundler.rb +176 -151
  324. metadata +98 -41
  325. data/lib/bundler/dep_proxy.rb +0 -55
  326. data/lib/bundler/gemdeps.rb +0 -29
  327. data/lib/bundler/psyched_yaml.rb +0 -22
  328. data/lib/bundler/templates/gems.rb +0 -8
  329. data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +0 -5
  330. data/lib/bundler/templates/newgem/travis.yml.tt +0 -6
  331. data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
  332. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  333. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
  334. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
  335. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
  336. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
  337. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
  338. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
  339. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
  340. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
  341. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
  342. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
  343. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
  344. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +0 -143
  345. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  346. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
  347. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
  348. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
  349. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
  350. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +0 -58
  351. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -11
  352. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +0 -154
  353. data/lib/bundler/version_ranges.rb +0 -122
@@ -0,0 +1 @@
1
+ # Vendored files do not need to be documented
@@ -0,0 +1,82 @@
1
+ = net-http-persistent
2
+
3
+ home :: https://github.com/drbrain/net-http-persistent
4
+ rdoc :: https://rdoc.info/gems/net-http-persistent
5
+
6
+ == DESCRIPTION:
7
+
8
+ Manages persistent connections using Net::HTTP including a thread pool for
9
+ connecting to multiple hosts.
10
+
11
+ Using persistent HTTP connections can dramatically increase the speed of HTTP.
12
+ Creating a new HTTP connection for every request involves an extra TCP
13
+ round-trip and causes TCP congestion avoidance negotiation to start over.
14
+
15
+ Net::HTTP supports persistent connections with some API methods but does not
16
+ make setting up a single persistent connection or managing multiple
17
+ connections easy. Net::HTTP::Persistent wraps Net::HTTP and allows you to
18
+ focus on how to make HTTP requests.
19
+
20
+ == FEATURES/PROBLEMS:
21
+
22
+ * Supports TLS with secure defaults
23
+ * Thread-safe
24
+ * Pure ruby
25
+
26
+ == SYNOPSIS
27
+
28
+ The following example will make two requests to the same server. The
29
+ connection is kept alive between requests:
30
+
31
+ require 'net/http/persistent'
32
+
33
+ uri = URI 'http://example.com/awesome/web/service'
34
+
35
+ http = Net::HTTP::Persistent.new name: 'my_app_name'
36
+
37
+ # perform a GET
38
+ response = http.request uri
39
+
40
+ # create a POST
41
+ post_uri = uri + 'create'
42
+ post = Net::HTTP::Post.new post_uri.path
43
+ post.set_form_data 'some' => 'cool data'
44
+
45
+ # perform the POST, the URI is always required
46
+ response = http.request post_uri, post
47
+
48
+ # if you are done making http requests, or won't make requests for several
49
+ # minutes
50
+ http.shutdown
51
+
52
+ Please see the documentation on Net::HTTP::Persistent for more information,
53
+ including SSL connection verification, header handling and tunable options.
54
+
55
+ == INSTALL:
56
+
57
+ gem install net-http-persistent
58
+
59
+ == LICENSE:
60
+
61
+ (The MIT License)
62
+
63
+ Copyright (c) Eric Hodel, Aaron Patterson
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining
66
+ a copy of this software and associated documentation files (the
67
+ 'Software'), to deal in the Software without restriction, including
68
+ without limitation the rights to use, copy, modify, merge, publish,
69
+ distribute, sublicense, and/or sell copies of the Software, and to
70
+ permit persons to whom the Software is furnished to do so, subject to
71
+ the following conditions:
72
+
73
+ The above copyright notice and this permission notice shall be
74
+ included in all copies or substantial portions of the Software.
75
+
76
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
77
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
78
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
79
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
80
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
81
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
82
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,8 +1,8 @@
1
1
  ##
2
- # A Net::HTTP connection wrapper that holds extra information for managing the
2
+ # A Gem::Net::HTTP connection wrapper that holds extra information for managing the
3
3
  # connection's lifetime.
4
4
 
5
- class Bundler::Persistent::Net::HTTP::Persistent::Connection # :nodoc:
5
+ class Gem::Net::HTTP::Persistent::Connection # :nodoc:
6
6
 
7
7
  attr_accessor :http
8
8
 
@@ -25,9 +25,10 @@ class Bundler::Persistent::Net::HTTP::Persistent::Connection # :nodoc:
25
25
  ensure
26
26
  reset
27
27
  end
28
+ alias_method :close, :finish
28
29
 
29
30
  def reset
30
- @last_use = Bundler::Persistent::Net::HTTP::Persistent::EPOCH
31
+ @last_use = Gem::Net::HTTP::Persistent::EPOCH
31
32
  @requests = 0
32
33
  end
33
34
 
@@ -1,4 +1,4 @@
1
- class Bundler::Persistent::Net::HTTP::Persistent::Pool < Bundler::ConnectionPool # :nodoc:
1
+ class Gem::Net::HTTP::Persistent::Pool < Bundler::ConnectionPool # :nodoc:
2
2
 
3
3
  attr_reader :available # :nodoc:
4
4
  attr_reader :key # :nodoc:
@@ -6,25 +6,37 @@ class Bundler::Persistent::Net::HTTP::Persistent::Pool < Bundler::ConnectionPool
6
6
  def initialize(options = {}, &block)
7
7
  super
8
8
 
9
- @available = Bundler::Persistent::Net::HTTP::Persistent::TimedStackMulti.new(@size, &block)
9
+ @available = Gem::Net::HTTP::Persistent::TimedStackMulti.new(@size, &block)
10
10
  @key = "current-#{@available.object_id}"
11
11
  end
12
12
 
13
13
  def checkin net_http_args
14
- stack = Thread.current[@key][net_http_args] ||= []
14
+ if net_http_args.is_a?(Hash) && net_http_args.size == 1 && net_http_args[:force]
15
+ # Bundler::ConnectionPool 2.4+ calls `checkin(force: true)` after fork.
16
+ # When this happens, we should remove all connections from Thread.current
17
+ if stacks = Thread.current[@key]
18
+ stacks.each do |http_args, connections|
19
+ connections.each do |conn|
20
+ @available.push conn, connection_args: http_args
21
+ end
22
+ connections.clear
23
+ end
24
+ end
25
+ else
26
+ stack = Thread.current[@key][net_http_args] ||= []
15
27
 
16
- raise Bundler::ConnectionPool::Error, 'no connections are checked out' if
17
- stack.empty?
28
+ raise Bundler::ConnectionPool::Error, 'no connections are checked out' if
29
+ stack.empty?
18
30
 
19
- conn = stack.pop
31
+ conn = stack.pop
20
32
 
21
- if stack.empty?
22
- @available.push conn, connection_args: net_http_args
33
+ if stack.empty?
34
+ @available.push conn, connection_args: net_http_args
23
35
 
24
- Thread.current[@key].delete(net_http_args)
25
- Thread.current[@key] = nil if Thread.current[@key].empty?
36
+ Thread.current[@key].delete(net_http_args)
37
+ Thread.current[@key] = nil if Thread.current[@key].empty?
38
+ end
26
39
  end
27
-
28
40
  nil
29
41
  end
30
42
 
@@ -1,4 +1,4 @@
1
- class Bundler::Persistent::Net::HTTP::Persistent::TimedStackMulti < Bundler::ConnectionPool::TimedStack # :nodoc:
1
+ class Gem::Net::HTTP::Persistent::TimedStackMulti < Bundler::ConnectionPool::TimedStack # :nodoc:
2
2
 
3
3
  ##
4
4
  # Returns a new hash that has arrays for keys
@@ -1,14 +1,14 @@
1
- require 'net/http'
2
- require_relative '../../../../uri/lib/uri'
1
+ require_relative '../../../../../vendored_net_http'
2
+ require_relative '../../../../../vendored_uri'
3
3
  require 'cgi' # for escaping
4
4
  require_relative '../../../../connection_pool/lib/connection_pool'
5
5
 
6
6
  autoload :OpenSSL, 'openssl'
7
7
 
8
8
  ##
9
- # Persistent connections for Net::HTTP
9
+ # Persistent connections for Gem::Net::HTTP
10
10
  #
11
- # Bundler::Persistent::Net::HTTP::Persistent maintains persistent connections across all the
11
+ # Gem::Net::HTTP::Persistent maintains persistent connections across all the
12
12
  # servers you wish to talk to. For each host:port you communicate with a
13
13
  # single persistent connection is created.
14
14
  #
@@ -22,34 +22,34 @@ autoload :OpenSSL, 'openssl'
22
22
  #
23
23
  # require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
24
24
  #
25
- # uri = Bundler::URI 'http://example.com/awesome/web/service'
25
+ # uri = Gem::URI 'http://example.com/awesome/web/service'
26
26
  #
27
- # http = Bundler::Persistent::Net::HTTP::Persistent.new
27
+ # http = Gem::Net::HTTP::Persistent.new
28
28
  #
29
29
  # # perform a GET
30
30
  # response = http.request uri
31
31
  #
32
32
  # # or
33
33
  #
34
- # get = Net::HTTP::Get.new uri.request_uri
34
+ # get = Gem::Net::HTTP::Get.new uri.request_uri
35
35
  # response = http.request get
36
36
  #
37
37
  # # create a POST
38
38
  # post_uri = uri + 'create'
39
- # post = Net::HTTP::Post.new post_uri.path
39
+ # post = Gem::Net::HTTP::Post.new post_uri.path
40
40
  # post.set_form_data 'some' => 'cool data'
41
41
  #
42
- # # perform the POST, the Bundler::URI is always required
42
+ # # perform the POST, the Gem::URI is always required
43
43
  # response http.request post_uri, post
44
44
  #
45
45
  # Note that for GET, HEAD and other requests that do not have a body you want
46
- # to use Bundler::URI#request_uri not Bundler::URI#path. The request_uri contains the query
46
+ # to use Gem::URI#request_uri not Gem::URI#path. The request_uri contains the query
47
47
  # params which are sent in the body for other requests.
48
48
  #
49
49
  # == TLS/SSL
50
50
  #
51
51
  # TLS connections are automatically created depending upon the scheme of the
52
- # Bundler::URI. TLS connections are automatically verified against the default
52
+ # Gem::URI. TLS connections are automatically verified against the default
53
53
  # certificate store for your computer. You can override this by changing
54
54
  # verify_mode or by specifying an alternate cert_store.
55
55
  #
@@ -68,11 +68,13 @@ autoload :OpenSSL, 'openssl'
68
68
  # #verify_callback :: For server certificate verification
69
69
  # #verify_depth :: Depth of certificate verification
70
70
  # #verify_mode :: How connections should be verified
71
+ # #verify_hostname :: Use hostname verification for server certificate
72
+ # during the handshake
71
73
  #
72
74
  # == Proxies
73
75
  #
74
76
  # A proxy can be set through #proxy= or at initialization time by providing a
75
- # second argument to ::new. The proxy may be the Bundler::URI of the proxy server or
77
+ # second argument to ::new. The proxy may be the Gem::URI of the proxy server or
76
78
  # <code>:ENV</code> which will consult environment variables.
77
79
  #
78
80
  # See #proxy= and #proxy_from_env for details.
@@ -92,7 +94,7 @@ autoload :OpenSSL, 'openssl'
92
94
  #
93
95
  # === Segregation
94
96
  #
95
- # Each Bundler::Persistent::Net::HTTP::Persistent instance has its own pool of connections. There
97
+ # Each Gem::Net::HTTP::Persistent instance has its own pool of connections. There
96
98
  # is no sharing with other instances (as was true in earlier versions).
97
99
  #
98
100
  # === Idle Timeout
@@ -131,7 +133,7 @@ autoload :OpenSSL, 'openssl'
131
133
  #
132
134
  # === Connection Termination
133
135
  #
134
- # If you are done using the Bundler::Persistent::Net::HTTP::Persistent instance you may shut down
136
+ # If you are done using the Gem::Net::HTTP::Persistent instance you may shut down
135
137
  # all the connections in the current thread with #shutdown. This is not
136
138
  # recommended for normal use, it should only be used when it will be several
137
139
  # minutes before you make another HTTP request.
@@ -141,7 +143,7 @@ autoload :OpenSSL, 'openssl'
141
143
  # Ruby will automatically garbage collect and shutdown your HTTP connections
142
144
  # when the thread terminates.
143
145
 
144
- class Bundler::Persistent::Net::HTTP::Persistent
146
+ class Gem::Net::HTTP::Persistent
145
147
 
146
148
  ##
147
149
  # The beginning of Time
@@ -172,12 +174,12 @@ class Bundler::Persistent::Net::HTTP::Persistent
172
174
  end
173
175
 
174
176
  ##
175
- # The version of Bundler::Persistent::Net::HTTP::Persistent you are using
177
+ # The version of Gem::Net::HTTP::Persistent you are using
176
178
 
177
- VERSION = '4.0.0'
179
+ VERSION = '4.0.4'
178
180
 
179
181
  ##
180
- # Error class for errors raised by Bundler::Persistent::Net::HTTP::Persistent. Various
182
+ # Error class for errors raised by Gem::Net::HTTP::Persistent. Various
181
183
  # SystemCallErrors are re-raised with a human-readable message under this
182
184
  # class.
183
185
 
@@ -197,10 +199,10 @@ class Bundler::Persistent::Net::HTTP::Persistent
197
199
  # NOTE: This may not work on ruby > 1.9.
198
200
 
199
201
  def self.detect_idle_timeout uri, max = 10
200
- uri = Bundler::URI uri unless Bundler::URI::Generic === uri
202
+ uri = Gem::URI uri unless Gem::URI::Generic === uri
201
203
  uri += '/'
202
204
 
203
- req = Net::HTTP::Head.new uri.request_uri
205
+ req = Gem::Net::HTTP::Head.new uri.request_uri
204
206
 
205
207
  http = new 'net-http-persistent detect_idle_timeout'
206
208
 
@@ -214,7 +216,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
214
216
 
215
217
  $stderr.puts "HEAD #{uri} => #{response.code}" if $DEBUG
216
218
 
217
- unless Net::HTTPOK === response then
219
+ unless Gem::Net::HTTPOK === response then
218
220
  raise Error, "bad response code #{response.code} detecting idle timeout"
219
221
  end
220
222
 
@@ -238,7 +240,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
238
240
  attr_reader :certificate
239
241
 
240
242
  ##
241
- # For Net::HTTP parity
243
+ # For Gem::Net::HTTP parity
242
244
 
243
245
  alias cert certificate
244
246
 
@@ -266,7 +268,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
266
268
  attr_reader :ciphers
267
269
 
268
270
  ##
269
- # Sends debug_output to this IO via Net::HTTP#set_debug_output.
271
+ # Sends debug_output to this IO via Gem::Net::HTTP#set_debug_output.
270
272
  #
271
273
  # Never use this method in production code, it causes a serious security
272
274
  # hole.
@@ -279,7 +281,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
279
281
  attr_reader :generation # :nodoc:
280
282
 
281
283
  ##
282
- # Headers that are added to every request using Net::HTTP#add_field
284
+ # Headers that are added to every request using Gem::Net::HTTP#add_field
283
285
 
284
286
  attr_reader :headers
285
287
 
@@ -304,7 +306,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
304
306
  ##
305
307
  # Number of retries to perform if a request fails.
306
308
  #
307
- # See also #max_retries=, Net::HTTP#max_retries=.
309
+ # See also #max_retries=, Gem::Net::HTTP#max_retries=.
308
310
 
309
311
  attr_reader :max_retries
310
312
 
@@ -325,12 +327,12 @@ class Bundler::Persistent::Net::HTTP::Persistent
325
327
  attr_reader :name
326
328
 
327
329
  ##
328
- # Seconds to wait until a connection is opened. See Net::HTTP#open_timeout
330
+ # Seconds to wait until a connection is opened. See Gem::Net::HTTP#open_timeout
329
331
 
330
332
  attr_accessor :open_timeout
331
333
 
332
334
  ##
333
- # Headers that are added to every request using Net::HTTP#[]=
335
+ # Headers that are added to every request using Gem::Net::HTTP#[]=
334
336
 
335
337
  attr_reader :override_headers
336
338
 
@@ -340,7 +342,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
340
342
  attr_reader :private_key
341
343
 
342
344
  ##
343
- # For Net::HTTP parity
345
+ # For Gem::Net::HTTP parity
344
346
 
345
347
  alias key private_key
346
348
 
@@ -360,12 +362,12 @@ class Bundler::Persistent::Net::HTTP::Persistent
360
362
  attr_reader :pool # :nodoc:
361
363
 
362
364
  ##
363
- # Seconds to wait until reading one block. See Net::HTTP#read_timeout
365
+ # Seconds to wait until reading one block. See Gem::Net::HTTP#read_timeout
364
366
 
365
367
  attr_accessor :read_timeout
366
368
 
367
369
  ##
368
- # Seconds to wait until writing one block. See Net::HTTP#write_timeout
370
+ # Seconds to wait until writing one block. See Gem::Net::HTTP#write_timeout
369
371
 
370
372
  attr_accessor :write_timeout
371
373
 
@@ -450,18 +452,33 @@ class Bundler::Persistent::Net::HTTP::Persistent
450
452
  attr_reader :verify_mode
451
453
 
452
454
  ##
453
- # Creates a new Bundler::Persistent::Net::HTTP::Persistent.
455
+ # HTTPS verify_hostname.
456
+ #
457
+ # If a client sets this to true and enables SNI with SSLSocket#hostname=,
458
+ # the hostname verification on the server certificate is performed
459
+ # automatically during the handshake using
460
+ # OpenSSL::SSL.verify_certificate_identity().
461
+ #
462
+ # You can set +verify_hostname+ as true to use hostname verification
463
+ # during the handshake.
464
+ #
465
+ # NOTE: This works with Ruby > 3.0.
466
+
467
+ attr_reader :verify_hostname
468
+
469
+ ##
470
+ # Creates a new Gem::Net::HTTP::Persistent.
454
471
  #
455
472
  # Set a +name+ for fun. Your library name should be good enough, but this
456
473
  # otherwise has no purpose.
457
474
  #
458
- # +proxy+ may be set to a Bundler::URI::HTTP or :ENV to pick up proxy options from
475
+ # +proxy+ may be set to a Gem::URI::HTTP or :ENV to pick up proxy options from
459
476
  # the environment. See proxy_from_env for details.
460
477
  #
461
- # In order to use a Bundler::URI for the proxy you may need to do some extra work
462
- # beyond Bundler::URI parsing if the proxy requires a password:
478
+ # In order to use a Gem::URI for the proxy you may need to do some extra work
479
+ # beyond Gem::URI parsing if the proxy requires a password:
463
480
  #
464
- # proxy = Bundler::URI 'http://proxy.example'
481
+ # proxy = Gem::URI 'http://proxy.example'
465
482
  # proxy.user = 'AzureDiamond'
466
483
  # proxy.password = 'hunter2'
467
484
  #
@@ -492,8 +509,8 @@ class Bundler::Persistent::Net::HTTP::Persistent
492
509
  @socket_options << [Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1] if
493
510
  Socket.const_defined? :TCP_NODELAY
494
511
 
495
- @pool = Bundler::Persistent::Net::HTTP::Persistent::Pool.new size: pool_size do |http_args|
496
- Bundler::Persistent::Net::HTTP::Persistent::Connection.new Net::HTTP, http_args, @ssl_generation
512
+ @pool = Gem::Net::HTTP::Persistent::Pool.new size: pool_size do |http_args|
513
+ Gem::Net::HTTP::Persistent::Connection.new Gem::Net::HTTP, http_args, @ssl_generation
497
514
  end
498
515
 
499
516
  @certificate = nil
@@ -508,9 +525,10 @@ class Bundler::Persistent::Net::HTTP::Persistent
508
525
  @verify_callback = nil
509
526
  @verify_depth = nil
510
527
  @verify_mode = nil
528
+ @verify_hostname = nil
511
529
  @cert_store = nil
512
530
 
513
- @generation = 0 # incremented when proxy Bundler::URI changes
531
+ @generation = 0 # incremented when proxy Gem::URI changes
514
532
 
515
533
  if HAVE_OPENSSL then
516
534
  @verify_mode = OpenSSL::SSL::VERIFY_PEER
@@ -529,7 +547,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
529
547
  reconnect_ssl
530
548
  end
531
549
 
532
- # For Net::HTTP parity
550
+ # For Gem::Net::HTTP parity
533
551
  alias cert= certificate=
534
552
 
535
553
  ##
@@ -607,13 +625,23 @@ class Bundler::Persistent::Net::HTTP::Persistent
607
625
 
608
626
  return yield connection
609
627
  rescue Errno::ECONNREFUSED
610
- address = http.proxy_address || http.address
611
- port = http.proxy_port || http.port
628
+ if http.proxy?
629
+ address = http.proxy_address
630
+ port = http.proxy_port
631
+ else
632
+ address = http.address
633
+ port = http.port
634
+ end
612
635
 
613
636
  raise Error, "connection refused: #{address}:#{port}"
614
637
  rescue Errno::EHOSTDOWN
615
- address = http.proxy_address || http.address
616
- port = http.proxy_port || http.port
638
+ if http.proxy?
639
+ address = http.proxy_address
640
+ port = http.proxy_port
641
+ else
642
+ address = http.address
643
+ port = http.port
644
+ end
617
645
 
618
646
  raise Error, "host down: #{address}:#{port}"
619
647
  ensure
@@ -648,7 +676,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
648
676
  end
649
677
 
650
678
  ##
651
- # Starts the Net::HTTP +connection+
679
+ # Starts the Gem::Net::HTTP +connection+
652
680
 
653
681
  def start http
654
682
  http.set_debug_output @debug_output if @debug_output
@@ -666,7 +694,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
666
694
  end
667
695
 
668
696
  ##
669
- # Finishes the Net::HTTP +connection+
697
+ # Finishes the Gem::Net::HTTP +connection+
670
698
 
671
699
  def finish connection
672
700
  connection.finish
@@ -716,16 +744,16 @@ class Bundler::Persistent::Net::HTTP::Persistent
716
744
  reconnect_ssl
717
745
  end
718
746
 
719
- # For Net::HTTP parity
747
+ # For Gem::Net::HTTP parity
720
748
  alias key= private_key=
721
749
 
722
750
  ##
723
- # Sets the proxy server. The +proxy+ may be the Bundler::URI of the proxy server,
751
+ # Sets the proxy server. The +proxy+ may be the Gem::URI of the proxy server,
724
752
  # the symbol +:ENV+ which will read the proxy from the environment or nil to
725
753
  # disable use of a proxy. See #proxy_from_env for details on setting the
726
754
  # proxy from the environment.
727
755
  #
728
- # If the proxy Bundler::URI is set after requests have been made, the next request
756
+ # If the proxy Gem::URI is set after requests have been made, the next request
729
757
  # will shut-down and re-open all connections.
730
758
  #
731
759
  # The +no_proxy+ query parameter can be used to specify hosts which shouldn't
@@ -736,9 +764,9 @@ class Bundler::Persistent::Net::HTTP::Persistent
736
764
  def proxy= proxy
737
765
  @proxy_uri = case proxy
738
766
  when :ENV then proxy_from_env
739
- when Bundler::URI::HTTP then proxy
767
+ when Gem::URI::HTTP then proxy
740
768
  when nil then # ignore
741
- else raise ArgumentError, 'proxy must be :ENV or a Bundler::URI::HTTP'
769
+ else raise ArgumentError, 'proxy must be :ENV or a Gem::URI::HTTP'
742
770
  end
743
771
 
744
772
  @no_proxy.clear
@@ -763,13 +791,13 @@ class Bundler::Persistent::Net::HTTP::Persistent
763
791
  end
764
792
 
765
793
  ##
766
- # Creates a Bundler::URI for an HTTP proxy server from ENV variables.
794
+ # Creates a Gem::URI for an HTTP proxy server from ENV variables.
767
795
  #
768
796
  # If +HTTP_PROXY+ is set a proxy will be returned.
769
797
  #
770
- # If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the Bundler::URI is given the
798
+ # If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the Gem::URI is given the
771
799
  # indicated user and password unless HTTP_PROXY contains either of these in
772
- # the Bundler::URI.
800
+ # the Gem::URI.
773
801
  #
774
802
  # The +NO_PROXY+ ENV variable can be used to specify hosts which shouldn't
775
803
  # be reached via proxy; if set it should be a comma separated list of
@@ -785,7 +813,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
785
813
 
786
814
  return nil if env_proxy.nil? or env_proxy.empty?
787
815
 
788
- uri = Bundler::URI normalize_uri env_proxy
816
+ uri = Gem::URI normalize_uri env_proxy
789
817
 
790
818
  env_no_proxy = ENV['no_proxy'] || ENV['NO_PROXY']
791
819
 
@@ -835,7 +863,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
835
863
  end
836
864
 
837
865
  ##
838
- # Finishes then restarts the Net::HTTP +connection+
866
+ # Finishes then restarts the Gem::Net::HTTP +connection+
839
867
 
840
868
  def reset connection
841
869
  http = connection.http
@@ -854,16 +882,16 @@ class Bundler::Persistent::Net::HTTP::Persistent
854
882
  end
855
883
 
856
884
  ##
857
- # Makes a request on +uri+. If +req+ is nil a Net::HTTP::Get is performed
885
+ # Makes a request on +uri+. If +req+ is nil a Gem::Net::HTTP::Get is performed
858
886
  # against +uri+.
859
887
  #
860
- # If a block is passed #request behaves like Net::HTTP#request (the body of
888
+ # If a block is passed #request behaves like Gem::Net::HTTP#request (the body of
861
889
  # the response will not have been read).
862
890
  #
863
- # +req+ must be a Net::HTTPGenericRequest subclass (see Net::HTTP for a list).
891
+ # +req+ must be a Gem::Net::HTTPGenericRequest subclass (see Gem::Net::HTTP for a list).
864
892
 
865
893
  def request uri, req = nil, &block
866
- uri = Bundler::URI uri
894
+ uri = Gem::URI uri
867
895
  req = request_setup req || uri
868
896
  response = nil
869
897
 
@@ -896,14 +924,14 @@ class Bundler::Persistent::Net::HTTP::Persistent
896
924
  end
897
925
 
898
926
  ##
899
- # Creates a GET request if +req_or_uri+ is a Bundler::URI and adds headers to the
927
+ # Creates a GET request if +req_or_uri+ is a Gem::URI and adds headers to the
900
928
  # request.
901
929
  #
902
930
  # Returns the request.
903
931
 
904
932
  def request_setup req_or_uri # :nodoc:
905
933
  req = if req_or_uri.respond_to? 'request_uri' then
906
- Net::HTTP::Get.new req_or_uri.request_uri
934
+ Gem::Net::HTTP::Get.new req_or_uri.request_uri
907
935
  else
908
936
  req_or_uri
909
937
  end
@@ -948,8 +976,10 @@ class Bundler::Persistent::Net::HTTP::Persistent
948
976
  connection.min_version = @min_version if @min_version
949
977
  connection.max_version = @max_version if @max_version
950
978
 
951
- connection.verify_depth = @verify_depth
952
- connection.verify_mode = @verify_mode
979
+ connection.verify_depth = @verify_depth
980
+ connection.verify_mode = @verify_mode
981
+ connection.verify_hostname = @verify_hostname if
982
+ @verify_hostname != nil && connection.respond_to?(:verify_hostname=)
953
983
 
954
984
  if OpenSSL::SSL::VERIFY_PEER == OpenSSL::SSL::VERIFY_NONE and
955
985
  not Object.const_defined?(:I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG) then
@@ -1058,6 +1088,15 @@ application:
1058
1088
  reconnect_ssl
1059
1089
  end
1060
1090
 
1091
+ ##
1092
+ # Sets the HTTPS verify_hostname.
1093
+
1094
+ def verify_hostname= verify_hostname
1095
+ @verify_hostname = verify_hostname
1096
+
1097
+ reconnect_ssl
1098
+ end
1099
+
1061
1100
  ##
1062
1101
  # SSL verification callback.
1063
1102
 
@@ -1070,4 +1109,3 @@ end
1070
1109
 
1071
1110
  require_relative 'persistent/connection'
1072
1111
  require_relative 'persistent/pool'
1073
-
@@ -0,0 +1 @@
1
+ # Vendored files do not need to be documented
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 John Hawthorn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,20 @@
1
+ module Bundler::PubGrub
2
+ class Assignment
3
+ attr_reader :term, :cause, :decision_level, :index
4
+ def initialize(term, cause, decision_level, index)
5
+ @term = term
6
+ @cause = cause
7
+ @decision_level = decision_level
8
+ @index = index
9
+ end
10
+
11
+ def self.decision(package, version, decision_level, index)
12
+ term = Term.new(VersionConstraint.exact(package, version), true)
13
+ new(term, :decision, decision_level, index)
14
+ end
15
+
16
+ def decision?
17
+ cause == :decision
18
+ end
19
+ end
20
+ end