rubygems-update 3.5.3 → 3.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (437) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1410 -686
  3. data/CODE_OF_CONDUCT.md +79 -28
  4. data/CONTRIBUTING.md +4 -226
  5. data/Manifest.txt +107 -83
  6. data/README.md +16 -11
  7. data/SECURITY.md +7 -0
  8. data/bundler/CHANGELOG.md +1525 -931
  9. data/bundler/README.md +9 -9
  10. data/bundler/bundler.gemspec +2 -2
  11. data/bundler/lib/bundler/build_metadata.rb +10 -11
  12. data/bundler/lib/bundler/checksum.rb +22 -12
  13. data/bundler/lib/bundler/cli/add.rb +3 -1
  14. data/bundler/lib/bundler/cli/binstubs.rb +1 -1
  15. data/bundler/lib/bundler/cli/check.rb +3 -3
  16. data/bundler/lib/bundler/cli/common.rb +1 -1
  17. data/bundler/lib/bundler/cli/config.rb +2 -2
  18. data/bundler/lib/bundler/cli/console.rb +8 -10
  19. data/bundler/lib/bundler/cli/doctor/diagnose.rb +167 -0
  20. data/bundler/lib/bundler/cli/doctor/ssl.rb +249 -0
  21. data/bundler/lib/bundler/cli/doctor.rb +27 -151
  22. data/bundler/lib/bundler/cli/exec.rb +1 -0
  23. data/bundler/lib/bundler/cli/fund.rb +1 -1
  24. data/bundler/lib/bundler/cli/gem.rb +74 -46
  25. data/bundler/lib/bundler/cli/info.rb +6 -6
  26. data/bundler/lib/bundler/cli/inject.rb +3 -3
  27. data/bundler/lib/bundler/cli/install.rb +19 -10
  28. data/bundler/lib/bundler/cli/issue.rb +3 -3
  29. data/bundler/lib/bundler/cli/lock.rb +32 -11
  30. data/bundler/lib/bundler/cli/outdated.rb +23 -23
  31. data/bundler/lib/bundler/cli/plugin.rb +3 -2
  32. data/bundler/lib/bundler/cli/pristine.rb +1 -1
  33. data/bundler/lib/bundler/cli/show.rb +3 -3
  34. data/bundler/lib/bundler/cli/update.rb +3 -3
  35. data/bundler/lib/bundler/cli.rb +75 -145
  36. data/bundler/lib/bundler/compact_index_client/cache.rb +48 -73
  37. data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -5
  38. data/bundler/lib/bundler/compact_index_client/parser.rb +84 -0
  39. data/bundler/lib/bundler/compact_index_client/updater.rb +6 -16
  40. data/bundler/lib/bundler/compact_index_client.rb +52 -85
  41. data/bundler/lib/bundler/constants.rb +8 -1
  42. data/bundler/lib/bundler/current_ruby.rb +48 -34
  43. data/bundler/lib/bundler/definition.rb +501 -328
  44. data/bundler/lib/bundler/dependency.rb +93 -47
  45. data/bundler/lib/bundler/dsl.rb +147 -103
  46. data/bundler/lib/bundler/endpoint_specification.rb +30 -3
  47. data/bundler/lib/bundler/env.rb +1 -1
  48. data/bundler/lib/bundler/environment_preserver.rb +5 -23
  49. data/bundler/lib/bundler/errors.rb +53 -5
  50. data/bundler/lib/bundler/feature_flag.rb +18 -18
  51. data/bundler/lib/bundler/fetcher/compact_index.rb +16 -25
  52. data/bundler/lib/bundler/fetcher/dependency.rb +2 -1
  53. data/bundler/lib/bundler/fetcher/downloader.rb +34 -8
  54. data/bundler/lib/bundler/fetcher.rb +63 -26
  55. data/bundler/lib/bundler/force_platform.rb +0 -2
  56. data/bundler/lib/bundler/friendly_errors.rb +3 -2
  57. data/bundler/lib/bundler/gem_helper.rb +1 -1
  58. data/bundler/lib/bundler/gem_version_promoter.rb +42 -40
  59. data/bundler/lib/bundler/index.rb +7 -2
  60. data/bundler/lib/bundler/injector.rb +14 -16
  61. data/bundler/lib/bundler/inline.rb +42 -17
  62. data/bundler/lib/bundler/installer/gem_installer.rb +4 -3
  63. data/bundler/lib/bundler/installer/parallel_installer.rb +3 -2
  64. data/bundler/lib/bundler/installer/standalone.rb +2 -5
  65. data/bundler/lib/bundler/installer.rb +22 -45
  66. data/bundler/lib/bundler/lazy_specification.rb +121 -48
  67. data/bundler/lib/bundler/lockfile_generator.rb +1 -1
  68. data/bundler/lib/bundler/lockfile_parser.rb +36 -9
  69. data/bundler/lib/bundler/man/bundle-add.1 +44 -27
  70. data/bundler/lib/bundler/man/bundle-add.1.ronn +52 -23
  71. data/bundler/lib/bundler/man/bundle-binstubs.1 +9 -6
  72. data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
  73. data/bundler/lib/bundler/man/bundle-cache.1 +32 -4
  74. data/bundler/lib/bundler/man/bundle-cache.1.ronn +31 -2
  75. data/bundler/lib/bundler/man/bundle-check.1 +7 -5
  76. data/bundler/lib/bundler/man/bundle-check.1.ronn +7 -2
  77. data/bundler/lib/bundler/man/bundle-clean.1 +3 -3
  78. data/bundler/lib/bundler/man/bundle-config.1 +180 -138
  79. data/bundler/lib/bundler/man/bundle-config.1.ronn +96 -99
  80. data/bundler/lib/bundler/man/bundle-console.1 +4 -6
  81. data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -7
  82. data/bundler/lib/bundler/man/bundle-doctor.1 +46 -7
  83. data/bundler/lib/bundler/man/bundle-doctor.1.ronn +49 -5
  84. data/bundler/lib/bundler/man/bundle-env.1 +9 -0
  85. data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
  86. data/bundler/lib/bundler/man/bundle-exec.1 +9 -6
  87. data/bundler/lib/bundler/man/bundle-exec.1.ronn +6 -3
  88. data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
  89. data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
  90. data/bundler/lib/bundler/man/bundle-gem.1 +69 -28
  91. data/bundler/lib/bundler/man/bundle-gem.1.ronn +42 -6
  92. data/bundler/lib/bundler/man/bundle-help.1 +3 -3
  93. data/bundler/lib/bundler/man/bundle-info.1 +7 -4
  94. data/bundler/lib/bundler/man/bundle-info.1.ronn +6 -2
  95. data/bundler/lib/bundler/man/bundle-init.1 +5 -5
  96. data/bundler/lib/bundler/man/bundle-init.1.ronn +3 -2
  97. data/bundler/lib/bundler/man/bundle-inject.1 +13 -5
  98. data/bundler/lib/bundler/man/bundle-inject.1.ronn +10 -2
  99. data/bundler/lib/bundler/man/bundle-install.1 +20 -17
  100. data/bundler/lib/bundler/man/bundle-install.1.ronn +26 -23
  101. data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
  102. data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
  103. data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
  104. data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  105. data/bundler/lib/bundler/man/bundle-list.1 +3 -3
  106. data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
  107. data/bundler/lib/bundler/man/bundle-lock.1 +23 -8
  108. data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
  109. data/bundler/lib/bundler/man/bundle-open.1 +4 -4
  110. data/bundler/lib/bundler/man/bundle-open.1.ronn +2 -1
  111. data/bundler/lib/bundler/man/bundle-outdated.1 +10 -7
  112. data/bundler/lib/bundler/man/bundle-outdated.1.ronn +8 -4
  113. data/bundler/lib/bundler/man/bundle-platform.1 +3 -3
  114. data/bundler/lib/bundler/man/bundle-plugin.1 +9 -6
  115. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +7 -3
  116. data/bundler/lib/bundler/man/bundle-pristine.1 +3 -3
  117. data/bundler/lib/bundler/man/bundle-pristine.1.ronn +1 -1
  118. data/bundler/lib/bundler/man/bundle-remove.1 +3 -3
  119. data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
  120. data/bundler/lib/bundler/man/bundle-show.1 +7 -4
  121. data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
  122. data/bundler/lib/bundler/man/bundle-update.1 +17 -11
  123. data/bundler/lib/bundler/man/bundle-update.1.ronn +17 -9
  124. data/bundler/lib/bundler/man/bundle-version.1 +3 -3
  125. data/bundler/lib/bundler/man/bundle-viz.1 +6 -6
  126. data/bundler/lib/bundler/man/bundle-viz.1.ronn +7 -3
  127. data/bundler/lib/bundler/man/bundle.1 +3 -3
  128. data/bundler/lib/bundler/man/gemfile.5 +7 -5
  129. data/bundler/lib/bundler/man/gemfile.5.ronn +8 -2
  130. data/bundler/lib/bundler/man/index.txt +4 -0
  131. data/bundler/lib/bundler/match_metadata.rb +13 -0
  132. data/bundler/lib/bundler/match_platform.rb +31 -12
  133. data/bundler/lib/bundler/materialization.rb +59 -0
  134. data/bundler/lib/bundler/mirror.rb +3 -3
  135. data/bundler/lib/bundler/plugin/api/source.rb +5 -4
  136. data/bundler/lib/bundler/plugin/events.rb +24 -0
  137. data/bundler/lib/bundler/plugin/index.rb +5 -1
  138. data/bundler/lib/bundler/plugin/installer/path.rb +26 -0
  139. data/bundler/lib/bundler/plugin/installer.rb +37 -17
  140. data/bundler/lib/bundler/plugin/source_list.rb +4 -4
  141. data/bundler/lib/bundler/plugin.rb +21 -2
  142. data/bundler/lib/bundler/process_lock.rb +10 -14
  143. data/bundler/lib/bundler/remote_specification.rb +6 -1
  144. data/bundler/lib/bundler/resolver/base.rb +14 -3
  145. data/bundler/lib/bundler/resolver/candidate.rb +18 -27
  146. data/bundler/lib/bundler/resolver/package.rb +20 -3
  147. data/bundler/lib/bundler/resolver/spec_group.rb +22 -27
  148. data/bundler/lib/bundler/resolver/strategy.rb +40 -0
  149. data/bundler/lib/bundler/resolver.rb +114 -52
  150. data/bundler/lib/bundler/retry.rb +1 -1
  151. data/bundler/lib/bundler/ruby_dsl.rb +12 -3
  152. data/bundler/lib/bundler/ruby_version.rb +7 -1
  153. data/bundler/lib/bundler/rubygems_ext.rb +303 -150
  154. data/bundler/lib/bundler/rubygems_gem_installer.rb +40 -5
  155. data/bundler/lib/bundler/rubygems_integration.rb +40 -73
  156. data/bundler/lib/bundler/runtime.rb +48 -35
  157. data/bundler/lib/bundler/self_manager.rb +36 -26
  158. data/bundler/lib/bundler/settings/validator.rb +0 -23
  159. data/bundler/lib/bundler/settings.rb +36 -27
  160. data/bundler/lib/bundler/setup.rb +6 -0
  161. data/bundler/lib/bundler/shared_helpers.rb +45 -25
  162. data/bundler/lib/bundler/source/gemspec.rb +1 -4
  163. data/bundler/lib/bundler/source/git/git_proxy.rb +26 -9
  164. data/bundler/lib/bundler/source/git.rb +113 -41
  165. data/bundler/lib/bundler/source/metadata.rb +4 -3
  166. data/bundler/lib/bundler/source/path.rb +14 -18
  167. data/bundler/lib/bundler/source/rubygems/remote.rb +12 -4
  168. data/bundler/lib/bundler/source/rubygems.rb +54 -48
  169. data/bundler/lib/bundler/source.rb +2 -0
  170. data/bundler/lib/bundler/source_list.rb +54 -12
  171. data/bundler/lib/bundler/source_map.rb +1 -1
  172. data/bundler/lib/bundler/spec_set.rb +227 -103
  173. data/bundler/lib/bundler/stub_specification.rb +29 -2
  174. data/bundler/lib/bundler/templates/Executable +0 -11
  175. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
  176. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +1 -3
  177. data/bundler/lib/bundler/templates/newgem/README.md.tt +7 -3
  178. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +17 -15
  179. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +14 -12
  180. data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
  181. data/bundler/lib/bundler/ui/shell.rb +26 -4
  182. data/bundler/lib/bundler/ui/silent.rb +12 -1
  183. data/bundler/lib/bundler/uri_credentials_filter.rb +3 -3
  184. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +53 -3
  185. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  186. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +11 -0
  187. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
  188. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +1 -1
  189. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +2 -1
  190. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +134 -57
  191. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +4 -24
  192. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +1 -0
  193. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
  194. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +20 -8
  195. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +17 -29
  196. data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
  197. data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
  198. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
  199. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
  200. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
  201. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
  202. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
  203. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
  204. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
  205. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
  206. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  207. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  208. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +11 -0
  209. data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
  210. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +43 -16
  211. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
  212. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
  213. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +28 -37
  214. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
  215. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +16 -9
  216. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
  217. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  218. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +9 -9
  219. data/bundler/lib/bundler/vendored_net_http.rb +20 -5
  220. data/bundler/lib/bundler/vendored_securerandom.rb +12 -0
  221. data/bundler/lib/bundler/vendored_timeout.rb +7 -3
  222. data/bundler/lib/bundler/vendored_uri.rb +18 -1
  223. data/bundler/lib/bundler/version.rb +10 -2
  224. data/bundler/lib/bundler/worker.rb +1 -1
  225. data/bundler/lib/bundler/yaml_serializer.rb +12 -7
  226. data/bundler/lib/bundler.rb +101 -61
  227. data/{bundler → doc/bundler}/UPGRADING.md +132 -127
  228. data/doc/rubygems/CONTRIBUTING.md +227 -0
  229. data/{POLICIES.md → doc/rubygems/POLICIES.md} +86 -17
  230. data/exe/update_rubygems +1 -1
  231. data/lib/rubygems/basic_specification.rb +50 -10
  232. data/lib/rubygems/bundler_version_finder.rb +1 -1
  233. data/lib/rubygems/command.rb +1 -4
  234. data/lib/rubygems/command_manager.rb +5 -6
  235. data/lib/rubygems/commands/build_command.rb +2 -11
  236. data/lib/rubygems/commands/cleanup_command.rb +3 -13
  237. data/lib/rubygems/commands/contents_command.rb +17 -10
  238. data/lib/rubygems/commands/environment_command.rb +5 -0
  239. data/lib/rubygems/commands/exec_command.rb +18 -11
  240. data/lib/rubygems/commands/fetch_command.rb +14 -0
  241. data/lib/rubygems/commands/help_command.rb +2 -2
  242. data/lib/rubygems/commands/install_command.rb +0 -4
  243. data/lib/rubygems/commands/pristine_command.rb +29 -19
  244. data/lib/rubygems/commands/push_command.rb +31 -6
  245. data/lib/rubygems/commands/rdoc_command.rb +3 -10
  246. data/lib/rubygems/commands/rebuild_command.rb +262 -0
  247. data/lib/rubygems/commands/setup_command.rb +13 -18
  248. data/lib/rubygems/commands/sources_command.rb +2 -2
  249. data/lib/rubygems/commands/uninstall_command.rb +9 -4
  250. data/lib/rubygems/commands/unpack_command.rb +0 -6
  251. data/lib/rubygems/commands/update_command.rb +13 -22
  252. data/lib/rubygems/config_file.rb +45 -16
  253. data/lib/rubygems/core_ext/kernel_require.rb +15 -3
  254. data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
  255. data/lib/rubygems/defaults.rb +7 -7
  256. data/lib/rubygems/dependency.rb +12 -16
  257. data/lib/rubygems/dependency_list.rb +1 -1
  258. data/lib/rubygems/deprecate.rb +79 -77
  259. data/lib/rubygems/errors.rb +2 -1
  260. data/lib/rubygems/exceptions.rb +2 -9
  261. data/lib/rubygems/ext/builder.rb +21 -8
  262. data/lib/rubygems/ext/cargo_builder.rb +16 -26
  263. data/lib/rubygems/ext/cmake_builder.rb +7 -2
  264. data/lib/rubygems/ext/configure_builder.rb +7 -2
  265. data/lib/rubygems/ext/ext_conf_builder.rb +9 -5
  266. data/lib/rubygems/ext/rake_builder.rb +7 -4
  267. data/lib/rubygems/gem_runner.rb +9 -0
  268. data/lib/rubygems/gemcutter_utilities/webauthn_listener.rb +11 -4
  269. data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +3 -1
  270. data/lib/rubygems/gemcutter_utilities.rb +52 -26
  271. data/lib/rubygems/gemspec_helpers.rb +19 -0
  272. data/lib/rubygems/install_update_options.rb +5 -0
  273. data/lib/rubygems/installer.rb +76 -90
  274. data/lib/rubygems/local_remote_options.rb +8 -8
  275. data/lib/rubygems/package/tar_header.rb +31 -4
  276. data/lib/rubygems/package/tar_reader/entry.rb +1 -5
  277. data/lib/rubygems/package/tar_writer.rb +5 -4
  278. data/lib/rubygems/package.rb +13 -8
  279. data/lib/rubygems/platform.rb +148 -43
  280. data/lib/rubygems/psych_tree.rb +4 -0
  281. data/lib/rubygems/query_utils.rb +2 -2
  282. data/lib/rubygems/rdoc.rb +16 -3
  283. data/lib/rubygems/remote_fetcher.rb +6 -7
  284. data/lib/rubygems/request.rb +5 -5
  285. data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
  286. data/lib/rubygems/request_set.rb +4 -7
  287. data/lib/rubygems/requirement.rb +16 -12
  288. data/lib/rubygems/resolver/activation_request.rb +1 -1
  289. data/lib/rubygems/resolver/api_set/gem_parser.rb +2 -5
  290. data/lib/rubygems/resolver/api_set.rb +13 -8
  291. data/lib/rubygems/resolver/best_set.rb +1 -29
  292. data/lib/rubygems/resolver/composed_set.rb +3 -3
  293. data/lib/rubygems/resolver/git_set.rb +0 -1
  294. data/lib/rubygems/resolver/index_set.rb +2 -2
  295. data/lib/rubygems/resolver/source_set.rb +1 -1
  296. data/lib/rubygems/resolver/spec_specification.rb +7 -0
  297. data/lib/rubygems/resolver.rb +8 -8
  298. data/lib/rubygems/s3_uri_signer.rb +8 -6
  299. data/lib/rubygems/safe_marshal/reader.rb +31 -14
  300. data/lib/rubygems/safe_marshal/visitors/to_ruby.rb +29 -16
  301. data/lib/rubygems/safe_yaml.rb +10 -1
  302. data/lib/rubygems/security.rb +1 -1
  303. data/lib/rubygems/source/git.rb +22 -17
  304. data/lib/rubygems/source/installed.rb +3 -1
  305. data/lib/rubygems/source/local.rb +8 -4
  306. data/lib/rubygems/source/specific_file.rb +5 -3
  307. data/lib/rubygems/source.rb +37 -29
  308. data/lib/rubygems/source_list.rb +1 -1
  309. data/lib/rubygems/spec_fetcher.rb +47 -15
  310. data/lib/rubygems/specification.rb +110 -183
  311. data/lib/rubygems/specification_policy.rb +33 -13
  312. data/lib/rubygems/specification_record.rb +212 -0
  313. data/lib/rubygems/stub_specification.rb +32 -10
  314. data/lib/rubygems/target_rbconfig.rb +50 -0
  315. data/lib/rubygems/uninstaller.rb +42 -22
  316. data/lib/rubygems/uri.rb +6 -6
  317. data/lib/rubygems/uri_formatter.rb +2 -1
  318. data/lib/rubygems/util/licenses.rb +118 -1
  319. data/lib/rubygems/util.rb +1 -1
  320. data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
  321. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/delegates/specification_provider.rb +11 -11
  322. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/action.rb +1 -1
  323. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
  324. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
  325. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
  326. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
  327. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/log.rb +1 -1
  328. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
  329. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
  330. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph/vertex.rb +1 -1
  331. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/dependency_graph.rb +2 -2
  332. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/errors.rb +1 -1
  333. data/lib/rubygems/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
  334. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/specification_provider.rb +2 -2
  335. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/modules/ui.rb +1 -1
  336. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolution.rb +4 -4
  337. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/resolver.rb +1 -1
  338. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo/state.rb +1 -1
  339. data/lib/rubygems/{resolver → vendor}/molinillo/lib/molinillo.rb +2 -2
  340. data/lib/rubygems/vendor/net-http/COPYING +56 -0
  341. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/generic_request.rb +9 -9
  342. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/header.rb +3 -3
  343. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/request.rb +3 -3
  344. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/requests.rb +35 -30
  345. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/response.rb +2 -2
  346. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/responses.rb +6 -6
  347. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/status.rb +1 -1
  348. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http.rb +149 -70
  349. data/lib/rubygems/{net-http → vendor/net-http}/lib/net/https.rb +1 -1
  350. data/lib/rubygems/vendor/optparse/COPYING +56 -0
  351. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/ac.rb +16 -0
  352. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/kwargs.rb +8 -3
  353. data/lib/rubygems/vendor/optparse/lib/optparse/uri.rb +7 -0
  354. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/version.rb +9 -0
  355. data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse.rb +158 -62
  356. data/lib/rubygems/vendor/resolv/COPYING +56 -0
  357. data/lib/rubygems/{resolv → vendor/resolv}/lib/resolv.rb +165 -69
  358. data/lib/rubygems/vendor/securerandom/COPYING +56 -0
  359. data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +102 -0
  360. data/lib/rubygems/vendor/timeout/COPYING +56 -0
  361. data/lib/rubygems/{timeout → vendor/timeout}/lib/timeout.rb +10 -11
  362. data/lib/rubygems/{tsort → vendor/tsort}/lib/tsort.rb +2 -2
  363. data/lib/rubygems/vendor/uri/COPYING +56 -0
  364. data/lib/rubygems/vendor/uri/lib/uri/common.rb +880 -0
  365. data/lib/rubygems/vendor/uri/lib/uri/file.rb +100 -0
  366. data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +267 -0
  367. data/lib/rubygems/vendor/uri/lib/uri/generic.rb +1579 -0
  368. data/lib/rubygems/vendor/uri/lib/uri/http.rb +125 -0
  369. data/lib/rubygems/vendor/uri/lib/uri/https.rb +23 -0
  370. data/lib/rubygems/vendor/uri/lib/uri/ldap.rb +261 -0
  371. data/lib/rubygems/vendor/uri/lib/uri/ldaps.rb +22 -0
  372. data/lib/rubygems/vendor/uri/lib/uri/mailto.rb +293 -0
  373. data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  374. data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
  375. data/lib/rubygems/vendor/uri/lib/uri/version.rb +6 -0
  376. data/lib/rubygems/vendor/uri/lib/uri/ws.rb +83 -0
  377. data/lib/rubygems/vendor/uri/lib/uri/wss.rb +23 -0
  378. data/lib/rubygems/vendor/uri/lib/uri.rb +104 -0
  379. data/lib/rubygems/vendored_molinillo.rb +3 -0
  380. data/lib/rubygems/vendored_net_http.rb +5 -0
  381. data/lib/rubygems/vendored_optparse.rb +3 -0
  382. data/lib/rubygems/vendored_securerandom.rb +3 -0
  383. data/lib/rubygems/vendored_timeout.rb +5 -0
  384. data/lib/rubygems/vendored_tsort.rb +3 -0
  385. data/lib/rubygems/version.rb +26 -9
  386. data/lib/rubygems/yaml_serializer.rb +12 -7
  387. data/lib/rubygems.rb +160 -53
  388. data/rubygems-update.gemspec +11 -6
  389. data/setup.rb +1 -1
  390. metadata +124 -96
  391. data/bundler/lib/bundler/compact_index_client/gem_parser.rb +0 -32
  392. data/bundler/lib/bundler/gem_helpers.rb +0 -127
  393. data/bundler/lib/bundler/templates/Executable.bundler +0 -109
  394. data/bundler/lib/bundler/vendor/fileutils/.document +0 -1
  395. data/bundler/lib/bundler/vendor/net-http-persistent/.document +0 -1
  396. data/bundler/lib/bundler/vendor/pub_grub/.document +0 -1
  397. data/bundler/lib/bundler/vendor/thor/.document +0 -1
  398. data/bundler/lib/bundler/vendor/tsort/.document +0 -1
  399. data/bundler/lib/bundler/vendor/uri/.document +0 -1
  400. data/lib/rubygems/net/http.rb +0 -3
  401. data/lib/rubygems/net-http/.document +0 -1
  402. data/lib/rubygems/net-http/LICENSE.txt +0 -22
  403. data/lib/rubygems/net-http/lib/net/http/backward.rb +0 -40
  404. data/lib/rubygems/net-protocol/.document +0 -1
  405. data/lib/rubygems/net-protocol/LICENSE.txt +0 -22
  406. data/lib/rubygems/optparse/.document +0 -1
  407. data/lib/rubygems/optparse/lib/optparse/uri.rb +0 -7
  408. data/lib/rubygems/optparse.rb +0 -3
  409. data/lib/rubygems/resolv/.document +0 -1
  410. data/lib/rubygems/resolv/LICENSE.txt +0 -22
  411. data/lib/rubygems/resolver/molinillo/.document +0 -1
  412. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  413. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  414. data/lib/rubygems/resolver/molinillo.rb +0 -3
  415. data/lib/rubygems/shellwords.rb +0 -3
  416. data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +0 -21
  417. data/lib/rubygems/timeout/.document +0 -1
  418. data/lib/rubygems/timeout/LICENSE.txt +0 -22
  419. data/lib/rubygems/timeout.rb +0 -3
  420. data/lib/rubygems/tsort/.document +0 -1
  421. data/lib/rubygems/tsort/LICENSE.txt +0 -22
  422. data/lib/rubygems/tsort.rb +0 -3
  423. /data/{lib/rubygems/optparse → bundler/lib/bundler/vendor/fileutils}/COPYING +0 -0
  424. /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
  425. /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
  426. /data/lib/rubygems/ssl_certs/rubygems.org/{GlobalSignRootCA_R3.pem → GlobalSign.pem} +0 -0
  427. /data/{bundler/lib/bundler/vendor/connection_pool → lib/rubygems/vendor}/.document +0 -0
  428. /data/lib/rubygems/{resolver → vendor}/molinillo/LICENSE +0 -0
  429. /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/exceptions.rb +0 -0
  430. /data/lib/rubygems/{net-http → vendor/net-http}/lib/net/http/proxy_delta.rb +0 -0
  431. /data/{bundler/lib/bundler/vendor/fileutils → lib/rubygems/vendor/net-protocol}/LICENSE.txt +0 -0
  432. /data/lib/rubygems/{net-protocol → vendor/net-protocol}/lib/net/protocol.rb +0 -0
  433. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optionparser.rb +0 -0
  434. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/date.rb +0 -0
  435. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/shellwords.rb +0 -0
  436. /data/lib/rubygems/{optparse → vendor/optparse}/lib/optparse/time.rb +0 -0
  437. /data/{bundler/lib/bundler/vendor/uri → lib/rubygems/vendor/tsort}/LICENSE.txt +0 -0
@@ -180,7 +180,8 @@ end
180
180
  # - {CVE-2004-0452}[https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0452].
181
181
  #
182
182
  module Bundler::FileUtils
183
- VERSION = "1.7.2"
183
+ # The version number.
184
+ VERSION = "1.7.3"
184
185
 
185
186
  def self.private_module_function(name) #:nodoc:
186
187
  module_function name
@@ -1651,7 +1652,7 @@ module Bundler::FileUtils
1651
1652
  when "a"
1652
1653
  mask | 07777
1653
1654
  else
1654
- raise ArgumentError, "invalid `who' symbol in file mode: #{chr}"
1655
+ raise ArgumentError, "invalid 'who' symbol in file mode: #{chr}"
1655
1656
  end
1656
1657
  end
1657
1658
  end
@@ -1705,7 +1706,7 @@ module Bundler::FileUtils
1705
1706
  copy_mask = user_mask(chr)
1706
1707
  (current_mode & copy_mask) / (copy_mask & 0111) * (user_mask & 0111)
1707
1708
  else
1708
- raise ArgumentError, "invalid `perm' symbol in file mode: #{chr}"
1709
+ raise ArgumentError, "invalid 'perm' symbol in file mode: #{chr}"
1709
1710
  end
1710
1711
  end
1711
1712
 
@@ -2028,21 +2029,22 @@ module Bundler::FileUtils
2028
2029
 
2029
2030
  private
2030
2031
 
2031
- module StreamUtils_
2032
+ module StreamUtils_ # :nodoc:
2033
+
2032
2034
  private
2033
2035
 
2034
2036
  case (defined?(::RbConfig) ? ::RbConfig::CONFIG['host_os'] : ::RUBY_PLATFORM)
2035
2037
  when /mswin|mingw/
2036
- def fu_windows?; true end
2038
+ def fu_windows?; true end #:nodoc:
2037
2039
  else
2038
- def fu_windows?; false end
2040
+ def fu_windows?; false end #:nodoc:
2039
2041
  end
2040
2042
 
2041
2043
  def fu_copy_stream0(src, dest, blksize = nil) #:nodoc:
2042
2044
  IO.copy_stream(src, dest)
2043
2045
  end
2044
2046
 
2045
- def fu_stream_blksize(*streams)
2047
+ def fu_stream_blksize(*streams) #:nodoc:
2046
2048
  streams.each do |s|
2047
2049
  next unless s.respond_to?(:stat)
2048
2050
  size = fu_blksize(s.stat)
@@ -2051,14 +2053,14 @@ module Bundler::FileUtils
2051
2053
  fu_default_blksize()
2052
2054
  end
2053
2055
 
2054
- def fu_blksize(st)
2056
+ def fu_blksize(st) #:nodoc:
2055
2057
  s = st.blksize
2056
2058
  return nil unless s
2057
2059
  return nil if s == 0
2058
2060
  s
2059
2061
  end
2060
2062
 
2061
- def fu_default_blksize
2063
+ def fu_default_blksize #:nodoc:
2062
2064
  1024
2063
2065
  end
2064
2066
  end
@@ -2503,7 +2505,7 @@ module Bundler::FileUtils
2503
2505
  end
2504
2506
  private_module_function :fu_output_message
2505
2507
 
2506
- def fu_split_path(path)
2508
+ def fu_split_path(path) #:nodoc:
2507
2509
  path = File.path(path)
2508
2510
  list = []
2509
2511
  until (parent, base = File.split(path); parent == path or parent == ".")
@@ -2524,7 +2526,7 @@ module Bundler::FileUtils
2524
2526
  end
2525
2527
  private_module_function :fu_relative_components_from
2526
2528
 
2527
- def fu_clean_components(*comp)
2529
+ def fu_clean_components(*comp) #:nodoc:
2528
2530
  comp.shift while comp.first == "."
2529
2531
  return comp if comp.empty?
2530
2532
  clean = [comp.shift]
@@ -2543,11 +2545,11 @@ module Bundler::FileUtils
2543
2545
  private_module_function :fu_clean_components
2544
2546
 
2545
2547
  if fu_windows?
2546
- def fu_starting_path?(path)
2548
+ def fu_starting_path?(path) #:nodoc:
2547
2549
  path&.start_with?(%r(\w:|/))
2548
2550
  end
2549
2551
  else
2550
- def fu_starting_path?(path)
2552
+ def fu_starting_path?(path) #:nodoc:
2551
2553
  path&.start_with?("/")
2552
2554
  end
2553
2555
  end
@@ -1,7 +1,7 @@
1
1
  = net-http-persistent
2
2
 
3
3
  home :: https://github.com/drbrain/net-http-persistent
4
- rdoc :: https://rdoc.info/gems/net-http-persistent
4
+ rdoc :: https://rubydoc.info/gems/net-http-persistent
5
5
 
6
6
  == DESCRIPTION:
7
7
 
@@ -63,7 +63,8 @@ class Gem::Net::HTTP::Persistent::TimedStackMulti < Bundler::ConnectionPool::Tim
63
63
  if @created >= @max && @enqueued >= 1
64
64
  oldest, = @lru.first
65
65
  @lru.delete oldest
66
- @ques[oldest].pop
66
+ connection = @ques[oldest].pop
67
+ connection.close if connection.respond_to?(:close)
67
68
 
68
69
  @created -= 1
69
70
  end
@@ -1,6 +1,7 @@
1
1
  require_relative '../../../../../vendored_net_http'
2
- require_relative '../../../../uri/lib/uri'
3
- require 'cgi' # for escaping
2
+ require_relative '../../../../../vendored_uri'
3
+ require 'cgi/escape'
4
+ require 'cgi/util' unless defined?(CGI::EscapeExt)
4
5
  require_relative '../../../../connection_pool/lib/connection_pool'
5
6
 
6
7
  autoload :OpenSSL, 'openssl'
@@ -22,7 +23,7 @@ autoload :OpenSSL, 'openssl'
22
23
  #
23
24
  # require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
24
25
  #
25
- # uri = Bundler::URI 'http://example.com/awesome/web/service'
26
+ # uri = Gem::URI 'http://example.com/awesome/web/service'
26
27
  #
27
28
  # http = Gem::Net::HTTP::Persistent.new
28
29
  #
@@ -39,17 +40,16 @@ autoload :OpenSSL, 'openssl'
39
40
  # post = Gem::Net::HTTP::Post.new post_uri.path
40
41
  # post.set_form_data 'some' => 'cool data'
41
42
  #
42
- # # perform the POST, the Bundler::URI is always required
43
+ # # perform the POST, the Gem::URI is always required
43
44
  # response http.request post_uri, post
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
47
- # params which are sent in the body for other requests.
46
+ # Note that for GET, HEAD and other requests that do not have a body,
47
+ # it uses Gem::URI#request_uri as default to send query params
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
  #
@@ -60,6 +60,7 @@ autoload :OpenSSL, 'openssl'
60
60
  # #ca_path :: Directory with certificate-authorities
61
61
  # #cert_store :: An SSL certificate store
62
62
  # #ciphers :: List of SSl ciphers allowed
63
+ # #extra_chain_cert :: Extra certificates to be added to the certificate chain
63
64
  # #private_key :: The client's SSL private key
64
65
  # #reuse_ssl_sessions :: Reuse a previously opened SSL session for a new
65
66
  # connection
@@ -68,11 +69,13 @@ autoload :OpenSSL, 'openssl'
68
69
  # #verify_callback :: For server certificate verification
69
70
  # #verify_depth :: Depth of certificate verification
70
71
  # #verify_mode :: How connections should be verified
72
+ # #verify_hostname :: Use hostname verification for server certificate
73
+ # during the handshake
71
74
  #
72
75
  # == Proxies
73
76
  #
74
77
  # 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
78
+ # second argument to ::new. The proxy may be the Gem::URI of the proxy server or
76
79
  # <code>:ENV</code> which will consult environment variables.
77
80
  #
78
81
  # See #proxy= and #proxy_from_env for details.
@@ -174,7 +177,7 @@ class Gem::Net::HTTP::Persistent
174
177
  ##
175
178
  # The version of Gem::Net::HTTP::Persistent you are using
176
179
 
177
- VERSION = '4.0.2'
180
+ VERSION = '4.0.6'
178
181
 
179
182
  ##
180
183
  # Error class for errors raised by Gem::Net::HTTP::Persistent. Various
@@ -197,7 +200,7 @@ class Gem::Net::HTTP::Persistent
197
200
  # NOTE: This may not work on ruby > 1.9.
198
201
 
199
202
  def self.detect_idle_timeout uri, max = 10
200
- uri = Bundler::URI uri unless Bundler::URI::Generic === uri
203
+ uri = Gem::URI uri unless Gem::URI::Generic === uri
201
204
  uri += '/'
202
205
 
203
206
  req = Gem::Net::HTTP::Head.new uri.request_uri
@@ -265,6 +268,11 @@ class Gem::Net::HTTP::Persistent
265
268
 
266
269
  attr_reader :ciphers
267
270
 
271
+ ##
272
+ # Extra certificates to be added to the certificate chain
273
+
274
+ attr_reader :extra_chain_cert
275
+
268
276
  ##
269
277
  # Sends debug_output to this IO via Gem::Net::HTTP#set_debug_output.
270
278
  #
@@ -449,19 +457,34 @@ class Gem::Net::HTTP::Persistent
449
457
 
450
458
  attr_reader :verify_mode
451
459
 
460
+ ##
461
+ # HTTPS verify_hostname.
462
+ #
463
+ # If a client sets this to true and enables SNI with SSLSocket#hostname=,
464
+ # the hostname verification on the server certificate is performed
465
+ # automatically during the handshake using
466
+ # OpenSSL::SSL.verify_certificate_identity().
467
+ #
468
+ # You can set +verify_hostname+ as true to use hostname verification
469
+ # during the handshake.
470
+ #
471
+ # NOTE: This works with Ruby > 3.0.
472
+
473
+ attr_reader :verify_hostname
474
+
452
475
  ##
453
476
  # Creates a new Gem::Net::HTTP::Persistent.
454
477
  #
455
478
  # Set a +name+ for fun. Your library name should be good enough, but this
456
479
  # otherwise has no purpose.
457
480
  #
458
- # +proxy+ may be set to a Bundler::URI::HTTP or :ENV to pick up proxy options from
481
+ # +proxy+ may be set to a Gem::URI::HTTP or :ENV to pick up proxy options from
459
482
  # the environment. See proxy_from_env for details.
460
483
  #
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:
484
+ # In order to use a Gem::URI for the proxy you may need to do some extra work
485
+ # beyond Gem::URI parsing if the proxy requires a password:
463
486
  #
464
- # proxy = Bundler::URI 'http://proxy.example'
487
+ # proxy = Gem::URI 'http://proxy.example'
465
488
  # proxy.user = 'AzureDiamond'
466
489
  # proxy.password = 'hunter2'
467
490
  #
@@ -508,9 +531,10 @@ class Gem::Net::HTTP::Persistent
508
531
  @verify_callback = nil
509
532
  @verify_depth = nil
510
533
  @verify_mode = nil
534
+ @verify_hostname = nil
511
535
  @cert_store = nil
512
536
 
513
- @generation = 0 # incremented when proxy Bundler::URI changes
537
+ @generation = 0 # incremented when proxy Gem::URI changes
514
538
 
515
539
  if HAVE_OPENSSL then
516
540
  @verify_mode = OpenSSL::SSL::VERIFY_PEER
@@ -569,6 +593,21 @@ class Gem::Net::HTTP::Persistent
569
593
  reconnect_ssl
570
594
  end
571
595
 
596
+ if Gem::Net::HTTP.method_defined?(:extra_chain_cert=)
597
+ ##
598
+ # Extra certificates to be added to the certificate chain.
599
+ # It is only supported starting from Gem::Net::HTTP version 0.1.1
600
+ def extra_chain_cert= extra_chain_cert
601
+ @extra_chain_cert = extra_chain_cert
602
+
603
+ reconnect_ssl
604
+ end
605
+ else
606
+ def extra_chain_cert= _extra_chain_cert
607
+ raise "extra_chain_cert= is not supported by this version of Gem::Net::HTTP"
608
+ end
609
+ end
610
+
572
611
  ##
573
612
  # Creates a new connection for +uri+
574
613
 
@@ -587,37 +626,49 @@ class Gem::Net::HTTP::Persistent
587
626
 
588
627
  connection = @pool.checkout net_http_args
589
628
 
590
- http = connection.http
591
-
592
- connection.ressl @ssl_generation if
593
- connection.ssl_generation != @ssl_generation
629
+ begin
630
+ http = connection.http
594
631
 
595
- if not http.started? then
596
- ssl http if use_ssl
597
- start http
598
- elsif expired? connection then
599
- reset connection
600
- end
632
+ connection.ressl @ssl_generation if
633
+ connection.ssl_generation != @ssl_generation
601
634
 
602
- http.keep_alive_timeout = @idle_timeout if @idle_timeout
603
- http.max_retries = @max_retries if http.respond_to?(:max_retries=)
604
- http.read_timeout = @read_timeout if @read_timeout
605
- http.write_timeout = @write_timeout if
606
- @write_timeout && http.respond_to?(:write_timeout=)
635
+ if not http.started? then
636
+ ssl http if use_ssl
637
+ start http
638
+ elsif expired? connection then
639
+ reset connection
640
+ end
607
641
 
608
- return yield connection
609
- rescue Errno::ECONNREFUSED
610
- address = http.proxy_address || http.address
611
- port = http.proxy_port || http.port
642
+ http.keep_alive_timeout = @idle_timeout if @idle_timeout
643
+ http.max_retries = @max_retries if http.respond_to?(:max_retries=)
644
+ http.read_timeout = @read_timeout if @read_timeout
645
+ http.write_timeout = @write_timeout if
646
+ @write_timeout && http.respond_to?(:write_timeout=)
647
+
648
+ return yield connection
649
+ rescue Errno::ECONNREFUSED
650
+ if http.proxy?
651
+ address = http.proxy_address
652
+ port = http.proxy_port
653
+ else
654
+ address = http.address
655
+ port = http.port
656
+ end
612
657
 
613
- raise Error, "connection refused: #{address}:#{port}"
614
- rescue Errno::EHOSTDOWN
615
- address = http.proxy_address || http.address
616
- port = http.proxy_port || http.port
658
+ raise Error, "connection refused: #{address}:#{port}"
659
+ rescue Errno::EHOSTDOWN
660
+ if http.proxy?
661
+ address = http.proxy_address
662
+ port = http.proxy_port
663
+ else
664
+ address = http.address
665
+ port = http.port
666
+ end
617
667
 
618
- raise Error, "host down: #{address}:#{port}"
619
- ensure
620
- @pool.checkin net_http_args
668
+ raise Error, "host down: #{address}:#{port}"
669
+ ensure
670
+ @pool.checkin net_http_args
671
+ end
621
672
  end
622
673
 
623
674
  ##
@@ -720,12 +771,12 @@ class Gem::Net::HTTP::Persistent
720
771
  alias key= private_key=
721
772
 
722
773
  ##
723
- # Sets the proxy server. The +proxy+ may be the Bundler::URI of the proxy server,
774
+ # Sets the proxy server. The +proxy+ may be the Gem::URI of the proxy server,
724
775
  # the symbol +:ENV+ which will read the proxy from the environment or nil to
725
776
  # disable use of a proxy. See #proxy_from_env for details on setting the
726
777
  # proxy from the environment.
727
778
  #
728
- # If the proxy Bundler::URI is set after requests have been made, the next request
779
+ # If the proxy Gem::URI is set after requests have been made, the next request
729
780
  # will shut-down and re-open all connections.
730
781
  #
731
782
  # The +no_proxy+ query parameter can be used to specify hosts which shouldn't
@@ -736,9 +787,9 @@ class Gem::Net::HTTP::Persistent
736
787
  def proxy= proxy
737
788
  @proxy_uri = case proxy
738
789
  when :ENV then proxy_from_env
739
- when Bundler::URI::HTTP then proxy
790
+ when Gem::URI::HTTP then proxy
740
791
  when nil then # ignore
741
- else raise ArgumentError, 'proxy must be :ENV or a Bundler::URI::HTTP'
792
+ else raise ArgumentError, 'proxy must be :ENV or a Gem::URI::HTTP'
742
793
  end
743
794
 
744
795
  @no_proxy.clear
@@ -754,7 +805,7 @@ class Gem::Net::HTTP::Persistent
754
805
  @proxy_connection_id = [nil, *@proxy_args].join ':'
755
806
 
756
807
  if @proxy_uri.query then
757
- @no_proxy = CGI.parse(@proxy_uri.query)['no_proxy'].join(',').downcase.split(',').map { |x| x.strip }.reject { |x| x.empty? }
808
+ @no_proxy = Gem::URI.decode_www_form(@proxy_uri.query).filter_map { |k, v| v if k == 'no_proxy' }.join(',').downcase.split(',').map { |x| x.strip }.reject { |x| x.empty? }
758
809
  end
759
810
  end
760
811
 
@@ -763,13 +814,13 @@ class Gem::Net::HTTP::Persistent
763
814
  end
764
815
 
765
816
  ##
766
- # Creates a Bundler::URI for an HTTP proxy server from ENV variables.
817
+ # Creates a Gem::URI for an HTTP proxy server from ENV variables.
767
818
  #
768
819
  # If +HTTP_PROXY+ is set a proxy will be returned.
769
820
  #
770
- # If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the Bundler::URI is given the
821
+ # If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the Gem::URI is given the
771
822
  # indicated user and password unless HTTP_PROXY contains either of these in
772
- # the Bundler::URI.
823
+ # the Gem::URI.
773
824
  #
774
825
  # The +NO_PROXY+ ENV variable can be used to specify hosts which shouldn't
775
826
  # be reached via proxy; if set it should be a comma separated list of
@@ -785,7 +836,7 @@ class Gem::Net::HTTP::Persistent
785
836
 
786
837
  return nil if env_proxy.nil? or env_proxy.empty?
787
838
 
788
- uri = Bundler::URI normalize_uri env_proxy
839
+ uri = Gem::URI normalize_uri env_proxy
789
840
 
790
841
  env_no_proxy = ENV['no_proxy'] || ENV['NO_PROXY']
791
842
 
@@ -863,7 +914,7 @@ class Gem::Net::HTTP::Persistent
863
914
  # +req+ must be a Gem::Net::HTTPGenericRequest subclass (see Gem::Net::HTTP for a list).
864
915
 
865
916
  def request uri, req = nil, &block
866
- uri = Bundler::URI uri
917
+ uri = Gem::URI uri
867
918
  req = request_setup req || uri
868
919
  response = nil
869
920
 
@@ -896,7 +947,7 @@ class Gem::Net::HTTP::Persistent
896
947
  end
897
948
 
898
949
  ##
899
- # Creates a GET request if +req_or_uri+ is a Bundler::URI and adds headers to the
950
+ # Creates a GET request if +req_or_uri+ is a Gem::URI and adds headers to the
900
951
  # request.
901
952
  #
902
953
  # Returns the request.
@@ -925,7 +976,8 @@ class Gem::Net::HTTP::Persistent
925
976
  end
926
977
 
927
978
  ##
928
- # Shuts down all connections
979
+ # Shuts down all connections. Attempting to checkout a connection after
980
+ # shutdown will raise an error.
929
981
  #
930
982
  # *NOTE*: Calling shutdown for can be dangerous!
931
983
  #
@@ -936,6 +988,17 @@ class Gem::Net::HTTP::Persistent
936
988
  @pool.shutdown { |http| http.finish }
937
989
  end
938
990
 
991
+ ##
992
+ # Discard all existing connections. Subsequent checkouts will create
993
+ # new connections as needed.
994
+ #
995
+ # If any thread is still using a connection it may cause an error! Call
996
+ # #reload when you are completely done making requests!
997
+
998
+ def reload
999
+ @pool.reload { |http| http.finish }
1000
+ end
1001
+
939
1002
  ##
940
1003
  # Enables SSL on +connection+
941
1004
 
@@ -948,8 +1011,10 @@ class Gem::Net::HTTP::Persistent
948
1011
  connection.min_version = @min_version if @min_version
949
1012
  connection.max_version = @max_version if @max_version
950
1013
 
951
- connection.verify_depth = @verify_depth
952
- connection.verify_mode = @verify_mode
1014
+ connection.verify_depth = @verify_depth
1015
+ connection.verify_mode = @verify_mode
1016
+ connection.verify_hostname = @verify_hostname if
1017
+ @verify_hostname != nil && connection.respond_to?(:verify_hostname=)
953
1018
 
954
1019
  if OpenSSL::SSL::VERIFY_PEER == OpenSSL::SSL::VERIFY_NONE and
955
1020
  not Object.const_defined?(:I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG) then
@@ -991,6 +1056,10 @@ application:
991
1056
  connection.key = @private_key
992
1057
  end
993
1058
 
1059
+ if defined?(@extra_chain_cert) and @extra_chain_cert
1060
+ connection.extra_chain_cert = @extra_chain_cert
1061
+ end
1062
+
994
1063
  connection.cert_store = if @cert_store then
995
1064
  @cert_store
996
1065
  else
@@ -1058,6 +1127,15 @@ application:
1058
1127
  reconnect_ssl
1059
1128
  end
1060
1129
 
1130
+ ##
1131
+ # Sets the HTTPS verify_hostname.
1132
+
1133
+ def verify_hostname= verify_hostname
1134
+ @verify_hostname = verify_hostname
1135
+
1136
+ reconnect_ssl
1137
+ end
1138
+
1061
1139
  ##
1062
1140
  # SSL verification callback.
1063
1141
 
@@ -1070,4 +1148,3 @@ end
1070
1148
 
1071
1149
  require_relative 'persistent/connection'
1072
1150
  require_relative 'persistent/pool'
1073
-
@@ -79,29 +79,17 @@ module Bundler::PubGrub
79
79
  dependencies_for(@root_package, @root_version)
80
80
  end
81
81
 
82
- # Override me (maybe)
83
- #
84
- # If not overridden, the order returned by all_versions_for will be used
85
- #
86
- # Returns: Array of versions in preferred order
87
- def sort_versions_by_preferred(package, sorted_versions)
88
- indexes = @version_indexes[package]
89
- sorted_versions.sort_by { |version| indexes[version] }
90
- end
91
-
92
82
  def initialize
93
83
  @root_package = Package.root
94
84
  @root_version = Package.root_version
95
85
 
96
- @cached_versions = Hash.new do |h,k|
86
+ @sorted_versions = Hash.new do |h,k|
97
87
  if k == @root_package
98
88
  h[k] = [@root_version]
99
89
  else
100
- h[k] = all_versions_for(k)
90
+ h[k] = all_versions_for(k).sort
101
91
  end
102
92
  end
103
- @sorted_versions = Hash.new { |h,k| h[k] = @cached_versions[k].sort }
104
- @version_indexes = Hash.new { |h,k| h[k] = @cached_versions[k].each.with_index.to_h }
105
93
 
106
94
  @cached_dependencies = Hash.new do |packages, package|
107
95
  if package == @root_package
@@ -117,15 +105,7 @@ module Bundler::PubGrub
117
105
  end
118
106
 
119
107
  def versions_for(package, range=VersionRange.any)
120
- versions = range.select_versions(@sorted_versions[package])
121
-
122
- # Conditional avoids (among other things) calling
123
- # sort_versions_by_preferred with the root package
124
- if versions.size > 1
125
- sort_versions_by_preferred(package, versions)
126
- else
127
- versions
128
- end
108
+ range.select_versions(@sorted_versions[package])
129
109
  end
130
110
 
131
111
  def no_versions_incompatibility_for(_package, unsatisfied_term)
@@ -164,7 +144,7 @@ module Bundler::PubGrub
164
144
  sorted_versions[high]
165
145
  end
166
146
 
167
- range = VersionRange.new(min: low, max: high, include_min: true)
147
+ range = VersionRange.new(min: low, max: high, include_min: !low.nil?)
168
148
 
169
149
  self_constraint = VersionConstraint.new(package, range: range)
170
150
 
@@ -1,4 +1,5 @@
1
1
  require_relative 'package'
2
+ require_relative 'rubygems'
2
3
  require_relative 'version_constraint'
3
4
  require_relative 'incompatibility'
4
5
  require_relative 'basic_package_source'
@@ -0,0 +1,42 @@
1
+ module Bundler::PubGrub
2
+ class Strategy
3
+ def initialize(source)
4
+ @source = source
5
+
6
+ @root_package = Package.root
7
+ @root_version = Package.root_version
8
+
9
+ @version_indexes = Hash.new do |h,k|
10
+ if k == @root_package
11
+ h[k] = { @root_version => 0 }
12
+ else
13
+ h[k] = @source.all_versions_for(k).each.with_index.to_h
14
+ end
15
+ end
16
+ end
17
+
18
+ def next_package_and_version(unsatisfied)
19
+ package, range = next_term_to_try_from(unsatisfied)
20
+
21
+ [package, most_preferred_version_of(package, range)]
22
+ end
23
+
24
+ private
25
+
26
+ def most_preferred_version_of(package, range)
27
+ versions = @source.versions_for(package, range)
28
+
29
+ indexes = @version_indexes[package]
30
+ versions.min_by { |version| indexes[version] }
31
+ end
32
+
33
+ def next_term_to_try_from(unsatisfied)
34
+ unsatisfied.min_by do |package, range|
35
+ matching_versions = @source.versions_for(package, range)
36
+ higher_versions = @source.versions_for(package, range.upper_invert)
37
+
38
+ [matching_versions.count <= 1 ? 0 : 1, higher_versions.count]
39
+ end
40
+ end
41
+ end
42
+ end
@@ -76,6 +76,9 @@ module Bundler::PubGrub
76
76
  end
77
77
 
78
78
  def initialize(min: nil, max: nil, include_min: false, include_max: false, name: nil)
79
+ raise ArgumentError, "Ranges without a lower bound cannot have include_min == true" if !min && include_min == true
80
+ raise ArgumentError, "Ranges without an upper bound cannot have include_max == true" if !max && include_max == true
81
+
79
82
  @min = min
80
83
  @max = max
81
84
  @include_min = include_min
@@ -311,10 +314,19 @@ module Bundler::PubGrub
311
314
 
312
315
  def contiguous_to?(other)
313
316
  return false if other.empty?
317
+ return true if any?
318
+
319
+ intersects?(other) || contiguous_below?(other) || contiguous_above?(other)
320
+ end
321
+
322
+ def contiguous_below?(other)
323
+ return false if !max || !other.min
324
+
325
+ max == other.min && (include_max || other.include_min)
326
+ end
314
327
 
315
- intersects?(other) ||
316
- (min == other.max && (include_min || other.include_max)) ||
317
- (max == other.min && (include_max || other.include_min))
328
+ def contiguous_above?(other)
329
+ other.contiguous_below?(self)
318
330
  end
319
331
 
320
332
  def allows_all?(other)
@@ -375,15 +387,15 @@ module Bundler::PubGrub
375
387
  def invert
376
388
  return self.class.empty if any?
377
389
 
378
- low = VersionRange.new(max: min, include_max: !include_min)
379
- high = VersionRange.new(min: max, include_min: !include_max)
390
+ low = -> { VersionRange.new(max: min, include_max: !include_min) }
391
+ high = -> { VersionRange.new(min: max, include_min: !include_max) }
380
392
 
381
393
  if !min
382
- high
394
+ high.call
383
395
  elsif !max
384
- low
396
+ low.call
385
397
  else
386
- low.union(high)
398
+ low.call.union(high.call)
387
399
  end
388
400
  end
389
401