rubygems-update 3.0.6 → 3.2.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (628) hide show
  1. checksums.yaml +4 -4
  2. data/{History.txt → CHANGELOG.md} +1100 -436
  3. data/CODE_OF_CONDUCT.md +55 -19
  4. data/CONTRIBUTING.md +37 -10
  5. data/MAINTAINERS.txt +1 -6
  6. data/Manifest.txt +104 -64
  7. data/POLICIES.md +6 -12
  8. data/README.md +6 -6
  9. data/Rakefile +121 -111
  10. data/bin/gem +0 -6
  11. data/bin/update_rubygems +2 -2
  12. data/bundler/CHANGELOG.md +1788 -1251
  13. data/bundler/LICENSE.md +18 -19
  14. data/bundler/README.md +9 -10
  15. data/bundler/UPGRADING.md +215 -0
  16. data/bundler/bundler.gemspec +9 -26
  17. data/bundler/exe/bundle +22 -3
  18. data/bundler/lib/bundler.rb +233 -94
  19. data/bundler/lib/bundler/build_metadata.rb +5 -13
  20. data/bundler/lib/bundler/capistrano.rb +4 -4
  21. data/bundler/lib/bundler/cli.rb +221 -148
  22. data/bundler/lib/bundler/cli/add.rb +28 -16
  23. data/bundler/lib/bundler/cli/binstubs.rb +6 -2
  24. data/bundler/lib/bundler/cli/cache.rb +24 -17
  25. data/bundler/lib/bundler/cli/clean.rb +1 -1
  26. data/bundler/lib/bundler/cli/common.rb +25 -12
  27. data/bundler/lib/bundler/cli/config.rb +161 -86
  28. data/bundler/lib/bundler/cli/console.rb +1 -1
  29. data/bundler/lib/bundler/cli/doctor.rb +5 -5
  30. data/bundler/lib/bundler/cli/exec.rb +8 -20
  31. data/bundler/lib/bundler/cli/fund.rb +36 -0
  32. data/bundler/lib/bundler/cli/gem.rb +125 -32
  33. data/bundler/lib/bundler/cli/info.rb +29 -6
  34. data/bundler/lib/bundler/cli/init.rb +2 -2
  35. data/bundler/lib/bundler/cli/inject.rb +1 -1
  36. data/bundler/lib/bundler/cli/install.rb +27 -23
  37. data/bundler/lib/bundler/cli/issue.rb +5 -5
  38. data/bundler/lib/bundler/cli/list.rb +12 -10
  39. data/bundler/lib/bundler/cli/open.rb +10 -6
  40. data/bundler/lib/bundler/cli/outdated.rb +134 -109
  41. data/bundler/lib/bundler/cli/plugin.rb +19 -2
  42. data/bundler/lib/bundler/cli/pristine.rb +6 -1
  43. data/bundler/lib/bundler/cli/show.rb +2 -2
  44. data/bundler/lib/bundler/cli/update.rb +34 -12
  45. data/bundler/lib/bundler/compact_index_client.rb +26 -10
  46. data/bundler/lib/bundler/compact_index_client/cache.rb +6 -14
  47. data/bundler/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  48. data/bundler/lib/bundler/compact_index_client/updater.rb +8 -20
  49. data/bundler/lib/bundler/current_ruby.rb +9 -7
  50. data/bundler/lib/bundler/definition.rb +133 -132
  51. data/bundler/lib/bundler/dep_proxy.rb +16 -9
  52. data/bundler/lib/bundler/dependency.rb +19 -14
  53. data/bundler/lib/bundler/deployment.rb +1 -1
  54. data/bundler/lib/bundler/dsl.rb +54 -71
  55. data/bundler/lib/bundler/endpoint_specification.rb +1 -1
  56. data/bundler/lib/bundler/env.rb +9 -14
  57. data/bundler/lib/bundler/environment_preserver.rb +26 -3
  58. data/bundler/lib/bundler/errors.rb +1 -0
  59. data/bundler/lib/bundler/feature_flag.rb +19 -34
  60. data/bundler/lib/bundler/fetcher.rb +19 -16
  61. data/bundler/lib/bundler/fetcher/base.rb +1 -1
  62. data/bundler/lib/bundler/fetcher/compact_index.rb +27 -13
  63. data/bundler/lib/bundler/fetcher/dependency.rb +1 -1
  64. data/bundler/lib/bundler/fetcher/downloader.rb +6 -3
  65. data/bundler/lib/bundler/fetcher/index.rb +8 -7
  66. data/bundler/lib/bundler/friendly_errors.rb +27 -19
  67. data/bundler/lib/bundler/gem_helper.rb +68 -37
  68. data/bundler/lib/bundler/gem_helpers.rb +38 -29
  69. data/bundler/lib/bundler/gem_tasks.rb +1 -1
  70. data/bundler/lib/bundler/gem_version_promoter.rb +5 -5
  71. data/bundler/lib/bundler/graph.rb +3 -3
  72. data/bundler/lib/bundler/index.rb +12 -7
  73. data/bundler/lib/bundler/injector.rb +32 -12
  74. data/bundler/lib/bundler/inline.rb +41 -30
  75. data/bundler/lib/bundler/installer.rb +41 -60
  76. data/bundler/lib/bundler/installer/gem_installer.rb +8 -4
  77. data/bundler/lib/bundler/installer/parallel_installer.rb +20 -26
  78. data/bundler/lib/bundler/installer/standalone.rb +18 -4
  79. data/bundler/lib/bundler/lazy_specification.rb +41 -27
  80. data/bundler/lib/bundler/lockfile_generator.rb +1 -1
  81. data/bundler/lib/bundler/lockfile_parser.rb +16 -33
  82. data/bundler/lib/bundler/{ssl_certs → man}/.document +0 -0
  83. data/bundler/lib/bundler/man/bundle-add.1 +66 -0
  84. data/bundler/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +7 -1
  85. data/bundler/lib/bundler/man/bundle-binstubs.1 +42 -0
  86. data/bundler/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +3 -5
  87. data/bundler/lib/bundler/man/bundle-cache.1 +55 -0
  88. data/bundler/{man/bundle-package.ronn → lib/bundler/man/bundle-cache.1.ronn} +15 -15
  89. data/bundler/lib/bundler/man/bundle-check.1 +31 -0
  90. data/bundler/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
  91. data/bundler/lib/bundler/man/bundle-clean.1 +24 -0
  92. data/bundler/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
  93. data/bundler/lib/bundler/man/bundle-config.1 +488 -0
  94. data/bundler/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +59 -67
  95. data/bundler/lib/bundler/man/bundle-doctor.1 +44 -0
  96. data/bundler/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
  97. data/bundler/lib/bundler/man/bundle-exec.1 +165 -0
  98. data/bundler/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +1 -1
  99. data/bundler/lib/bundler/man/bundle-gem.1 +102 -0
  100. data/bundler/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +30 -7
  101. data/bundler/lib/bundler/man/bundle-info.1 +20 -0
  102. data/bundler/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
  103. data/bundler/lib/bundler/man/bundle-init.1 +25 -0
  104. data/bundler/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +1 -1
  105. data/bundler/lib/bundler/man/bundle-inject.1 +33 -0
  106. data/bundler/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
  107. data/bundler/lib/bundler/man/bundle-install.1 +338 -0
  108. data/bundler/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +34 -7
  109. data/bundler/lib/bundler/man/bundle-list.1 +50 -0
  110. data/bundler/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
  111. data/bundler/lib/bundler/man/bundle-lock.1 +84 -0
  112. data/bundler/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
  113. data/bundler/lib/bundler/man/bundle-open.1 +32 -0
  114. data/bundler/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
  115. data/bundler/lib/bundler/man/bundle-outdated.1 +155 -0
  116. data/bundler/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
  117. data/bundler/lib/bundler/man/bundle-platform.1 +61 -0
  118. data/bundler/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
  119. data/bundler/lib/bundler/man/bundle-pristine.1 +34 -0
  120. data/bundler/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
  121. data/bundler/lib/bundler/man/bundle-remove.1 +31 -0
  122. data/bundler/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
  123. data/bundler/lib/bundler/man/bundle-show.1 +23 -0
  124. data/bundler/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
  125. data/bundler/lib/bundler/man/bundle-update.1 +394 -0
  126. data/bundler/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +3 -3
  127. data/bundler/lib/bundler/man/bundle-viz.1 +39 -0
  128. data/bundler/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
  129. data/bundler/lib/bundler/man/bundle.1 +136 -0
  130. data/bundler/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +2 -2
  131. data/bundler/lib/bundler/man/gemfile.5 +686 -0
  132. data/bundler/{man → lib/bundler/man}/gemfile.5.ronn +16 -20
  133. data/bundler/lib/bundler/man/index.txt +25 -0
  134. data/bundler/lib/bundler/match_platform.rb +1 -1
  135. data/bundler/lib/bundler/mirror.rb +5 -5
  136. data/bundler/lib/bundler/plugin.rb +75 -36
  137. data/bundler/lib/bundler/plugin/api.rb +1 -1
  138. data/bundler/lib/bundler/plugin/api/source.rb +12 -7
  139. data/bundler/lib/bundler/plugin/dsl.rb +1 -1
  140. data/bundler/lib/bundler/plugin/index.rb +24 -4
  141. data/bundler/lib/bundler/plugin/installer.rb +33 -22
  142. data/bundler/lib/bundler/plugin/installer/rubygems.rb +1 -1
  143. data/bundler/lib/bundler/plugin/source_list.rb +5 -1
  144. data/bundler/lib/bundler/psyched_yaml.rb +0 -15
  145. data/bundler/lib/bundler/remote_specification.rb +5 -4
  146. data/bundler/lib/bundler/resolver.rb +191 -87
  147. data/bundler/lib/bundler/resolver/spec_group.rb +76 -48
  148. data/bundler/lib/bundler/retry.rb +3 -3
  149. data/bundler/lib/bundler/ruby_version.rb +5 -20
  150. data/bundler/lib/bundler/rubygems_ext.rb +76 -72
  151. data/bundler/lib/bundler/rubygems_gem_installer.rb +47 -13
  152. data/bundler/lib/bundler/rubygems_integration.rb +159 -444
  153. data/bundler/lib/bundler/runtime.rb +6 -23
  154. data/bundler/lib/bundler/settings.rb +67 -93
  155. data/bundler/lib/bundler/setup.rb +11 -12
  156. data/bundler/lib/bundler/shared_helpers.rb +54 -80
  157. data/bundler/lib/bundler/similarity_detector.rb +3 -3
  158. data/bundler/lib/bundler/source.rb +12 -6
  159. data/bundler/lib/bundler/source/git.rb +47 -38
  160. data/bundler/lib/bundler/source/git/git_proxy.rb +101 -102
  161. data/bundler/lib/bundler/source/metadata.rb +7 -6
  162. data/bundler/lib/bundler/source/path.rb +20 -11
  163. data/bundler/lib/bundler/source/path/installer.rb +10 -10
  164. data/bundler/lib/bundler/source/rubygems.rb +56 -29
  165. data/bundler/lib/bundler/source/rubygems/remote.rb +3 -4
  166. data/bundler/lib/bundler/source_list.rb +32 -30
  167. data/bundler/lib/bundler/spec_set.rb +37 -25
  168. data/bundler/lib/bundler/stub_specification.rb +40 -34
  169. data/bundler/lib/bundler/templates/Executable.bundler +23 -14
  170. data/bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
  171. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
  172. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +16 -2
  173. data/bundler/lib/bundler/templates/newgem/README.md.tt +7 -5
  174. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +19 -5
  175. data/bundler/lib/bundler/templates/newgem/bin/console.tt +1 -0
  176. data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
  177. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
  178. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
  179. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  180. data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
  181. data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
  182. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +18 -31
  183. data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
  184. data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
  185. data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
  186. data/bundler/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
  187. data/bundler/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
  188. data/bundler/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  189. data/bundler/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  190. data/bundler/lib/bundler/templates/newgem/travis.yml.tt +0 -1
  191. data/bundler/lib/bundler/ui.rb +3 -3
  192. data/bundler/lib/bundler/ui/rg_proxy.rb +1 -1
  193. data/bundler/lib/bundler/ui/shell.rb +7 -11
  194. data/bundler/lib/bundler/uri_credentials_filter.rb +10 -4
  195. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
  196. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
  197. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
  198. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
  199. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +273 -147
  200. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +5 -6
  201. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
  202. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +36 -4
  203. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
  204. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
  205. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
  206. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
  207. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
  208. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
  209. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +3 -3
  210. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +39 -11
  211. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +4 -4
  212. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  213. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
  214. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +53 -51
  215. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
  216. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +302 -462
  217. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
  218. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
  219. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
  220. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +16 -9
  221. data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +28 -13
  222. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
  223. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +3 -2
  224. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
  225. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +20 -9
  226. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
  227. data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +63 -43
  228. data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
  229. data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +78 -0
  230. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
  231. data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
  232. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
  233. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
  234. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
  235. data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  236. data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
  237. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +7 -3
  238. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +20 -7
  239. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +21 -5
  240. data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
  241. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +15 -14
  242. data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +4 -4
  243. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +65 -8
  244. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +10 -2
  245. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
  246. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
  247. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  248. data/bundler/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
  249. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  250. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
  251. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
  252. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  253. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
  254. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
  255. data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  256. data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  257. data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
  258. data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
  259. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  260. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
  261. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  262. data/bundler/lib/bundler/vendored_fileutils.rb +1 -6
  263. data/bundler/lib/bundler/vendored_molinillo.rb +1 -1
  264. data/bundler/lib/bundler/vendored_persistent.rb +7 -12
  265. data/bundler/lib/bundler/vendored_thor.rb +2 -2
  266. data/bundler/lib/bundler/vendored_tmpdir.rb +4 -0
  267. data/bundler/lib/bundler/vendored_uri.rb +4 -0
  268. data/bundler/lib/bundler/version.rb +1 -20
  269. data/bundler/lib/bundler/version_ranges.rb +51 -5
  270. data/bundler/lib/bundler/vlad.rb +2 -2
  271. data/bundler/lib/bundler/worker.rb +2 -4
  272. data/bundler/lib/bundler/yaml_serializer.rb +3 -4
  273. data/lib/rubygems.rb +198 -222
  274. data/lib/rubygems/available_set.rb +4 -5
  275. data/lib/rubygems/basic_specification.rb +32 -19
  276. data/lib/rubygems/bundler_version_finder.rb +19 -9
  277. data/lib/rubygems/command.rb +73 -21
  278. data/lib/rubygems/command_manager.rb +5 -12
  279. data/lib/rubygems/commands/build_command.rb +51 -18
  280. data/lib/rubygems/commands/cert_command.rb +2 -11
  281. data/lib/rubygems/commands/check_command.rb +0 -2
  282. data/lib/rubygems/commands/cleanup_command.rb +17 -13
  283. data/lib/rubygems/commands/contents_command.rb +7 -9
  284. data/lib/rubygems/commands/dependency_command.rb +9 -10
  285. data/lib/rubygems/commands/environment_command.rb +1 -6
  286. data/lib/rubygems/commands/fetch_command.rb +2 -4
  287. data/lib/rubygems/commands/generate_index_command.rb +3 -2
  288. data/lib/rubygems/commands/help_command.rb +4 -4
  289. data/lib/rubygems/commands/info_command.rb +9 -4
  290. data/lib/rubygems/commands/install_command.rb +12 -54
  291. data/lib/rubygems/commands/list_command.rb +8 -7
  292. data/lib/rubygems/commands/lock_command.rb +3 -5
  293. data/lib/rubygems/commands/mirror_command.rb +0 -1
  294. data/lib/rubygems/commands/open_command.rb +1 -4
  295. data/lib/rubygems/commands/outdated_command.rb +0 -1
  296. data/lib/rubygems/commands/owner_command.rb +10 -10
  297. data/lib/rubygems/commands/pristine_command.rb +13 -9
  298. data/lib/rubygems/commands/push_command.rb +12 -51
  299. data/lib/rubygems/commands/query_command.rb +14 -330
  300. data/lib/rubygems/commands/rdoc_command.rb +0 -1
  301. data/lib/rubygems/commands/search_command.rb +7 -7
  302. data/lib/rubygems/commands/server_command.rb +3 -1
  303. data/lib/rubygems/commands/setup_command.rb +143 -101
  304. data/lib/rubygems/commands/signin_command.rb +0 -1
  305. data/lib/rubygems/commands/signout_command.rb +0 -2
  306. data/lib/rubygems/commands/sources_command.rb +22 -6
  307. data/lib/rubygems/commands/specification_command.rb +8 -3
  308. data/lib/rubygems/commands/stale_command.rb +1 -1
  309. data/lib/rubygems/commands/uninstall_command.rb +2 -3
  310. data/lib/rubygems/commands/unpack_command.rb +3 -32
  311. data/lib/rubygems/commands/update_command.rb +73 -28
  312. data/lib/rubygems/commands/which_command.rb +0 -1
  313. data/lib/rubygems/commands/yank_command.rb +10 -7
  314. data/lib/rubygems/compatibility.rb +4 -4
  315. data/lib/rubygems/config_file.rb +48 -27
  316. data/lib/rubygems/core_ext/kernel_gem.rb +7 -6
  317. data/lib/rubygems/core_ext/kernel_require.rb +44 -6
  318. data/lib/rubygems/core_ext/kernel_warn.rb +22 -13
  319. data/lib/rubygems/core_ext/tcpsocket_init.rb +52 -0
  320. data/lib/rubygems/defaults.rb +110 -23
  321. data/lib/rubygems/dependency.rb +28 -14
  322. data/lib/rubygems/dependency_installer.rb +11 -166
  323. data/lib/rubygems/dependency_list.rb +17 -18
  324. data/lib/rubygems/deprecate.rb +51 -6
  325. data/lib/rubygems/doctor.rb +4 -4
  326. data/lib/rubygems/errors.rb +5 -7
  327. data/lib/rubygems/exceptions.rb +2 -24
  328. data/lib/rubygems/ext.rb +6 -6
  329. data/lib/rubygems/ext/build_error.rb +2 -0
  330. data/lib/rubygems/ext/builder.rb +45 -82
  331. data/lib/rubygems/ext/cmake_builder.rb +6 -7
  332. data/lib/rubygems/ext/configure_builder.rb +5 -8
  333. data/lib/rubygems/ext/ext_conf_builder.rb +27 -23
  334. data/lib/rubygems/ext/rake_builder.rb +4 -6
  335. data/lib/rubygems/gem_runner.rb +3 -10
  336. data/lib/rubygems/gemcutter_utilities.rb +111 -37
  337. data/lib/rubygems/indexer.rb +9 -26
  338. data/lib/rubygems/install_update_options.rb +7 -7
  339. data/lib/rubygems/installer.rb +91 -98
  340. data/lib/rubygems/installer_test_case.rb +104 -42
  341. data/lib/rubygems/installer_uninstaller_utils.rb +29 -0
  342. data/lib/rubygems/local_remote_options.rb +1 -1
  343. data/lib/rubygems/mock_gem_ui.rb +1 -4
  344. data/lib/rubygems/name_tuple.rb +4 -7
  345. data/lib/rubygems/openssl.rb +7 -0
  346. data/lib/rubygems/package.rb +49 -32
  347. data/lib/rubygems/package/digest_io.rb +0 -2
  348. data/lib/rubygems/package/file_source.rb +0 -2
  349. data/lib/rubygems/package/io_source.rb +0 -2
  350. data/lib/rubygems/package/old.rb +1 -3
  351. data/lib/rubygems/package/tar_header.rb +4 -6
  352. data/lib/rubygems/package/tar_reader.rb +15 -12
  353. data/lib/rubygems/package/tar_reader/entry.rb +0 -3
  354. data/lib/rubygems/package/tar_test_case.rb +2 -4
  355. data/lib/rubygems/package/tar_writer.rb +6 -16
  356. data/lib/rubygems/package_task.rb +1 -7
  357. data/lib/rubygems/path_support.rb +2 -2
  358. data/lib/rubygems/platform.rb +22 -16
  359. data/lib/rubygems/query_utils.rb +353 -0
  360. data/lib/rubygems/rdoc.rb +0 -12
  361. data/lib/rubygems/remote_fetcher.rb +33 -59
  362. data/lib/rubygems/request.rb +11 -14
  363. data/lib/rubygems/request/connection_pools.rb +3 -7
  364. data/lib/rubygems/request/http_pool.rb +0 -1
  365. data/lib/rubygems/request_set.rb +10 -23
  366. data/lib/rubygems/request_set/gem_dependency_api.rb +9 -11
  367. data/lib/rubygems/request_set/lockfile.rb +13 -12
  368. data/lib/rubygems/request_set/lockfile/parser.rb +2 -2
  369. data/lib/rubygems/request_set/lockfile/tokenizer.rb +1 -1
  370. data/lib/rubygems/requirement.rb +36 -35
  371. data/lib/rubygems/resolver.rb +20 -16
  372. data/lib/rubygems/resolver/activation_request.rb +27 -51
  373. data/lib/rubygems/resolver/api_set.rb +31 -24
  374. data/lib/rubygems/resolver/api_set/gem_parser.rb +20 -0
  375. data/lib/rubygems/resolver/api_specification.rb +24 -10
  376. data/lib/rubygems/resolver/best_set.rb +4 -6
  377. data/lib/rubygems/resolver/composed_set.rb +3 -5
  378. data/lib/rubygems/resolver/conflict.rb +2 -9
  379. data/lib/rubygems/resolver/current_set.rb +0 -2
  380. data/lib/rubygems/resolver/dependency_request.rb +1 -3
  381. data/lib/rubygems/resolver/git_set.rb +0 -2
  382. data/lib/rubygems/resolver/git_specification.rb +0 -2
  383. data/lib/rubygems/resolver/index_set.rb +1 -3
  384. data/lib/rubygems/resolver/index_specification.rb +32 -2
  385. data/lib/rubygems/resolver/installed_specification.rb +0 -2
  386. data/lib/rubygems/resolver/installer_set.rb +63 -16
  387. data/lib/rubygems/resolver/local_specification.rb +0 -2
  388. data/lib/rubygems/resolver/lock_set.rb +3 -5
  389. data/lib/rubygems/resolver/lock_specification.rb +2 -4
  390. data/lib/rubygems/resolver/molinillo/lib/molinillo.rb +6 -5
  391. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
  392. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +8 -0
  393. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +39 -6
  394. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
  395. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +2 -1
  396. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +2 -1
  397. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +2 -1
  398. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +2 -1
  399. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +7 -6
  400. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +2 -1
  401. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +4 -3
  402. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +51 -12
  403. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +76 -8
  404. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +2 -1
  405. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/specification_provider.rb +12 -0
  406. data/lib/rubygems/resolver/molinillo/lib/molinillo/modules/ui.rb +3 -1
  407. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +510 -165
  408. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb +3 -2
  409. data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +8 -4
  410. data/lib/rubygems/resolver/requirement_list.rb +0 -1
  411. data/lib/rubygems/resolver/set.rb +0 -2
  412. data/lib/rubygems/resolver/source_set.rb +0 -2
  413. data/lib/rubygems/resolver/spec_specification.rb +14 -2
  414. data/lib/rubygems/resolver/specification.rb +13 -2
  415. data/lib/rubygems/resolver/vendor_set.rb +0 -2
  416. data/lib/rubygems/resolver/vendor_specification.rb +0 -2
  417. data/lib/rubygems/s3_uri_signer.rb +15 -13
  418. data/lib/rubygems/safe_yaml.rb +4 -4
  419. data/lib/rubygems/security.rb +27 -34
  420. data/lib/rubygems/security/policy.rb +4 -8
  421. data/lib/rubygems/security/signer.rb +8 -9
  422. data/lib/rubygems/security/trust_dir.rb +1 -3
  423. data/lib/rubygems/server.rb +20 -16
  424. data/lib/rubygems/source.rb +30 -13
  425. data/lib/rubygems/source/git.rb +7 -8
  426. data/lib/rubygems/source/installed.rb +0 -2
  427. data/lib/rubygems/source/local.rb +2 -4
  428. data/lib/rubygems/source/lock.rb +0 -2
  429. data/lib/rubygems/source/specific_file.rb +0 -2
  430. data/lib/rubygems/source/vendor.rb +0 -2
  431. data/lib/rubygems/source_list.rb +6 -6
  432. data/lib/rubygems/spec_fetcher.rb +22 -34
  433. data/lib/rubygems/specification.rb +207 -278
  434. data/lib/rubygems/specification_policy.rb +135 -57
  435. data/{bundler/lib/bundler/ssl_certs/index.rubygems.org → lib/rubygems/ssl_certs/rubygems.org}/GlobalSignRootCA.pem +0 -0
  436. data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
  437. data/lib/rubygems/stub_specification.rb +4 -5
  438. data/lib/rubygems/test_case.rb +221 -341
  439. data/lib/rubygems/test_utilities.rb +22 -18
  440. data/lib/rubygems/text.rb +2 -3
  441. data/lib/rubygems/uninstaller.rb +49 -30
  442. data/lib/rubygems/uri_formatter.rb +2 -4
  443. data/lib/rubygems/uri_parser.rb +34 -0
  444. data/lib/rubygems/uri_parsing.rb +23 -0
  445. data/lib/rubygems/user_interaction.rb +3 -20
  446. data/lib/rubygems/util.rb +20 -44
  447. data/lib/rubygems/util/licenses.rb +400 -400
  448. data/lib/rubygems/validator.rb +9 -31
  449. data/lib/rubygems/version.rb +29 -21
  450. data/lib/rubygems/version_option.rb +6 -0
  451. data/rubygems-update.gemspec +4 -11
  452. data/setup.rb +2 -7
  453. data/test/rubygems/data/null-required-ruby-version.gemspec.rz +0 -0
  454. data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
  455. data/test/rubygems/rubygems/commands/crash_command.rb +0 -2
  456. data/test/rubygems/rubygems_plugin.rb +0 -2
  457. data/test/rubygems/specifications/bar-0.0.2.gemspec +0 -2
  458. data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +12 -0
  459. data/test/rubygems/test_bundled_ca.rb +42 -45
  460. data/test/rubygems/test_config.rb +0 -2
  461. data/test/rubygems/test_deprecate.rb +41 -5
  462. data/test/rubygems/test_gem.rb +405 -236
  463. data/test/rubygems/test_gem_available_set.rb +5 -6
  464. data/test/rubygems/test_gem_bundler_version_finder.rb +20 -2
  465. data/test/rubygems/test_gem_command.rb +144 -9
  466. data/test/rubygems/test_gem_command_manager.rb +40 -17
  467. data/test/rubygems/test_gem_commands_build_command.rb +386 -13
  468. data/test/rubygems/test_gem_commands_cert_command.rb +18 -6
  469. data/test/rubygems/test_gem_commands_check_command.rb +0 -2
  470. data/test/rubygems/test_gem_commands_cleanup_command.rb +35 -10
  471. data/test/rubygems/test_gem_commands_contents_command.rb +50 -19
  472. data/test/rubygems/test_gem_commands_dependency_command.rb +1 -3
  473. data/test/rubygems/test_gem_commands_environment_command.rb +21 -33
  474. data/test/rubygems/test_gem_commands_fetch_command.rb +0 -2
  475. data/test/rubygems/test_gem_commands_generate_index_command.rb +32 -2
  476. data/test/rubygems/test_gem_commands_help_command.rb +16 -8
  477. data/test/rubygems/test_gem_commands_info_command.rb +6 -7
  478. data/test/rubygems/test_gem_commands_install_command.rb +368 -34
  479. data/test/rubygems/test_gem_commands_list_command.rb +0 -2
  480. data/test/rubygems/test_gem_commands_lock_command.rb +0 -2
  481. data/test/rubygems/test_gem_commands_mirror.rb +1 -2
  482. data/test/rubygems/test_gem_commands_open_command.rb +4 -6
  483. data/test/rubygems/test_gem_commands_outdated_command.rb +18 -1
  484. data/test/rubygems/test_gem_commands_owner_command.rb +62 -9
  485. data/test/rubygems/test_gem_commands_pristine_command.rb +148 -16
  486. data/test/rubygems/test_gem_commands_push_command.rb +94 -21
  487. data/test/rubygems/test_gem_commands_query_command.rb +35 -10
  488. data/test/rubygems/test_gem_commands_search_command.rb +0 -2
  489. data/test/rubygems/test_gem_commands_server_command.rb +6 -4
  490. data/test/rubygems/test_gem_commands_setup_command.rb +228 -128
  491. data/test/rubygems/test_gem_commands_signin_command.rb +36 -11
  492. data/test/rubygems/test_gem_commands_signout_command.rb +0 -7
  493. data/test/rubygems/test_gem_commands_sources_command.rb +193 -9
  494. data/test/rubygems/test_gem_commands_specification_command.rb +46 -20
  495. data/test/rubygems/test_gem_commands_stale_command.rb +0 -2
  496. data/test/rubygems/test_gem_commands_uninstall_command.rb +108 -52
  497. data/test/rubygems/test_gem_commands_unpack_command.rb +0 -2
  498. data/test/rubygems/test_gem_commands_update_command.rb +201 -29
  499. data/test/rubygems/test_gem_commands_which_command.rb +3 -5
  500. data/test/rubygems/test_gem_commands_yank_command.rb +86 -5
  501. data/test/rubygems/test_gem_config_file.rb +25 -13
  502. data/test/rubygems/test_gem_dependency.rb +6 -2
  503. data/test/rubygems/test_gem_dependency_installer.rb +169 -252
  504. data/test/rubygems/test_gem_dependency_list.rb +31 -26
  505. data/test/rubygems/test_gem_dependency_resolution_error.rb +1 -3
  506. data/test/rubygems/test_gem_doctor.rb +28 -2
  507. data/test/rubygems/test_gem_ext_builder.rb +51 -44
  508. data/test/rubygems/test_gem_ext_cmake_builder.rb +16 -23
  509. data/test/rubygems/test_gem_ext_configure_builder.rb +6 -14
  510. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +21 -29
  511. data/test/rubygems/test_gem_ext_rake_builder.rb +39 -22
  512. data/test/rubygems/test_gem_gem_runner.rb +47 -2
  513. data/test/rubygems/test_gem_gemcutter_utilities.rb +16 -13
  514. data/test/rubygems/test_gem_impossible_dependencies_error.rb +0 -2
  515. data/test/rubygems/test_gem_indexer.rb +40 -55
  516. data/test/rubygems/test_gem_install_update_options.rb +45 -21
  517. data/test/rubygems/test_gem_installer.rb +661 -338
  518. data/test/rubygems/test_gem_local_remote_options.rb +0 -2
  519. data/test/rubygems/test_gem_name_tuple.rb +0 -2
  520. data/test/rubygems/test_gem_package.rb +132 -45
  521. data/test/rubygems/test_gem_package_old.rb +56 -55
  522. data/test/rubygems/test_gem_package_tar_header.rb +18 -1
  523. data/test/rubygems/test_gem_package_tar_reader.rb +0 -2
  524. data/test/rubygems/test_gem_package_tar_reader_entry.rb +6 -7
  525. data/test/rubygems/test_gem_package_tar_writer.rb +20 -12
  526. data/test/rubygems/test_gem_package_task.rb +46 -13
  527. data/test/rubygems/test_gem_path_support.rb +17 -13
  528. data/test/rubygems/test_gem_platform.rb +74 -7
  529. data/test/rubygems/test_gem_rdoc.rb +0 -1
  530. data/test/rubygems/test_gem_remote_fetcher.rb +223 -209
  531. data/test/rubygems/test_gem_request.rb +30 -19
  532. data/test/rubygems/test_gem_request_connection_pools.rb +2 -2
  533. data/test/rubygems/test_gem_request_set.rb +104 -29
  534. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +4 -6
  535. data/test/rubygems/test_gem_request_set_lockfile.rb +4 -5
  536. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +9 -10
  537. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +118 -118
  538. data/test/rubygems/test_gem_requirement.rb +50 -4
  539. data/test/rubygems/test_gem_resolver.rb +73 -31
  540. data/test/rubygems/test_gem_resolver_activation_request.rb +3 -34
  541. data/test/rubygems/test_gem_resolver_api_set.rb +60 -59
  542. data/test/rubygems/test_gem_resolver_api_specification.rb +3 -5
  543. data/test/rubygems/test_gem_resolver_best_set.rb +27 -6
  544. data/test/rubygems/test_gem_resolver_composed_set.rb +0 -2
  545. data/test/rubygems/test_gem_resolver_conflict.rb +1 -7
  546. data/test/rubygems/test_gem_resolver_dependency_request.rb +0 -2
  547. data/test/rubygems/test_gem_resolver_git_set.rb +0 -2
  548. data/test/rubygems/test_gem_resolver_git_specification.rb +1 -2
  549. data/test/rubygems/test_gem_resolver_index_set.rb +2 -4
  550. data/test/rubygems/test_gem_resolver_index_specification.rb +7 -4
  551. data/test/rubygems/test_gem_resolver_installed_specification.rb +0 -3
  552. data/test/rubygems/test_gem_resolver_installer_set.rb +10 -10
  553. data/test/rubygems/test_gem_resolver_local_specification.rb +0 -2
  554. data/test/rubygems/test_gem_resolver_lock_set.rb +3 -5
  555. data/test/rubygems/test_gem_resolver_lock_specification.rb +0 -2
  556. data/test/rubygems/test_gem_resolver_requirement_list.rb +0 -2
  557. data/test/rubygems/test_gem_resolver_specification.rb +0 -2
  558. data/test/rubygems/test_gem_resolver_vendor_set.rb +1 -3
  559. data/test/rubygems/test_gem_resolver_vendor_specification.rb +0 -2
  560. data/test/rubygems/test_gem_security.rb +27 -25
  561. data/test/rubygems/test_gem_security_policy.rb +7 -12
  562. data/test/rubygems/test_gem_security_signer.rb +11 -12
  563. data/test/rubygems/test_gem_security_trust_dir.rb +4 -6
  564. data/test/rubygems/test_gem_server.rb +13 -12
  565. data/test/rubygems/test_gem_silent_ui.rb +0 -1
  566. data/test/rubygems/test_gem_source.rb +32 -17
  567. data/test/rubygems/test_gem_source_fetch_problem.rb +0 -1
  568. data/test/rubygems/test_gem_source_git.rb +12 -18
  569. data/test/rubygems/test_gem_source_installed.rb +11 -13
  570. data/test/rubygems/test_gem_source_list.rb +1 -1
  571. data/test/rubygems/test_gem_source_local.rb +8 -9
  572. data/test/rubygems/test_gem_source_lock.rb +17 -19
  573. data/test/rubygems/test_gem_source_specific_file.rb +9 -10
  574. data/test/rubygems/test_gem_source_subpath_problem.rb +49 -0
  575. data/test/rubygems/test_gem_source_vendor.rb +7 -9
  576. data/test/rubygems/test_gem_spec_fetcher.rb +11 -4
  577. data/test/rubygems/test_gem_specification.rb +363 -245
  578. data/test/rubygems/test_gem_stream_ui.rb +3 -1
  579. data/test/rubygems/test_gem_stub_specification.rb +6 -7
  580. data/test/rubygems/test_gem_text.rb +1 -2
  581. data/test/rubygems/test_gem_uninstaller.rb +165 -22
  582. data/test/rubygems/test_gem_unsatisfiable_dependency_error.rb +0 -2
  583. data/test/rubygems/test_gem_uri_formatter.rb +0 -2
  584. data/test/rubygems/test_gem_util.rb +17 -15
  585. data/test/rubygems/test_gem_validator.rb +4 -7
  586. data/test/rubygems/test_gem_version.rb +23 -10
  587. data/test/rubygems/test_gem_version_option.rb +1 -3
  588. data/test/rubygems/test_kernel.rb +25 -9
  589. data/test/rubygems/test_project_sanity.rb +20 -0
  590. data/test/rubygems/test_remote_fetch_error.rb +1 -2
  591. data/test/rubygems/test_require.rb +394 -56
  592. data/test/test_changelog_generator.rb +17 -0
  593. metadata +109 -155
  594. data/.rubocop.yml +0 -67
  595. data/.travis.yml +0 -38
  596. data/appveyor.yml +0 -43
  597. data/bundler/CODE_OF_CONDUCT.md +0 -42
  598. data/bundler/CONTRIBUTING.md +0 -17
  599. data/bundler/exe/bundle_ruby +0 -60
  600. data/bundler/lib/bundler/cli/package.rb +0 -49
  601. data/bundler/lib/bundler/compatibility_guard.rb +0 -14
  602. data/bundler/lib/bundler/gem_remote_fetcher.rb +0 -43
  603. data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
  604. data/bundler/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
  605. data/bundler/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
  606. data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
  607. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
  608. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
  609. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
  610. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
  611. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
  612. data/lib/rubygems/source_local.rb +0 -7
  613. data/lib/rubygems/source_specific_file.rb +0 -6
  614. data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
  615. data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
  616. data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
  617. data/lib/ubygems.rb +0 -14
  618. data/util/CL2notes +0 -55
  619. data/util/ci +0 -82
  620. data/util/cops/deprecations.rb +0 -52
  621. data/util/create_certs.rb +0 -171
  622. data/util/create_certs.sh +0 -27
  623. data/util/create_encrypted_key.rb +0 -16
  624. data/util/generate_spdx_license_list.rb +0 -61
  625. data/util/patch_with_prs.rb +0 -77
  626. data/util/rubocop +0 -8
  627. data/util/update_bundled_ca_certificates.rb +0 -139
  628. data/util/update_changelog.rb +0 -67
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/vendor/molinillo/lib/molinillo/dependency_graph'
3
+ require_relative 'dependency_graph'
4
4
 
5
5
  module Bundler::Molinillo
6
6
  # This class encapsulates a dependency resolver.
@@ -9,7 +9,7 @@ module Bundler::Molinillo
9
9
  #
10
10
  #
11
11
  class Resolver
12
- require 'bundler/vendor/molinillo/lib/molinillo/resolution'
12
+ require_relative 'resolution'
13
13
 
14
14
  # @return [SpecificationProvider] the specification provider used
15
15
  # in the resolution process
@@ -1,17 +1,7 @@
1
1
  require 'net/http'
2
- begin
3
- require 'net/https'
4
- rescue LoadError
5
- # net/https or openssl
6
- end if RUBY_VERSION < '1.9' # but only for 1.8
7
- require 'bundler/vendor/net-http-persistent/lib/net/http/faster'
8
- require 'uri'
2
+ require_relative '../../../../uri/lib/uri'
9
3
  require 'cgi' # for escaping
10
-
11
- begin
12
- require 'net/http/pipeline'
13
- rescue LoadError
14
- end
4
+ require_relative '../../../../connection_pool/lib/connection_pool'
15
5
 
16
6
  autoload :OpenSSL, 'openssl'
17
7
 
@@ -22,23 +12,19 @@ autoload :OpenSSL, 'openssl'
22
12
  # servers you wish to talk to. For each host:port you communicate with a
23
13
  # single persistent connection is created.
24
14
  #
25
- # Multiple Bundler::Persistent::Net::HTTP::Persistent objects will share the same set of
26
- # connections.
15
+ # Connections will be shared across threads through a connection pool to
16
+ # increase reuse of connections.
27
17
  #
28
- # For each thread you start a new connection will be created. A
29
- # Bundler::Persistent::Net::HTTP::Persistent connection will not be shared across threads.
30
- #
31
- # You can shut down the HTTP connections when done by calling #shutdown. You
32
- # should name your Bundler::Persistent::Net::HTTP::Persistent object if you intend to call this
33
- # method.
18
+ # You can shut down any remaining HTTP connections when done by calling
19
+ # #shutdown.
34
20
  #
35
21
  # Example:
36
22
  #
37
23
  # require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
38
24
  #
39
- # uri = URI 'http://example.com/awesome/web/service'
25
+ # uri = Bundler::URI 'http://example.com/awesome/web/service'
40
26
  #
41
- # http = Bundler::Persistent::Net::HTTP::Persistent.new 'my_app_name'
27
+ # http = Bundler::Persistent::Net::HTTP::Persistent.new
42
28
  #
43
29
  # # perform a GET
44
30
  # response = http.request uri
@@ -53,36 +39,40 @@ autoload :OpenSSL, 'openssl'
53
39
  # post = Net::HTTP::Post.new post_uri.path
54
40
  # post.set_form_data 'some' => 'cool data'
55
41
  #
56
- # # perform the POST, the URI is always required
42
+ # # perform the POST, the Bundler::URI is always required
57
43
  # response http.request post_uri, post
58
44
  #
59
45
  # Note that for GET, HEAD and other requests that do not have a body you want
60
- # to use URI#request_uri not URI#path. The request_uri contains the query
46
+ # to use Bundler::URI#request_uri not Bundler::URI#path. The request_uri contains the query
61
47
  # params which are sent in the body for other requests.
62
48
  #
63
- # == SSL
49
+ # == TLS/SSL
64
50
  #
65
- # SSL connections are automatically created depending upon the scheme of the
66
- # URI. SSL connections are automatically verified against the default
51
+ # TLS connections are automatically created depending upon the scheme of the
52
+ # Bundler::URI. TLS connections are automatically verified against the default
67
53
  # certificate store for your computer. You can override this by changing
68
54
  # verify_mode or by specifying an alternate cert_store.
69
55
  #
70
- # Here are the SSL settings, see the individual methods for documentation:
56
+ # Here are the TLS settings, see the individual methods for documentation:
71
57
  #
72
58
  # #certificate :: This client's certificate
73
- # #ca_file :: The certificate-authority
59
+ # #ca_file :: The certificate-authorities
60
+ # #ca_path :: Directory with certificate-authorities
74
61
  # #cert_store :: An SSL certificate store
62
+ # #ciphers :: List of SSl ciphers allowed
75
63
  # #private_key :: The client's SSL private key
76
64
  # #reuse_ssl_sessions :: Reuse a previously opened SSL session for a new
77
65
  # connection
66
+ # #ssl_timeout :: Session lifetime
78
67
  # #ssl_version :: Which specific SSL version to use
79
68
  # #verify_callback :: For server certificate verification
69
+ # #verify_depth :: Depth of certificate verification
80
70
  # #verify_mode :: How connections should be verified
81
71
  #
82
72
  # == Proxies
83
73
  #
84
74
  # A proxy can be set through #proxy= or at initialization time by providing a
85
- # second argument to ::new. The proxy may be the URI of the proxy server or
75
+ # second argument to ::new. The proxy may be the Bundler::URI of the proxy server or
86
76
  # <code>:ENV</code> which will consult environment variables.
87
77
  #
88
78
  # See #proxy= and #proxy_from_env for details.
@@ -102,14 +92,15 @@ autoload :OpenSSL, 'openssl'
102
92
  #
103
93
  # === Segregation
104
94
  #
105
- # By providing an application name to ::new you can separate your connections
106
- # from the connections of other applications.
95
+ # Each Bundler::Persistent::Net::HTTP::Persistent instance has its own pool of connections. There
96
+ # is no sharing with other instances (as was true in earlier versions).
107
97
  #
108
98
  # === Idle Timeout
109
99
  #
110
- # If a connection hasn't been used for this number of seconds it will automatically be
111
- # reset upon the next use to avoid attempting to send to a closed connection.
112
- # The default value is 5 seconds. nil means no timeout. Set through #idle_timeout.
100
+ # If a connection hasn't been used for this number of seconds it will
101
+ # automatically be reset upon the next use to avoid attempting to send to a
102
+ # closed connection. The default value is 5 seconds. nil means no timeout.
103
+ # Set through #idle_timeout.
113
104
  #
114
105
  # Reducing this value may help avoid the "too many connection resets" error
115
106
  # when sending non-idempotent requests while increasing this value will cause
@@ -124,8 +115,9 @@ autoload :OpenSSL, 'openssl'
124
115
  #
125
116
  # The number of requests that should be made before opening a new connection.
126
117
  # Typically many keep-alive capable servers tune this to 100 or less, so the
127
- # 101st request will fail with ECONNRESET. If unset (default), this value has no
128
- # effect, if set, connections will be reset on the request after max_requests.
118
+ # 101st request will fail with ECONNRESET. If unset (default), this value has
119
+ # no effect, if set, connections will be reset on the request after
120
+ # max_requests.
129
121
  #
130
122
  # === Open Timeout
131
123
  #
@@ -137,45 +129,6 @@ autoload :OpenSSL, 'openssl'
137
129
  # Socket options may be set on newly-created connections. See #socket_options
138
130
  # for details.
139
131
  #
140
- # === Non-Idempotent Requests
141
- #
142
- # By default non-idempotent requests will not be retried per RFC 2616. By
143
- # setting retry_change_requests to true requests will automatically be retried
144
- # once.
145
- #
146
- # Only do this when you know that retrying a POST or other non-idempotent
147
- # request is safe for your application and will not create duplicate
148
- # resources.
149
- #
150
- # The recommended way to handle non-idempotent requests is the following:
151
- #
152
- # require 'bundler/vendor/net-http-persistent/lib/net/http/persistent'
153
- #
154
- # uri = URI 'http://example.com/awesome/web/service'
155
- # post_uri = uri + 'create'
156
- #
157
- # http = Bundler::Persistent::Net::HTTP::Persistent.new 'my_app_name'
158
- #
159
- # post = Net::HTTP::Post.new post_uri.path
160
- # # ... fill in POST request
161
- #
162
- # begin
163
- # response = http.request post_uri, post
164
- # rescue Bundler::Persistent::Net::HTTP::Persistent::Error
165
- #
166
- # # POST failed, make a new request to verify the server did not process
167
- # # the request
168
- # exists_uri = uri + '...'
169
- # response = http.get exists_uri
170
- #
171
- # # Retry if it failed
172
- # retry if response.code == '404'
173
- # end
174
- #
175
- # The method of determining if the resource was created or not is unique to
176
- # the particular service you are using. Of course, you will want to add
177
- # protection from infinite looping.
178
- #
179
132
  # === Connection Termination
180
133
  #
181
134
  # If you are done using the Bundler::Persistent::Net::HTTP::Persistent instance you may shut down
@@ -201,24 +154,27 @@ class Bundler::Persistent::Net::HTTP::Persistent
201
154
  HAVE_OPENSSL = defined? OpenSSL::SSL # :nodoc:
202
155
 
203
156
  ##
204
- # The version of Bundler::Persistent::Net::HTTP::Persistent you are using
157
+ # The default connection pool size is 1/4 the allowed open files
158
+ # (<code>ulimit -n</code>) or 256 if your OS does not support file handle
159
+ # limits (typically windows).
205
160
 
206
- VERSION = '2.9.4'
161
+ if Process.const_defined? :RLIMIT_NOFILE
162
+ open_file_limits = Process.getrlimit(Process::RLIMIT_NOFILE)
163
+
164
+ # Under JRuby on Windows Process responds to `getrlimit` but returns something that does not match docs
165
+ if open_file_limits.respond_to?(:first)
166
+ DEFAULT_POOL_SIZE = open_file_limits.first / 4
167
+ else
168
+ DEFAULT_POOL_SIZE = 256
169
+ end
170
+ else
171
+ DEFAULT_POOL_SIZE = 256
172
+ end
207
173
 
208
174
  ##
209
- # Exceptions rescued for automatic retry on ruby 2.0.0. This overlaps with
210
- # the exception list for ruby 1.x.
175
+ # The version of Bundler::Persistent::Net::HTTP::Persistent you are using
211
176
 
212
- RETRIED_EXCEPTIONS = [ # :nodoc:
213
- (Net::ReadTimeout if Net.const_defined? :ReadTimeout),
214
- IOError,
215
- EOFError,
216
- Errno::ECONNRESET,
217
- Errno::ECONNABORTED,
218
- Errno::EPIPE,
219
- (OpenSSL::SSL::SSLError if HAVE_OPENSSL),
220
- Timeout::Error,
221
- ].compact
177
+ VERSION = '4.0.0'
222
178
 
223
179
  ##
224
180
  # Error class for errors raised by Bundler::Persistent::Net::HTTP::Persistent. Various
@@ -241,38 +197,38 @@ class Bundler::Persistent::Net::HTTP::Persistent
241
197
  # NOTE: This may not work on ruby > 1.9.
242
198
 
243
199
  def self.detect_idle_timeout uri, max = 10
244
- uri = URI uri unless URI::Generic === uri
200
+ uri = Bundler::URI uri unless Bundler::URI::Generic === uri
245
201
  uri += '/'
246
202
 
247
203
  req = Net::HTTP::Head.new uri.request_uri
248
204
 
249
205
  http = new 'net-http-persistent detect_idle_timeout'
250
206
 
251
- connection = http.connection_for uri
207
+ http.connection_for uri do |connection|
208
+ sleep_time = 0
252
209
 
253
- sleep_time = 0
210
+ http = connection.http
254
211
 
255
- loop do
256
- response = connection.request req
212
+ loop do
213
+ response = http.request req
257
214
 
258
- $stderr.puts "HEAD #{uri} => #{response.code}" if $DEBUG
215
+ $stderr.puts "HEAD #{uri} => #{response.code}" if $DEBUG
259
216
 
260
- unless Net::HTTPOK === response then
261
- raise Error, "bad response code #{response.code} detecting idle timeout"
262
- end
217
+ unless Net::HTTPOK === response then
218
+ raise Error, "bad response code #{response.code} detecting idle timeout"
219
+ end
263
220
 
264
- break if sleep_time >= max
221
+ break if sleep_time >= max
265
222
 
266
- sleep_time += 1
223
+ sleep_time += 1
267
224
 
268
- $stderr.puts "sleeping #{sleep_time}" if $DEBUG
269
- sleep sleep_time
225
+ $stderr.puts "sleeping #{sleep_time}" if $DEBUG
226
+ sleep sleep_time
227
+ end
270
228
  end
271
229
  rescue
272
230
  # ignore StandardErrors, we've probably found the idle timeout.
273
231
  ensure
274
- http.shutdown
275
-
276
232
  return sleep_time unless $!
277
233
  end
278
234
 
@@ -281,7 +237,9 @@ class Bundler::Persistent::Net::HTTP::Persistent
281
237
 
282
238
  attr_reader :certificate
283
239
 
240
+ ##
284
241
  # For Net::HTTP parity
242
+
285
243
  alias cert certificate
286
244
 
287
245
  ##
@@ -290,12 +248,23 @@ class Bundler::Persistent::Net::HTTP::Persistent
290
248
 
291
249
  attr_reader :ca_file
292
250
 
251
+ ##
252
+ # A directory of SSL certificates to be used as certificate authorities.
253
+ # Setting this will set verify_mode to VERIFY_PEER.
254
+
255
+ attr_reader :ca_path
256
+
293
257
  ##
294
258
  # An SSL certificate store. Setting this will override the default
295
259
  # certificate store. See verify_mode for more information.
296
260
 
297
261
  attr_reader :cert_store
298
262
 
263
+ ##
264
+ # The ciphers allowed for SSL connections
265
+
266
+ attr_reader :ciphers
267
+
299
268
  ##
300
269
  # Sends debug_output to this IO via Net::HTTP#set_debug_output.
301
270
  #
@@ -309,11 +278,6 @@ class Bundler::Persistent::Net::HTTP::Persistent
309
278
 
310
279
  attr_reader :generation # :nodoc:
311
280
 
312
- ##
313
- # Where this instance's connections live in the thread local variables
314
-
315
- attr_reader :generation_key # :nodoc:
316
-
317
281
  ##
318
282
  # Headers that are added to every request using Net::HTTP#add_field
319
283
 
@@ -337,6 +301,13 @@ class Bundler::Persistent::Net::HTTP::Persistent
337
301
 
338
302
  attr_accessor :max_requests
339
303
 
304
+ ##
305
+ # Number of retries to perform if a request fails.
306
+ #
307
+ # See also #max_retries=, Net::HTTP#max_retries=.
308
+
309
+ attr_reader :max_retries
310
+
340
311
  ##
341
312
  # The value sent in the Keep-Alive header. Defaults to 30. Not needed for
342
313
  # HTTP/1.1 servers.
@@ -349,8 +320,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
349
320
  attr_accessor :keep_alive
350
321
 
351
322
  ##
352
- # A name for this connection. Allows you to keep your connections apart
353
- # from everybody else's.
323
+ # The name for this collection of persistent connections.
354
324
 
355
325
  attr_reader :name
356
326
 
@@ -369,7 +339,9 @@ class Bundler::Persistent::Net::HTTP::Persistent
369
339
 
370
340
  attr_reader :private_key
371
341
 
342
+ ##
372
343
  # For Net::HTTP parity
344
+
373
345
  alias key private_key
374
346
 
375
347
  ##
@@ -382,15 +354,20 @@ class Bundler::Persistent::Net::HTTP::Persistent
382
354
 
383
355
  attr_reader :no_proxy
384
356
 
357
+ ##
358
+ # Test-only accessor for the connection pool
359
+
360
+ attr_reader :pool # :nodoc:
361
+
385
362
  ##
386
363
  # Seconds to wait until reading one block. See Net::HTTP#read_timeout
387
364
 
388
365
  attr_accessor :read_timeout
389
366
 
390
367
  ##
391
- # Where this instance's request counts live in the thread local variables
368
+ # Seconds to wait until writing one block. See Net::HTTP#write_timeout
392
369
 
393
- attr_reader :request_key # :nodoc:
370
+ attr_accessor :write_timeout
394
371
 
395
372
  ##
396
373
  # By default SSL sessions are reused to avoid extra SSL handshakes. Set
@@ -418,17 +395,33 @@ class Bundler::Persistent::Net::HTTP::Persistent
418
395
  attr_reader :ssl_generation # :nodoc:
419
396
 
420
397
  ##
421
- # Where this instance's SSL connections live in the thread local variables
398
+ # SSL session lifetime
422
399
 
423
- attr_reader :ssl_generation_key # :nodoc:
400
+ attr_reader :ssl_timeout
424
401
 
425
402
  ##
426
403
  # SSL version to use.
427
404
  #
428
405
  # By default, the version will be negotiated automatically between client
429
- # and server. Ruby 1.9 and newer only.
406
+ # and server. Ruby 1.9 and newer only. Deprecated since Ruby 2.5.
430
407
 
431
- attr_reader :ssl_version if RUBY_VERSION > '1.9'
408
+ attr_reader :ssl_version
409
+
410
+ ##
411
+ # Minimum SSL version to use, e.g. :TLS1_1
412
+ #
413
+ # By default, the version will be negotiated automatically between client
414
+ # and server. Ruby 2.5 and newer only.
415
+
416
+ attr_reader :min_version
417
+
418
+ ##
419
+ # Maximum SSL version to use, e.g. :TLS1_2
420
+ #
421
+ # By default, the version will be negotiated automatically between client
422
+ # and server. Ruby 2.5 and newer only.
423
+
424
+ attr_reader :max_version
432
425
 
433
426
  ##
434
427
  # Where this instance's last-use times live in the thread local variables
@@ -436,50 +429,48 @@ class Bundler::Persistent::Net::HTTP::Persistent
436
429
  attr_reader :timeout_key # :nodoc:
437
430
 
438
431
  ##
439
- # SSL verification callback. Used when ca_file is set.
432
+ # SSL verification callback. Used when ca_file or ca_path is set.
440
433
 
441
434
  attr_reader :verify_callback
442
435
 
436
+ ##
437
+ # Sets the depth of SSL certificate verification
438
+
439
+ attr_reader :verify_depth
440
+
443
441
  ##
444
442
  # HTTPS verify mode. Defaults to OpenSSL::SSL::VERIFY_PEER which verifies
445
443
  # the server certificate.
446
444
  #
447
- # If no ca_file or cert_store is set the default system certificate store is
448
- # used.
445
+ # If no ca_file, ca_path or cert_store is set the default system certificate
446
+ # store is used.
449
447
  #
450
448
  # You can use +verify_mode+ to override any default values.
451
449
 
452
450
  attr_reader :verify_mode
453
451
 
454
- ##
455
- # Enable retries of non-idempotent requests that change data (e.g. POST
456
- # requests) when the server has disconnected.
457
- #
458
- # This will in the worst case lead to multiple requests with the same data,
459
- # but it may be useful for some applications. Take care when enabling
460
- # this option to ensure it is safe to POST or perform other non-idempotent
461
- # requests to the server.
462
-
463
- attr_accessor :retry_change_requests
464
-
465
452
  ##
466
453
  # Creates a new Bundler::Persistent::Net::HTTP::Persistent.
467
454
  #
468
- # Set +name+ to keep your connections apart from everybody else's. Not
469
- # required currently, but highly recommended. Your library name should be
470
- # good enough. This parameter will be required in a future version.
455
+ # Set a +name+ for fun. Your library name should be good enough, but this
456
+ # otherwise has no purpose.
471
457
  #
472
- # +proxy+ may be set to a URI::HTTP or :ENV to pick up proxy options from
458
+ # +proxy+ may be set to a Bundler::URI::HTTP or :ENV to pick up proxy options from
473
459
  # the environment. See proxy_from_env for details.
474
460
  #
475
- # In order to use a URI for the proxy you may need to do some extra work
476
- # beyond URI parsing if the proxy requires a password:
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:
477
463
  #
478
- # proxy = URI 'http://proxy.example'
464
+ # proxy = Bundler::URI 'http://proxy.example'
479
465
  # proxy.user = 'AzureDiamond'
480
466
  # proxy.password = 'hunter2'
467
+ #
468
+ # Set +pool_size+ to limit the maximum number of connections allowed.
469
+ # Defaults to 1/4 the number of allowed file handles or 256 if your OS does
470
+ # not support a limit on allowed file handles. You can have no more than
471
+ # this many threads with active HTTP transactions.
481
472
 
482
- def initialize name = nil, proxy = nil
473
+ def initialize name: nil, proxy: nil, pool_size: DEFAULT_POOL_SIZE
483
474
  @name = name
484
475
 
485
476
  @debug_output = nil
@@ -491,40 +482,41 @@ class Bundler::Persistent::Net::HTTP::Persistent
491
482
  @keep_alive = 30
492
483
  @open_timeout = nil
493
484
  @read_timeout = nil
485
+ @write_timeout = nil
494
486
  @idle_timeout = 5
495
487
  @max_requests = nil
488
+ @max_retries = 1
496
489
  @socket_options = []
490
+ @ssl_generation = 0 # incremented when SSL session variables change
497
491
 
498
492
  @socket_options << [Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1] if
499
493
  Socket.const_defined? :TCP_NODELAY
500
494
 
501
- key = ['net_http_persistent', name].compact
502
- @generation_key = [key, 'generations' ].join('_').intern
503
- @ssl_generation_key = [key, 'ssl_generations'].join('_').intern
504
- @request_key = [key, 'requests' ].join('_').intern
505
- @timeout_key = [key, 'timeouts' ].join('_').intern
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
497
+ end
506
498
 
507
499
  @certificate = nil
508
500
  @ca_file = nil
501
+ @ca_path = nil
502
+ @ciphers = nil
509
503
  @private_key = nil
504
+ @ssl_timeout = nil
510
505
  @ssl_version = nil
506
+ @min_version = nil
507
+ @max_version = nil
511
508
  @verify_callback = nil
509
+ @verify_depth = nil
512
510
  @verify_mode = nil
513
511
  @cert_store = nil
514
512
 
515
- @generation = 0 # incremented when proxy URI changes
516
- @ssl_generation = 0 # incremented when SSL session variables change
513
+ @generation = 0 # incremented when proxy Bundler::URI changes
517
514
 
518
515
  if HAVE_OPENSSL then
519
516
  @verify_mode = OpenSSL::SSL::VERIFY_PEER
520
517
  @reuse_ssl_sessions = OpenSSL::SSL.const_defined? :Session
521
518
  end
522
519
 
523
- @retry_change_requests = false
524
-
525
- @ruby_1 = RUBY_VERSION < '2'
526
- @retried_on_ruby_2 = !@ruby_1
527
-
528
520
  self.proxy = proxy if proxy
529
521
  end
530
522
 
@@ -549,6 +541,15 @@ class Bundler::Persistent::Net::HTTP::Persistent
549
541
  reconnect_ssl
550
542
  end
551
543
 
544
+ ##
545
+ # Sets the SSL certificate authority path.
546
+
547
+ def ca_path= path
548
+ @ca_path = path
549
+
550
+ reconnect_ssl
551
+ end
552
+
552
553
  ##
553
554
  # Overrides the default SSL certificate store used for verifying
554
555
  # connections.
@@ -560,117 +561,74 @@ class Bundler::Persistent::Net::HTTP::Persistent
560
561
  end
561
562
 
562
563
  ##
563
- # Finishes all connections on the given +thread+ that were created before
564
- # the given +generation+ in the threads +generation_key+ list.
565
- #
566
- # See #shutdown for a bunch of scary warning about misusing this method.
564
+ # The ciphers allowed for SSL connections
567
565
 
568
- def cleanup(generation, thread = Thread.current,
569
- generation_key = @generation_key) # :nodoc:
570
- timeouts = thread[@timeout_key]
566
+ def ciphers= ciphers
567
+ @ciphers = ciphers
571
568
 
572
- (0...generation).each do |old_generation|
573
- next unless thread[generation_key]
574
-
575
- conns = thread[generation_key].delete old_generation
576
-
577
- conns.each_value do |conn|
578
- finish conn, thread
579
-
580
- timeouts.delete conn.object_id if timeouts
581
- end if conns
582
- end
569
+ reconnect_ssl
583
570
  end
584
571
 
585
572
  ##
586
573
  # Creates a new connection for +uri+
587
574
 
588
575
  def connection_for uri
589
- Thread.current[@generation_key] ||= Hash.new { |h,k| h[k] = {} }
590
- Thread.current[@ssl_generation_key] ||= Hash.new { |h,k| h[k] = {} }
591
- Thread.current[@request_key] ||= Hash.new 0
592
- Thread.current[@timeout_key] ||= Hash.new EPOCH
593
-
594
576
  use_ssl = uri.scheme.downcase == 'https'
595
577
 
596
- if use_ssl then
597
- raise Bundler::Persistent::Net::HTTP::Persistent::Error, 'OpenSSL is not available' unless
598
- HAVE_OPENSSL
599
-
600
- ssl_generation = @ssl_generation
601
-
602
- ssl_cleanup ssl_generation
603
-
604
- connections = Thread.current[@ssl_generation_key][ssl_generation]
605
- else
606
- generation = @generation
607
-
608
- cleanup generation
609
-
610
- connections = Thread.current[@generation_key][generation]
611
- end
612
-
613
- net_http_args = [uri.host, uri.port]
614
- connection_id = net_http_args.join ':'
578
+ net_http_args = [uri.hostname, uri.port]
615
579
 
580
+ # I'm unsure if uri.host or uri.hostname should be checked against
581
+ # the proxy bypass list.
616
582
  if @proxy_uri and not proxy_bypass? uri.host, uri.port then
617
- connection_id << @proxy_connection_id
618
583
  net_http_args.concat @proxy_args
619
584
  else
620
585
  net_http_args.concat [nil, nil, nil, nil]
621
586
  end
622
587
 
623
- connection = connections[connection_id]
588
+ connection = @pool.checkout net_http_args
624
589
 
625
- unless connection = connections[connection_id] then
626
- connections[connection_id] = http_class.new(*net_http_args)
627
- connection = connections[connection_id]
628
- ssl connection if use_ssl
629
- else
630
- reset connection if expired? connection
631
- end
590
+ http = connection.http
632
591
 
633
- start connection unless connection.started?
592
+ connection.ressl @ssl_generation if
593
+ connection.ssl_generation != @ssl_generation
594
+
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
634
601
 
635
- connection.read_timeout = @read_timeout if @read_timeout
636
- connection.keep_alive_timeout = @idle_timeout if @idle_timeout && connection.respond_to?(:keep_alive_timeout=)
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=)
637
607
 
638
- connection
608
+ return yield connection
639
609
  rescue Errno::ECONNREFUSED
640
- address = connection.proxy_address || connection.address
641
- port = connection.proxy_port || connection.port
610
+ address = http.proxy_address || http.address
611
+ port = http.proxy_port || http.port
642
612
 
643
613
  raise Error, "connection refused: #{address}:#{port}"
644
614
  rescue Errno::EHOSTDOWN
645
- address = connection.proxy_address || connection.address
646
- port = connection.proxy_port || connection.port
615
+ address = http.proxy_address || http.address
616
+ port = http.proxy_port || http.port
647
617
 
648
618
  raise Error, "host down: #{address}:#{port}"
619
+ ensure
620
+ @pool.checkin net_http_args
649
621
  end
650
622
 
651
623
  ##
652
- # Returns an error message containing the number of requests performed on
653
- # this connection
654
-
655
- def error_message connection
656
- requests = Thread.current[@request_key][connection.object_id] - 1 # fixup
657
- last_use = Thread.current[@timeout_key][connection.object_id]
658
-
659
- age = Time.now - last_use
660
-
661
- "after #{requests} requests on #{connection.object_id}, " \
662
- "last used #{age} seconds ago"
663
- end
664
-
665
- ##
666
- # URI::escape wrapper
624
+ # CGI::escape wrapper
667
625
 
668
626
  def escape str
669
627
  CGI.escape str if str
670
628
  end
671
629
 
672
630
  ##
673
- # URI::unescape wrapper
631
+ # CGI::unescape wrapper
674
632
 
675
633
  def unescape str
676
634
  CGI.unescape str if str
@@ -682,26 +640,23 @@ class Bundler::Persistent::Net::HTTP::Persistent
682
640
  # maximum request count, false otherwise.
683
641
 
684
642
  def expired? connection
685
- requests = Thread.current[@request_key][connection.object_id]
686
- return true if @max_requests && requests >= @max_requests
643
+ return true if @max_requests && connection.requests >= @max_requests
687
644
  return false unless @idle_timeout
688
645
  return true if @idle_timeout.zero?
689
646
 
690
- last_used = Thread.current[@timeout_key][connection.object_id]
691
-
692
- Time.now - last_used > @idle_timeout
647
+ Time.now - connection.last_use > @idle_timeout
693
648
  end
694
649
 
695
650
  ##
696
651
  # Starts the Net::HTTP +connection+
697
652
 
698
- def start connection
699
- connection.set_debug_output @debug_output if @debug_output
700
- connection.open_timeout = @open_timeout if @open_timeout
653
+ def start http
654
+ http.set_debug_output @debug_output if @debug_output
655
+ http.open_timeout = @open_timeout if @open_timeout
701
656
 
702
- connection.start
657
+ http.start
703
658
 
704
- socket = connection.instance_variable_get :@socket
659
+ socket = http.instance_variable_get :@socket
705
660
 
706
661
  if socket then # for fakeweb
707
662
  @socket_options.each do |option|
@@ -713,96 +668,19 @@ class Bundler::Persistent::Net::HTTP::Persistent
713
668
  ##
714
669
  # Finishes the Net::HTTP +connection+
715
670
 
716
- def finish connection, thread = Thread.current
717
- if requests = thread[@request_key] then
718
- requests.delete connection.object_id
719
- end
720
-
671
+ def finish connection
721
672
  connection.finish
722
- rescue IOError
723
- end
724
673
 
725
- def http_class # :nodoc:
726
- if RUBY_VERSION > '2.0' then
727
- Net::HTTP
728
- elsif [:Artifice, :FakeWeb, :WebMock].any? { |klass|
729
- Object.const_defined?(klass)
730
- } or not @reuse_ssl_sessions then
731
- Net::HTTP
732
- else
733
- Bundler::Persistent::Net::HTTP::Persistent::SSLReuse
734
- end
674
+ connection.http.instance_variable_set :@last_communicated, nil
675
+ connection.http.instance_variable_set :@ssl_session, nil unless
676
+ @reuse_ssl_sessions
735
677
  end
736
678
 
737
679
  ##
738
680
  # Returns the HTTP protocol version for +uri+
739
681
 
740
682
  def http_version uri
741
- @http_versions["#{uri.host}:#{uri.port}"]
742
- end
743
-
744
- ##
745
- # Is +req+ idempotent according to RFC 2616?
746
-
747
- def idempotent? req
748
- case req
749
- when Net::HTTP::Delete, Net::HTTP::Get, Net::HTTP::Head,
750
- Net::HTTP::Options, Net::HTTP::Put, Net::HTTP::Trace then
751
- true
752
- end
753
- end
754
-
755
- ##
756
- # Is the request +req+ idempotent or is retry_change_requests allowed.
757
- #
758
- # If +retried_on_ruby_2+ is true, true will be returned if we are on ruby,
759
- # retry_change_requests is allowed and the request is not idempotent.
760
-
761
- def can_retry? req, retried_on_ruby_2 = false
762
- return @retry_change_requests && !idempotent?(req) if retried_on_ruby_2
763
-
764
- @retry_change_requests || idempotent?(req)
765
- end
766
-
767
- if RUBY_VERSION > '1.9' then
768
- ##
769
- # Workaround for missing Net::HTTPHeader#connection_close? on Ruby 1.8
770
-
771
- def connection_close? header
772
- header.connection_close?
773
- end
774
-
775
- ##
776
- # Workaround for missing Net::HTTPHeader#connection_keep_alive? on Ruby 1.8
777
-
778
- def connection_keep_alive? header
779
- header.connection_keep_alive?
780
- end
781
- else
782
- ##
783
- # Workaround for missing Net::HTTPRequest#connection_close? on Ruby 1.8
784
-
785
- def connection_close? header
786
- header['connection'] =~ /close/ or header['proxy-connection'] =~ /close/
787
- end
788
-
789
- ##
790
- # Workaround for missing Net::HTTPRequest#connection_keep_alive? on Ruby
791
- # 1.8
792
-
793
- def connection_keep_alive? header
794
- header['connection'] =~ /keep-alive/ or
795
- header['proxy-connection'] =~ /keep-alive/
796
- end
797
- end
798
-
799
- ##
800
- # Deprecated in favor of #expired?
801
-
802
- def max_age # :nodoc:
803
- return Time.now + 1 unless @idle_timeout
804
-
805
- Time.now - @idle_timeout
683
+ @http_versions["#{uri.hostname}:#{uri.port}"]
806
684
  end
807
685
 
808
686
  ##
@@ -813,20 +691,20 @@ class Bundler::Persistent::Net::HTTP::Persistent
813
691
  end
814
692
 
815
693
  ##
816
- # Pipelines +requests+ to the HTTP server at +uri+ yielding responses if a
817
- # block is given. Returns all responses received.
694
+ # Set the maximum number of retries for a request.
818
695
  #
819
- # See
820
- # Net::HTTP::Pipeline[http://docs.seattlerb.org/net-http-pipeline/Net/HTTP/Pipeline.html]
821
- # for further details.
696
+ # Defaults to one retry.
822
697
  #
823
- # Only if <tt>net-http-pipeline</tt> was required before
824
- # <tt>net-http-persistent</tt> #pipeline will be present.
698
+ # Set this to 0 to disable retries.
699
+
700
+ def max_retries= retries
701
+ retries = retries.to_int
702
+
703
+ raise ArgumentError, "max_retries must be positive" if retries < 0
825
704
 
826
- def pipeline uri, requests, &block # :yields: responses
827
- connection = connection_for uri
705
+ @max_retries = retries
828
706
 
829
- connection.pipeline requests, &block
707
+ reconnect
830
708
  end
831
709
 
832
710
  ##
@@ -842,12 +720,12 @@ class Bundler::Persistent::Net::HTTP::Persistent
842
720
  alias key= private_key=
843
721
 
844
722
  ##
845
- # Sets the proxy server. The +proxy+ may be the URI of the proxy server,
723
+ # Sets the proxy server. The +proxy+ may be the Bundler::URI of the proxy server,
846
724
  # the symbol +:ENV+ which will read the proxy from the environment or nil to
847
725
  # disable use of a proxy. See #proxy_from_env for details on setting the
848
726
  # proxy from the environment.
849
727
  #
850
- # If the proxy URI is set after requests have been made, the next request
728
+ # If the proxy Bundler::URI is set after requests have been made, the next request
851
729
  # will shut-down and re-open all connections.
852
730
  #
853
731
  # The +no_proxy+ query parameter can be used to specify hosts which shouldn't
@@ -858,16 +736,16 @@ class Bundler::Persistent::Net::HTTP::Persistent
858
736
  def proxy= proxy
859
737
  @proxy_uri = case proxy
860
738
  when :ENV then proxy_from_env
861
- when URI::HTTP then proxy
739
+ when Bundler::URI::HTTP then proxy
862
740
  when nil then # ignore
863
- else raise ArgumentError, 'proxy must be :ENV or a URI::HTTP'
741
+ else raise ArgumentError, 'proxy must be :ENV or a Bundler::URI::HTTP'
864
742
  end
865
743
 
866
744
  @no_proxy.clear
867
745
 
868
746
  if @proxy_uri then
869
747
  @proxy_args = [
870
- @proxy_uri.host,
748
+ @proxy_uri.hostname,
871
749
  @proxy_uri.port,
872
750
  unescape(@proxy_uri.user),
873
751
  unescape(@proxy_uri.password),
@@ -885,13 +763,13 @@ class Bundler::Persistent::Net::HTTP::Persistent
885
763
  end
886
764
 
887
765
  ##
888
- # Creates a URI for an HTTP proxy server from ENV variables.
766
+ # Creates a Bundler::URI for an HTTP proxy server from ENV variables.
889
767
  #
890
768
  # If +HTTP_PROXY+ is set a proxy will be returned.
891
769
  #
892
- # If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the URI is given the
770
+ # If +HTTP_PROXY_USER+ or +HTTP_PROXY_PASS+ are set the Bundler::URI is given the
893
771
  # indicated user and password unless HTTP_PROXY contains either of these in
894
- # the URI.
772
+ # the Bundler::URI.
895
773
  #
896
774
  # The +NO_PROXY+ ENV variable can be used to specify hosts which shouldn't
897
775
  # be reached via proxy; if set it should be a comma separated list of
@@ -907,7 +785,7 @@ class Bundler::Persistent::Net::HTTP::Persistent
907
785
 
908
786
  return nil if env_proxy.nil? or env_proxy.empty?
909
787
 
910
- uri = URI normalize_uri env_proxy
788
+ uri = Bundler::URI normalize_uri env_proxy
911
789
 
912
790
  env_no_proxy = ENV['no_proxy'] || ENV['NO_PROXY']
913
791
 
@@ -942,14 +820,15 @@ class Bundler::Persistent::Net::HTTP::Persistent
942
820
  end
943
821
 
944
822
  ##
945
- # Forces reconnection of HTTP connections.
823
+ # Forces reconnection of all HTTP connections, including TLS/SSL
824
+ # connections.
946
825
 
947
826
  def reconnect
948
827
  @generation += 1
949
828
  end
950
829
 
951
830
  ##
952
- # Forces reconnection of SSL connections.
831
+ # Forces reconnection of only TLS/SSL connections.
953
832
 
954
833
  def reconnect_ssl
955
834
  @ssl_generation += 1
@@ -959,18 +838,17 @@ class Bundler::Persistent::Net::HTTP::Persistent
959
838
  # Finishes then restarts the Net::HTTP +connection+
960
839
 
961
840
  def reset connection
962
- Thread.current[@request_key].delete connection.object_id
963
- Thread.current[@timeout_key].delete connection.object_id
841
+ http = connection.http
964
842
 
965
843
  finish connection
966
844
 
967
- start connection
845
+ start http
968
846
  rescue Errno::ECONNREFUSED
969
- e = Error.new "connection refused: #{connection.address}:#{connection.port}"
847
+ e = Error.new "connection refused: #{http.address}:#{http.port}"
970
848
  e.set_backtrace $@
971
849
  raise e
972
850
  rescue Errno::EHOSTDOWN
973
- e = Error.new "host down: #{connection.address}:#{connection.port}"
851
+ e = Error.new "host down: #{http.address}:#{http.port}"
974
852
  e.set_backtrace $@
975
853
  raise e
976
854
  end
@@ -982,92 +860,49 @@ class Bundler::Persistent::Net::HTTP::Persistent
982
860
  # If a block is passed #request behaves like Net::HTTP#request (the body of
983
861
  # the response will not have been read).
984
862
  #
985
- # +req+ must be a Net::HTTPRequest subclass (see Net::HTTP for a list).
986
- #
987
- # If there is an error and the request is idempotent according to RFC 2616
988
- # it will be retried automatically.
863
+ # +req+ must be a Net::HTTPGenericRequest subclass (see Net::HTTP for a list).
989
864
 
990
865
  def request uri, req = nil, &block
991
- retried = false
992
- bad_response = false
993
-
994
- req = request_setup req || uri
995
-
996
- connection = connection_for uri
997
- connection_id = connection.object_id
998
-
999
- begin
1000
- Thread.current[@request_key][connection_id] += 1
1001
- response = connection.request req, &block
1002
-
1003
- if connection_close?(req) or
1004
- (response.http_version <= '1.0' and
1005
- not connection_keep_alive?(response)) or
1006
- connection_close?(response) then
1007
- connection.finish
866
+ uri = Bundler::URI uri
867
+ req = request_setup req || uri
868
+ response = nil
869
+
870
+ connection_for uri do |connection|
871
+ http = connection.http
872
+
873
+ begin
874
+ connection.requests += 1
875
+
876
+ response = http.request req, &block
877
+
878
+ if req.connection_close? or
879
+ (response.http_version <= '1.0' and
880
+ not response.connection_keep_alive?) or
881
+ response.connection_close? then
882
+ finish connection
883
+ end
884
+ rescue Exception # make sure to close the connection when it was interrupted
885
+ finish connection
886
+
887
+ raise
888
+ ensure
889
+ connection.last_use = Time.now
1008
890
  end
1009
- rescue Net::HTTPBadResponse => e
1010
- message = error_message connection
1011
-
1012
- finish connection
1013
-
1014
- raise Error, "too many bad responses #{message}" if
1015
- bad_response or not can_retry? req
1016
-
1017
- bad_response = true
1018
- retry
1019
- rescue *RETRIED_EXCEPTIONS => e # retried on ruby 2
1020
- request_failed e, req, connection if
1021
- retried or not can_retry? req, @retried_on_ruby_2
1022
-
1023
- reset connection
1024
-
1025
- retried = true
1026
- retry
1027
- rescue Errno::EINVAL, Errno::ETIMEDOUT => e # not retried on ruby 2
1028
- request_failed e, req, connection if retried or not can_retry? req
1029
-
1030
- reset connection
1031
-
1032
- retried = true
1033
- retry
1034
- rescue Exception => e
1035
- finish connection
1036
-
1037
- raise
1038
- ensure
1039
- Thread.current[@timeout_key][connection_id] = Time.now
1040
891
  end
1041
892
 
1042
- @http_versions["#{uri.host}:#{uri.port}"] ||= response.http_version
893
+ @http_versions["#{uri.hostname}:#{uri.port}"] ||= response.http_version
1043
894
 
1044
895
  response
1045
896
  end
1046
897
 
1047
898
  ##
1048
- # Raises an Error for +exception+ which resulted from attempting the request
1049
- # +req+ on the +connection+.
1050
- #
1051
- # Finishes the +connection+.
1052
-
1053
- def request_failed exception, req, connection # :nodoc:
1054
- due_to = "(due to #{exception.message} - #{exception.class})"
1055
- message = "too many connection resets #{due_to} #{error_message connection}"
1056
-
1057
- finish connection
1058
-
1059
-
1060
- raise Error, message, exception.backtrace
1061
- end
1062
-
1063
- ##
1064
- # Creates a GET request if +req_or_uri+ is a URI and adds headers to the
899
+ # Creates a GET request if +req_or_uri+ is a Bundler::URI and adds headers to the
1065
900
  # request.
1066
901
  #
1067
902
  # Returns the request.
1068
903
 
1069
904
  def request_setup req_or_uri # :nodoc:
1070
- req = if URI === req_or_uri then
905
+ req = if req_or_uri.respond_to? 'request_uri' then
1071
906
  Net::HTTP::Get.new req_or_uri.request_uri
1072
907
  else
1073
908
  req_or_uri
@@ -1090,45 +925,15 @@ class Bundler::Persistent::Net::HTTP::Persistent
1090
925
  end
1091
926
 
1092
927
  ##
1093
- # Shuts down all connections for +thread+.
1094
- #
1095
- # Uses the current thread by default.
1096
- #
1097
- # If you've used Bundler::Persistent::Net::HTTP::Persistent across multiple threads you should
1098
- # call this in each thread when you're done making HTTP requests.
1099
- #
1100
- # *NOTE*: Calling shutdown for another thread can be dangerous!
1101
- #
1102
- # If the thread is still using the connection it may cause an error! It is
1103
- # best to call #shutdown in the thread at the appropriate time instead!
1104
-
1105
- def shutdown thread = Thread.current
1106
- generation = reconnect
1107
- cleanup generation, thread, @generation_key
1108
-
1109
- ssl_generation = reconnect_ssl
1110
- cleanup ssl_generation, thread, @ssl_generation_key
1111
-
1112
- thread[@request_key] = nil
1113
- thread[@timeout_key] = nil
1114
- end
1115
-
1116
- ##
1117
- # Shuts down all connections in all threads
1118
- #
1119
- # *NOTE*: THIS METHOD IS VERY DANGEROUS!
928
+ # Shuts down all connections
1120
929
  #
1121
- # Do not call this method if other threads are still using their
1122
- # connections! Call #shutdown at the appropriate time instead!
930
+ # *NOTE*: Calling shutdown for can be dangerous!
1123
931
  #
1124
- # Use this method only as a last resort!
932
+ # If any thread is still using a connection it may cause an error! Call
933
+ # #shutdown when you are completely done making requests!
1125
934
 
1126
- def shutdown_in_all_threads
1127
- Thread.list.each do |thread|
1128
- shutdown thread
1129
- end
1130
-
1131
- nil
935
+ def shutdown
936
+ @pool.shutdown { |http| http.finish }
1132
937
  end
1133
938
 
1134
939
  ##
@@ -1137,9 +942,14 @@ class Bundler::Persistent::Net::HTTP::Persistent
1137
942
  def ssl connection
1138
943
  connection.use_ssl = true
1139
944
 
945
+ connection.ciphers = @ciphers if @ciphers
946
+ connection.ssl_timeout = @ssl_timeout if @ssl_timeout
1140
947
  connection.ssl_version = @ssl_version if @ssl_version
948
+ connection.min_version = @min_version if @min_version
949
+ connection.max_version = @max_version if @max_version
1141
950
 
1142
- connection.verify_mode = @verify_mode
951
+ connection.verify_depth = @verify_depth
952
+ connection.verify_mode = @verify_mode
1143
953
 
1144
954
  if OpenSSL::SSL::VERIFY_PEER == OpenSSL::SSL::VERIFY_NONE and
1145
955
  not Object.const_defined?(:I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG) then
@@ -1168,8 +978,10 @@ application:
1168
978
  WARNING
1169
979
  end
1170
980
 
1171
- if @ca_file then
1172
- connection.ca_file = @ca_file
981
+ connection.ca_file = @ca_file if @ca_file
982
+ connection.ca_path = @ca_path if @ca_path
983
+
984
+ if @ca_file or @ca_path then
1173
985
  connection.verify_mode = OpenSSL::SSL::VERIFY_PEER
1174
986
  connection.verify_callback = @verify_callback if @verify_callback
1175
987
  end
@@ -1189,11 +1001,12 @@ application:
1189
1001
  end
1190
1002
 
1191
1003
  ##
1192
- # Finishes all connections that existed before the given SSL parameter
1193
- # +generation+.
1004
+ # SSL session lifetime
1005
+
1006
+ def ssl_timeout= ssl_timeout
1007
+ @ssl_timeout = ssl_timeout
1194
1008
 
1195
- def ssl_cleanup generation # :nodoc:
1196
- cleanup generation, Thread.current, @ssl_generation_key
1009
+ reconnect_ssl
1197
1010
  end
1198
1011
 
1199
1012
  ##
@@ -1203,7 +1016,34 @@ application:
1203
1016
  @ssl_version = ssl_version
1204
1017
 
1205
1018
  reconnect_ssl
1206
- end if RUBY_VERSION > '1.9'
1019
+ end
1020
+
1021
+ ##
1022
+ # Minimum SSL version to use
1023
+
1024
+ def min_version= min_version
1025
+ @min_version = min_version
1026
+
1027
+ reconnect_ssl
1028
+ end
1029
+
1030
+ ##
1031
+ # maximum SSL version to use
1032
+
1033
+ def max_version= max_version
1034
+ @max_version = max_version
1035
+
1036
+ reconnect_ssl
1037
+ end
1038
+
1039
+ ##
1040
+ # Sets the depth of SSL certificate verification
1041
+
1042
+ def verify_depth= verify_depth
1043
+ @verify_depth = verify_depth
1044
+
1045
+ reconnect_ssl
1046
+ end
1207
1047
 
1208
1048
  ##
1209
1049
  # Sets the HTTPS verify mode. Defaults to OpenSSL::SSL::VERIFY_PEER.
@@ -1226,8 +1066,8 @@ application:
1226
1066
 
1227
1067
  reconnect_ssl
1228
1068
  end
1229
-
1230
1069
  end
1231
1070
 
1232
- require 'bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse'
1071
+ require_relative 'persistent/connection'
1072
+ require_relative 'persistent/pool'
1233
1073