rubygems-update 2.6.4 → 2.6.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

Files changed (288) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +18 -24
  3. data/CODE_OF_CONDUCT.md +2 -2
  4. data/CONTRIBUTING.rdoc +1 -1
  5. data/History.txt +30 -1
  6. data/Manifest.txt +233 -3
  7. data/Rakefile +30 -1
  8. data/appveyor.yml +0 -2
  9. data/bundler/CHANGELOG.md +2407 -0
  10. data/bundler/CODE_OF_CONDUCT.md +42 -0
  11. data/bundler/CONTRIBUTING.md +36 -0
  12. data/bundler/DEVELOPMENT.md +148 -0
  13. data/bundler/ISSUES.md +100 -0
  14. data/bundler/LICENSE.md +23 -0
  15. data/bundler/README.md +40 -0
  16. data/bundler/exe/bundle +35 -0
  17. data/bundler/exe/bundle_ruby +61 -0
  18. data/bundler/exe/bundler +22 -0
  19. data/bundler/lib/bundler.rb +455 -0
  20. data/bundler/lib/bundler/capistrano.rb +17 -0
  21. data/bundler/lib/bundler/cli.rb +497 -0
  22. data/bundler/lib/bundler/cli/binstubs.rb +40 -0
  23. data/bundler/lib/bundler/cli/cache.rb +35 -0
  24. data/bundler/lib/bundler/cli/check.rb +40 -0
  25. data/bundler/lib/bundler/cli/clean.rb +26 -0
  26. data/bundler/lib/bundler/cli/common.rb +56 -0
  27. data/bundler/lib/bundler/cli/config.rb +100 -0
  28. data/bundler/lib/bundler/cli/console.rb +39 -0
  29. data/bundler/lib/bundler/cli/exec.rb +82 -0
  30. data/bundler/lib/bundler/cli/gem.rb +214 -0
  31. data/bundler/lib/bundler/cli/init.rb +33 -0
  32. data/bundler/lib/bundler/cli/inject.rb +33 -0
  33. data/bundler/lib/bundler/cli/install.rb +225 -0
  34. data/bundler/lib/bundler/cli/lock.rb +48 -0
  35. data/bundler/lib/bundler/cli/open.rb +25 -0
  36. data/bundler/lib/bundler/cli/outdated.rb +151 -0
  37. data/bundler/lib/bundler/cli/package.rb +46 -0
  38. data/bundler/lib/bundler/cli/platform.rb +45 -0
  39. data/bundler/lib/bundler/cli/plugin.rb +23 -0
  40. data/bundler/lib/bundler/cli/show.rb +75 -0
  41. data/bundler/lib/bundler/cli/update.rb +72 -0
  42. data/bundler/lib/bundler/cli/viz.rb +27 -0
  43. data/bundler/lib/bundler/constants.rb +6 -0
  44. data/bundler/lib/bundler/current_ruby.rb +84 -0
  45. data/bundler/lib/bundler/definition.rb +744 -0
  46. data/bundler/lib/bundler/dep_proxy.rb +46 -0
  47. data/bundler/lib/bundler/dependency.rb +127 -0
  48. data/bundler/lib/bundler/deployment.rb +63 -0
  49. data/bundler/lib/bundler/deprecate.rb +16 -0
  50. data/bundler/lib/bundler/dsl.rb +512 -0
  51. data/bundler/lib/bundler/endpoint_specification.rb +129 -0
  52. data/bundler/lib/bundler/env.rb +83 -0
  53. data/bundler/lib/bundler/environment.rb +42 -0
  54. data/bundler/lib/bundler/environment_preserver.rb +38 -0
  55. data/bundler/lib/bundler/errors.rb +124 -0
  56. data/bundler/lib/bundler/fetcher.rb +304 -0
  57. data/bundler/lib/bundler/fetcher/base.rb +41 -0
  58. data/bundler/lib/bundler/fetcher/compact_index.rb +103 -0
  59. data/bundler/lib/bundler/fetcher/dependency.rb +92 -0
  60. data/bundler/lib/bundler/fetcher/downloader.rb +66 -0
  61. data/bundler/lib/bundler/fetcher/index.rb +51 -0
  62. data/bundler/lib/bundler/friendly_errors.rb +103 -0
  63. data/bundler/lib/bundler/gem_helper.rb +188 -0
  64. data/bundler/lib/bundler/gem_helpers.rb +32 -0
  65. data/bundler/lib/bundler/gem_remote_fetcher.rb +42 -0
  66. data/bundler/lib/bundler/gem_tasks.rb +6 -0
  67. data/bundler/lib/bundler/graph.rb +172 -0
  68. data/bundler/lib/bundler/index.rb +191 -0
  69. data/bundler/lib/bundler/injector.rb +63 -0
  70. data/bundler/lib/bundler/inline.rb +74 -0
  71. data/bundler/lib/bundler/installer.rb +217 -0
  72. data/bundler/lib/bundler/installer/gem_installer.rb +77 -0
  73. data/bundler/lib/bundler/installer/parallel_installer.rb +126 -0
  74. data/bundler/lib/bundler/installer/standalone.rb +52 -0
  75. data/bundler/lib/bundler/lazy_specification.rb +85 -0
  76. data/bundler/lib/bundler/lockfile_parser.rb +233 -0
  77. data/bundler/lib/bundler/match_platform.rb +14 -0
  78. data/bundler/lib/bundler/mirror.rb +218 -0
  79. data/bundler/lib/bundler/plugin.rb +156 -0
  80. data/bundler/lib/bundler/plugin/api.rb +56 -0
  81. data/bundler/lib/bundler/plugin/dsl.rb +29 -0
  82. data/bundler/lib/bundler/plugin/index.rb +88 -0
  83. data/bundler/lib/bundler/plugin/installer.rb +99 -0
  84. data/bundler/lib/bundler/plugin/installer/git.rb +38 -0
  85. data/bundler/lib/bundler/plugin/installer/rubygems.rb +27 -0
  86. data/bundler/lib/bundler/plugin/source_list.rb +24 -0
  87. data/bundler/lib/bundler/postit_trampoline.rb +57 -0
  88. data/bundler/lib/bundler/psyched_yaml.rb +27 -0
  89. data/bundler/lib/bundler/remote_specification.rb +85 -0
  90. data/bundler/lib/bundler/resolver.rb +368 -0
  91. data/bundler/lib/bundler/retry.rb +61 -0
  92. data/bundler/lib/bundler/ruby_dsl.rb +17 -0
  93. data/bundler/lib/bundler/ruby_version.rb +140 -0
  94. data/bundler/lib/bundler/rubygems_ext.rb +178 -0
  95. data/bundler/lib/bundler/rubygems_gem_installer.rb +10 -0
  96. data/bundler/lib/bundler/rubygems_integration.rb +710 -0
  97. data/bundler/lib/bundler/runtime.rb +282 -0
  98. data/bundler/lib/bundler/settings.rb +259 -0
  99. data/bundler/lib/bundler/setup.rb +28 -0
  100. data/bundler/lib/bundler/shared_helpers.rb +212 -0
  101. data/bundler/lib/bundler/similarity_detector.rb +62 -0
  102. data/bundler/lib/bundler/source.rb +37 -0
  103. data/bundler/lib/bundler/source/gemspec.rb +13 -0
  104. data/bundler/lib/bundler/source/git.rb +297 -0
  105. data/bundler/lib/bundler/source/git/git_proxy.rb +218 -0
  106. data/bundler/lib/bundler/source/path.rb +245 -0
  107. data/bundler/lib/bundler/source/path/installer.rb +44 -0
  108. data/bundler/lib/bundler/source/rubygems.rb +450 -0
  109. data/bundler/lib/bundler/source/rubygems/remote.rb +59 -0
  110. data/bundler/lib/bundler/source_list.rb +106 -0
  111. data/bundler/lib/bundler/spec_set.rb +157 -0
  112. data/bundler/lib/bundler/ssl_certs/.document +1 -0
  113. data/bundler/lib/bundler/ssl_certs/certificate_manager.rb +65 -0
  114. data/bundler/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
  115. data/bundler/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +23 -0
  116. data/{lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot-2048.pem → bundler/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem} +0 -0
  117. data/bundler/lib/bundler/stub_specification.rb +24 -0
  118. data/bundler/lib/bundler/templates/Executable +17 -0
  119. data/bundler/lib/bundler/templates/Executable.standalone +12 -0
  120. data/bundler/lib/bundler/templates/Gemfile +5 -0
  121. data/bundler/lib/bundler/templates/newgem/.travis.yml.tt +5 -0
  122. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +74 -0
  123. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  124. data/bundler/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
  125. data/bundler/lib/bundler/templates/newgem/README.md.tt +41 -0
  126. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +29 -0
  127. data/bundler/lib/bundler/templates/newgem/bin/console.tt +14 -0
  128. data/bundler/lib/bundler/templates/newgem/bin/setup.tt +8 -0
  129. data/bundler/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  130. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +3 -0
  131. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
  132. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
  133. data/bundler/lib/bundler/templates/newgem/gitignore.tt +16 -0
  134. data/bundler/lib/bundler/templates/newgem/lib/newgem.rb.tt +12 -0
  135. data/bundler/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  136. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +46 -0
  137. data/bundler/lib/bundler/templates/newgem/rspec.tt +2 -0
  138. data/bundler/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +11 -0
  139. data/bundler/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
  140. data/bundler/lib/bundler/templates/newgem/test/newgem_test.rb.tt +11 -0
  141. data/bundler/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
  142. data/bundler/lib/bundler/ui.rb +8 -0
  143. data/bundler/lib/bundler/ui/rg_proxy.rb +18 -0
  144. data/bundler/lib/bundler/ui/shell.rb +114 -0
  145. data/bundler/lib/bundler/ui/silent.rb +48 -0
  146. data/bundler/lib/bundler/uri_credentials_filter.rb +36 -0
  147. data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb +79 -0
  148. data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb +98 -0
  149. data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +80 -0
  150. data/bundler/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb +4 -0
  151. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb +10 -0
  152. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +50 -0
  153. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +80 -0
  154. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +203 -0
  155. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +35 -0
  156. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +58 -0
  157. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +61 -0
  158. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +53 -0
  159. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +114 -0
  160. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +45 -0
  161. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +35 -0
  162. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +123 -0
  163. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +75 -0
  164. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +5 -0
  165. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +100 -0
  166. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +65 -0
  167. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +460 -0
  168. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +45 -0
  169. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +54 -0
  170. data/bundler/lib/bundler/vendor/net/http/faster.rb +26 -0
  171. data/bundler/lib/bundler/vendor/net/http/persistent.rb +1230 -0
  172. data/bundler/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +128 -0
  173. data/bundler/lib/bundler/vendor/postit/lib/postit.rb +15 -0
  174. data/bundler/lib/bundler/vendor/postit/lib/postit/environment.rb +44 -0
  175. data/bundler/lib/bundler/vendor/postit/lib/postit/installer.rb +28 -0
  176. data/bundler/lib/bundler/vendor/postit/lib/postit/parser.rb +21 -0
  177. data/bundler/lib/bundler/vendor/postit/lib/postit/setup.rb +12 -0
  178. data/bundler/lib/bundler/vendor/postit/lib/postit/version.rb +3 -0
  179. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +484 -0
  180. data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +319 -0
  181. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +103 -0
  182. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +59 -0
  183. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +118 -0
  184. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +135 -0
  185. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +316 -0
  186. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +107 -0
  187. data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +656 -0
  188. data/bundler/lib/bundler/vendor/thor/lib/thor/command.rb +133 -0
  189. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +77 -0
  190. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +10 -0
  191. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +98 -0
  192. data/bundler/lib/bundler/vendor/thor/lib/thor/error.rb +32 -0
  193. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
  194. data/bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
  195. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
  196. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +35 -0
  197. data/bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
  198. data/bundler/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
  199. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +73 -0
  200. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +175 -0
  201. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +125 -0
  202. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +218 -0
  203. data/bundler/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +71 -0
  204. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +322 -0
  205. data/bundler/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
  206. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +421 -0
  207. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb +149 -0
  208. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +126 -0
  209. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +267 -0
  210. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
  211. data/bundler/lib/bundler/vendored_molinillo.rb +3 -0
  212. data/bundler/lib/bundler/vendored_persistent.rb +12 -0
  213. data/bundler/lib/bundler/vendored_thor.rb +4 -0
  214. data/bundler/lib/bundler/version.rb +11 -0
  215. data/bundler/lib/bundler/vlad.rb +12 -0
  216. data/bundler/lib/bundler/worker.rb +82 -0
  217. data/bundler/lib/bundler/yaml_serializer.rb +67 -0
  218. data/bundler/man/bundle-config.ronn +193 -0
  219. data/bundler/man/bundle-exec.ronn +136 -0
  220. data/bundler/man/bundle-gem.ronn +77 -0
  221. data/bundler/man/bundle-install.ronn +404 -0
  222. data/bundler/man/bundle-lock.ronn +47 -0
  223. data/bundler/man/bundle-package.ronn +67 -0
  224. data/bundler/man/bundle-platform.ronn +42 -0
  225. data/bundler/man/bundle-update.ronn +194 -0
  226. data/bundler/man/bundle.ronn +98 -0
  227. data/bundler/man/gemfile.5.ronn +499 -0
  228. data/bundler/man/index.txt +8 -0
  229. data/lib/rubygems.rb +42 -2
  230. data/lib/rubygems/config_file.rb +1 -1
  231. data/lib/rubygems/defaults.rb +18 -0
  232. data/lib/rubygems/installer.rb +1 -0
  233. data/lib/rubygems/package.rb +3 -1
  234. data/lib/rubygems/package/tar_writer.rb +10 -16
  235. data/lib/rubygems/remote_fetcher.rb +1 -15
  236. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/resolution_state.rb +50 -0
  237. data/lib/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb +80 -0
  238. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +57 -145
  239. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/action.rb +35 -0
  240. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +58 -0
  241. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +61 -0
  242. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +53 -0
  243. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/log.rb +114 -0
  244. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/set_payload.rb +45 -0
  245. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/tag.rb +35 -0
  246. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +123 -0
  247. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +1 -1
  248. data/lib/rubygems/resolver/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  249. data/lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb +55 -54
  250. data/lib/rubygems/resolver/molinillo/lib/molinillo/state.rb +4 -2
  251. data/lib/rubygems/security/signer.rb +2 -0
  252. data/lib/rubygems/specification.rb +4 -4
  253. data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
  254. data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +25 -0
  255. data/test/rubygems/alternate_cert.pem +10 -9
  256. data/test/rubygems/alternate_cert_32.pem +10 -9
  257. data/test/rubygems/child_cert.pem +11 -9
  258. data/test/rubygems/child_cert_32.pem +11 -9
  259. data/test/rubygems/encrypted_private_key.pem +26 -26
  260. data/test/rubygems/expired_cert.pem +9 -8
  261. data/test/rubygems/future_cert.pem +9 -8
  262. data/test/rubygems/future_cert_32.pem +9 -8
  263. data/test/rubygems/grandchild_cert.pem +11 -9
  264. data/test/rubygems/grandchild_cert_32.pem +11 -9
  265. data/test/rubygems/invalid_issuer_cert.pem +11 -9
  266. data/test/rubygems/invalid_issuer_cert_32.pem +11 -9
  267. data/test/rubygems/invalid_signer_cert.pem +10 -9
  268. data/test/rubygems/invalid_signer_cert_32.pem +10 -9
  269. data/test/rubygems/invalidchild_cert.pem +11 -9
  270. data/test/rubygems/invalidchild_cert_32.pem +11 -9
  271. data/test/rubygems/public_cert.pem +11 -9
  272. data/test/rubygems/public_cert_32.pem +10 -9
  273. data/test/rubygems/test_bundled_ca.rb +1 -1
  274. data/test/rubygems/test_gem.rb +7 -0
  275. data/test/rubygems/test_gem_installer.rb +119 -0
  276. data/test/rubygems/test_gem_package.rb +9 -3
  277. data/test/rubygems/test_gem_package_tar_writer.rb +24 -0
  278. data/test/rubygems/test_gem_remote_fetcher.rb +0 -12
  279. data/test/rubygems/test_gem_security_signer.rb +8 -0
  280. data/test/rubygems/test_gem_specification.rb +1 -1
  281. data/test/rubygems/wrong_key_cert.pem +10 -9
  282. data/test/rubygems/wrong_key_cert_32.pem +10 -9
  283. data/util/ci +73 -0
  284. data/util/create_certs.rb +64 -49
  285. data/util/update_bundled_ca_certificates.rb +23 -2
  286. metadata +257 -19
  287. data/lib/gauntlet_rubygems.rb +0 -51
  288. data/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRoot.pem +0 -18
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+ module Bundler
3
+ module UI
4
+ class Silent
5
+ def add_color(string, color)
6
+ end
7
+
8
+ def info(message, newline = nil)
9
+ end
10
+
11
+ def confirm(message, newline = nil)
12
+ end
13
+
14
+ def warn(message, newline = nil)
15
+ end
16
+
17
+ def error(message, newline = nil)
18
+ end
19
+
20
+ def debug(message, newline = nil)
21
+ end
22
+
23
+ def debug?
24
+ false
25
+ end
26
+
27
+ def quiet?
28
+ false
29
+ end
30
+
31
+ def ask(message)
32
+ end
33
+
34
+ def level=(name)
35
+ end
36
+
37
+ def level(name = nil)
38
+ end
39
+
40
+ def trace(message, newline = nil)
41
+ end
42
+
43
+ def silence
44
+ yield
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+ module Bundler
3
+ module URICredentialsFilter
4
+ module_function
5
+
6
+ def credential_filtered_uri(uri_to_anonymize)
7
+ return uri_to_anonymize if uri_to_anonymize.nil?
8
+ uri = uri_to_anonymize.dup
9
+ uri = URI(uri.to_s) unless uri.is_a?(URI)
10
+ if uri.userinfo
11
+ # oauth authentication
12
+ if uri.password == "x-oauth-basic" || uri.password == "x"
13
+ # URI as string does not display with password if no user is set
14
+ oauth_designation = uri.password
15
+ uri.user = oauth_designation
16
+ end
17
+ uri.password = nil
18
+ end
19
+ return uri if uri_to_anonymize.is_a?(URI)
20
+ return uri.to_s if uri_to_anonymize.is_a?(String)
21
+ rescue URI::InvalidURIError # uri is not canonical uri scheme
22
+ uri
23
+ end
24
+
25
+ def credential_filtered_string(str_to_filter, uri)
26
+ return str_to_filter if uri.nil? || str_to_filter.nil?
27
+ str_with_no_credentials = str_to_filter.dup
28
+ anonymous_uri_str = credential_filtered_uri(uri).to_s
29
+ uri_str = uri.to_s
30
+ if anonymous_uri_str != uri_str
31
+ str_with_no_credentials = str_with_no_credentials.gsub(uri_str, anonymous_uri_str)
32
+ end
33
+ str_with_no_credentials
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,79 @@
1
+ # frozen_string_literal: true
2
+ require "pathname"
3
+ require "set"
4
+
5
+ class Bundler::CompactIndexClient
6
+ class Error < StandardError; end
7
+
8
+ require "bundler/vendor/compact_index_client/lib/compact_index_client/cache"
9
+ require "bundler/vendor/compact_index_client/lib/compact_index_client/updater"
10
+ require "bundler/vendor/compact_index_client/lib/compact_index_client/version"
11
+
12
+ attr_reader :directory
13
+
14
+ # @return [Lambda] A lambda that takes an array of inputs and a block, and
15
+ # maps the inputs with the block in parallel.
16
+ #
17
+ attr_accessor :in_parallel
18
+
19
+ def initialize(directory, fetcher)
20
+ @directory = Pathname.new(directory)
21
+ @updater = Updater.new(fetcher)
22
+ @cache = Cache.new(@directory)
23
+ @endpoints = Set.new
24
+ @info_checksums_by_name = {}
25
+ @in_parallel = lambda do |inputs, &blk|
26
+ inputs.map(&blk)
27
+ end
28
+ end
29
+
30
+ def names
31
+ update(@cache.names_path, "names")
32
+ @cache.names
33
+ end
34
+
35
+ def versions
36
+ update(@cache.versions_path, "versions")
37
+ versions, @info_checksums_by_name = @cache.versions
38
+ versions
39
+ end
40
+
41
+ def dependencies(names)
42
+ in_parallel.call(names) do |name|
43
+ update_info(name)
44
+ @cache.dependencies(name).map {|d| d.unshift(name) }
45
+ end.flatten(1)
46
+ end
47
+
48
+ def spec(name, version, platform = nil)
49
+ update_info(name)
50
+ @cache.specific_dependency(name, version, platform)
51
+ end
52
+
53
+ def update_and_parse_checksums!
54
+ return @info_checksums_by_name if @parsed_checksums
55
+ update(@cache.versions_path, "versions")
56
+ @info_checksums_by_name = @cache.checksums
57
+ @parsed_checksums = true
58
+ end
59
+
60
+ private
61
+
62
+ def update(local_path, remote_path)
63
+ return if @endpoints.include?(remote_path)
64
+ @updater.update(local_path, url(remote_path))
65
+ @endpoints << remote_path
66
+ end
67
+
68
+ def update_info(name)
69
+ path = @cache.info_path(name)
70
+ checksum = @updater.checksum_for_file(path)
71
+ return unless existing = @info_checksums_by_name[name]
72
+ return if checksum == existing
73
+ update(path, "info/#{name}")
74
+ end
75
+
76
+ def url(path)
77
+ path
78
+ end
79
+ end
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+ class Bundler::CompactIndexClient
3
+ class Cache
4
+ attr_reader :directory
5
+
6
+ def initialize(directory)
7
+ @directory = Pathname.new(directory).expand_path
8
+ FileUtils.mkdir_p info_path(nil)
9
+ end
10
+
11
+ def names
12
+ lines(names_path)
13
+ end
14
+
15
+ def names_path
16
+ directory.join("names")
17
+ end
18
+
19
+ def versions
20
+ versions_by_name = Hash.new {|hash, key| hash[key] = [] }
21
+ info_checksums_by_name = {}
22
+
23
+ lines(versions_path).each do |line|
24
+ name, versions_string, info_checksum = line.split(" ", 3)
25
+ info_checksums_by_name[name] = info_checksum || ""
26
+ versions_string.split(",").each do |version|
27
+ if version.start_with?("-")
28
+ version = version[1..-1].split("-", 2).unshift(name)
29
+ versions_by_name[name].delete(version)
30
+ else
31
+ version = version.split("-", 2).unshift(name)
32
+ versions_by_name[name] << version
33
+ end
34
+ end
35
+ end
36
+
37
+ [versions_by_name, info_checksums_by_name]
38
+ end
39
+
40
+ def versions_path
41
+ directory.join("versions")
42
+ end
43
+
44
+ def checksums
45
+ checksums = {}
46
+
47
+ lines(versions_path).each do |line|
48
+ name, _, checksum = line.split(" ", 3)
49
+ checksums[name] = checksum
50
+ end
51
+
52
+ checksums
53
+ end
54
+
55
+ def dependencies(name)
56
+ lines(info_path(name)).map do |line|
57
+ parse_gem(line)
58
+ end
59
+ end
60
+
61
+ def info_path(name)
62
+ directory.join("info", name.to_s)
63
+ end
64
+
65
+ def specific_dependency(name, version, platform)
66
+ pattern = [version, platform].compact.join("-")
67
+ return nil if pattern.empty?
68
+
69
+ gem_lines = info_path(name).read
70
+ gem_line = gem_lines[/^#{Regexp.escape(pattern)}\b.*/, 0]
71
+ gem_line ? parse_gem(gem_line) : nil
72
+ end
73
+
74
+ private
75
+
76
+ def lines(path)
77
+ return [] unless path.file?
78
+ lines = path.read.split("\n")
79
+ header = lines.index("---")
80
+ lines = header ? lines[header + 1..-1] : lines
81
+ end
82
+
83
+ def parse_gem(string)
84
+ version_and_platform, rest = string.split(" ", 2)
85
+ version, platform = version_and_platform.split("-", 2)
86
+ dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
87
+ dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
88
+ requirements = requirements ? requirements.map {|r| parse_dependency(r) } : []
89
+ [version, platform, dependencies, requirements]
90
+ end
91
+
92
+ def parse_dependency(string)
93
+ dependency = string.split(":")
94
+ dependency[-1] = dependency[-1].split("&") if dependency.size > 1
95
+ dependency
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+ require "fileutils"
3
+ require "stringio"
4
+ require "tmpdir"
5
+ require "zlib"
6
+
7
+ class Bundler::CompactIndexClient
8
+ class Updater
9
+ class MisMatchedChecksumError < Error
10
+ def initialize(path, server_checksum, local_checksum)
11
+ @path = path
12
+ @server_checksum = server_checksum
13
+ @local_checksum = local_checksum
14
+ end
15
+
16
+ def message
17
+ "The checksum of /#{@path} does not match the checksum provided by the server! Something is wrong " \
18
+ "(local checksum is #{@local_checksum.inspect}, was expecting #{@server_checksum.inspect})."
19
+ end
20
+ end
21
+
22
+ def initialize(fetcher)
23
+ @fetcher = fetcher
24
+ end
25
+
26
+ def update(local_path, remote_path, retrying = nil)
27
+ headers = {}
28
+
29
+ Dir.mktmpdir(local_path.basename.to_s, local_path.dirname) do |local_temp_dir|
30
+ local_temp_path = Pathname.new(local_temp_dir).join(local_path.basename)
31
+
32
+ # download new file if retrying
33
+ if retrying.nil? && local_path.file?
34
+ FileUtils.cp local_path, local_temp_path
35
+ headers["If-None-Match"] = etag_for(local_temp_path)
36
+ headers["Range"] = "bytes=#{local_temp_path.size}-"
37
+ else
38
+ # Fastly ignores Range when Accept-Encoding: gzip is set
39
+ headers["Accept-Encoding"] = "gzip"
40
+ end
41
+
42
+ response = @fetcher.call(remote_path, headers)
43
+ return if response.is_a?(Net::HTTPNotModified)
44
+
45
+ content = response.body
46
+ if response["Content-Encoding"] == "gzip"
47
+ content = Zlib::GzipReader.new(StringIO.new(content)).read
48
+ end
49
+
50
+ mode = response.is_a?(Net::HTTPPartialContent) ? "a" : "w"
51
+ local_temp_path.open(mode) {|f| f << content }
52
+
53
+ response_etag = response["ETag"]
54
+ if etag_for(local_temp_path) == response_etag
55
+ FileUtils.mv(local_temp_path, local_path)
56
+ return
57
+ end
58
+
59
+ if retrying.nil?
60
+ update(local_path, remote_path, :retrying)
61
+ else
62
+ raise MisMatchedChecksumError.new(remote_path, response_etag, etag_for(local_temp_path))
63
+ end
64
+ end
65
+ end
66
+
67
+ def etag_for(path)
68
+ sum = checksum_for_file(path)
69
+ sum ? %("#{sum}") : nil
70
+ end
71
+
72
+ def checksum_for_file(path)
73
+ return nil unless path.file?
74
+ # This must use IO.read instead of Digest.file().hexdigest
75
+ # because we need to preserve \n line endings on windows when calculating
76
+ # the checksum
77
+ Digest::MD5.hexdigest(IO.read(path))
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+ class Bundler::CompactIndexClient
3
+ VERSION = "0.1.0".freeze
4
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+ require 'bundler/vendor/molinillo/lib/molinillo/gem_metadata'
3
+ require 'bundler/vendor/molinillo/lib/molinillo/errors'
4
+ require 'bundler/vendor/molinillo/lib/molinillo/resolver'
5
+ require 'bundler/vendor/molinillo/lib/molinillo/modules/ui'
6
+ require 'bundler/vendor/molinillo/lib/molinillo/modules/specification_provider'
7
+
8
+ # Bundler::Molinillo is a generic dependency resolution algorithm.
9
+ module Bundler::Molinillo
10
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+ module Bundler::Molinillo
3
+ # @!visibility private
4
+ module Delegates
5
+ # Delegates all {Bundler::Molinillo::ResolutionState} methods to a `#state` property.
6
+ module ResolutionState
7
+ # (see Bundler::Molinillo::ResolutionState#name)
8
+ def name
9
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
10
+ current_state.name
11
+ end
12
+
13
+ # (see Bundler::Molinillo::ResolutionState#requirements)
14
+ def requirements
15
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
16
+ current_state.requirements
17
+ end
18
+
19
+ # (see Bundler::Molinillo::ResolutionState#activated)
20
+ def activated
21
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
22
+ current_state.activated
23
+ end
24
+
25
+ # (see Bundler::Molinillo::ResolutionState#requirement)
26
+ def requirement
27
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
28
+ current_state.requirement
29
+ end
30
+
31
+ # (see Bundler::Molinillo::ResolutionState#possibilities)
32
+ def possibilities
33
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
34
+ current_state.possibilities
35
+ end
36
+
37
+ # (see Bundler::Molinillo::ResolutionState#depth)
38
+ def depth
39
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
40
+ current_state.depth
41
+ end
42
+
43
+ # (see Bundler::Molinillo::ResolutionState#conflicts)
44
+ def conflicts
45
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
46
+ current_state.conflicts
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+ module Bundler::Molinillo
3
+ module Delegates
4
+ # Delegates all {Bundler::Molinillo::SpecificationProvider} methods to a
5
+ # `#specification_provider` property.
6
+ module SpecificationProvider
7
+ # (see Bundler::Molinillo::SpecificationProvider#search_for)
8
+ def search_for(dependency)
9
+ with_no_such_dependency_error_handling do
10
+ specification_provider.search_for(dependency)
11
+ end
12
+ end
13
+
14
+ # (see Bundler::Molinillo::SpecificationProvider#dependencies_for)
15
+ def dependencies_for(specification)
16
+ with_no_such_dependency_error_handling do
17
+ specification_provider.dependencies_for(specification)
18
+ end
19
+ end
20
+
21
+ # (see Bundler::Molinillo::SpecificationProvider#requirement_satisfied_by?)
22
+ def requirement_satisfied_by?(requirement, activated, spec)
23
+ with_no_such_dependency_error_handling do
24
+ specification_provider.requirement_satisfied_by?(requirement, activated, spec)
25
+ end
26
+ end
27
+
28
+ # (see Bundler::Molinillo::SpecificationProvider#name_for)
29
+ def name_for(dependency)
30
+ with_no_such_dependency_error_handling do
31
+ specification_provider.name_for(dependency)
32
+ end
33
+ end
34
+
35
+ # (see Bundler::Molinillo::SpecificationProvider#name_for_explicit_dependency_source)
36
+ def name_for_explicit_dependency_source
37
+ with_no_such_dependency_error_handling do
38
+ specification_provider.name_for_explicit_dependency_source
39
+ end
40
+ end
41
+
42
+ # (see Bundler::Molinillo::SpecificationProvider#name_for_locking_dependency_source)
43
+ def name_for_locking_dependency_source
44
+ with_no_such_dependency_error_handling do
45
+ specification_provider.name_for_locking_dependency_source
46
+ end
47
+ end
48
+
49
+ # (see Bundler::Molinillo::SpecificationProvider#sort_dependencies)
50
+ def sort_dependencies(dependencies, activated, conflicts)
51
+ with_no_such_dependency_error_handling do
52
+ specification_provider.sort_dependencies(dependencies, activated, conflicts)
53
+ end
54
+ end
55
+
56
+ # (see Bundler::Molinillo::SpecificationProvider#allow_missing?)
57
+ def allow_missing?(dependency)
58
+ with_no_such_dependency_error_handling do
59
+ specification_provider.allow_missing?(dependency)
60
+ end
61
+ end
62
+
63
+ private
64
+
65
+ # Ensures any raised {NoSuchDependencyError} has its
66
+ # {NoSuchDependencyError#required_by} set.
67
+ # @yield
68
+ def with_no_such_dependency_error_handling
69
+ yield
70
+ rescue NoSuchDependencyError => error
71
+ if state
72
+ vertex = activated.vertex_named(name_for(error.dependency))
73
+ error.required_by += vertex.incoming_edges.map { |e| e.origin.name }
74
+ error.required_by << name_for_explicit_dependency_source unless vertex.explicit_requirements.empty?
75
+ end
76
+ raise
77
+ end
78
+ end
79
+ end
80
+ end