rubygems-update 4.0.21 → 4.1.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (496) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +590 -53
  3. data/CONTRIBUTING.md +66 -5
  4. data/MIT.txt +4 -3
  5. data/Manifest.txt +332 -375
  6. data/README.md +26 -6
  7. data/bundler.gemspec +63 -0
  8. data/doc/POLICIES.md +147 -0
  9. data/doc/UPGRADING.md +4 -4
  10. data/{bundler/lib → lib}/bundler/build_metadata.rb +2 -2
  11. data/{bundler/lib → lib}/bundler/checksum.rb +40 -25
  12. data/{bundler/lib → lib}/bundler/ci_detector.rb +1 -1
  13. data/{bundler/lib → lib}/bundler/cli/add.rb +3 -4
  14. data/{bundler/lib → lib}/bundler/cli/cache.rb +4 -0
  15. data/{bundler/lib → lib}/bundler/cli/clean.rb +5 -0
  16. data/{bundler/lib → lib}/bundler/cli/common.rb +37 -1
  17. data/{bundler/lib → lib}/bundler/cli/config.rb +4 -2
  18. data/{bundler/lib → lib}/bundler/cli/gem.rb +0 -17
  19. data/{bundler/lib → lib}/bundler/cli/install.rb +4 -5
  20. data/{bundler/lib → lib}/bundler/cli/lock.rb +1 -2
  21. data/{bundler/lib → lib}/bundler/cli/outdated.rb +8 -3
  22. data/{bundler/lib → lib}/bundler/cli/pristine.rb +2 -1
  23. data/{bundler/lib → lib}/bundler/cli/update.rb +21 -12
  24. data/{bundler/lib → lib}/bundler/cli.rb +14 -11
  25. data/{bundler/lib → lib}/bundler/definition.rb +61 -24
  26. data/{bundler/lib → lib}/bundler/dependency.rb +4 -0
  27. data/{bundler/lib → lib}/bundler/dsl.rb +77 -11
  28. data/{bundler/lib → lib}/bundler/endpoint_specification.rb +51 -14
  29. data/{bundler/lib → lib}/bundler/env.rb +7 -24
  30. data/{bundler/lib → lib}/bundler/errors.rb +34 -5
  31. data/{bundler/lib → lib}/bundler/fetcher/compact_index.rb +14 -5
  32. data/lib/bundler/fetcher/connection_pools.rb +150 -0
  33. data/{bundler/lib → lib}/bundler/fetcher/downloader.rb +31 -16
  34. data/{bundler/lib → lib}/bundler/fetcher.rb +8 -47
  35. data/{bundler/lib → lib}/bundler/injector.rb +3 -3
  36. data/{bundler/lib → lib}/bundler/inline.rb +44 -4
  37. data/{bundler/lib → lib}/bundler/installer/parallel_installer.rb +25 -30
  38. data/{bundler/lib → lib}/bundler/installer.rb +20 -6
  39. data/{bundler/lib → lib}/bundler/lazy_specification.rb +44 -17
  40. data/{bundler/lib → lib}/bundler/lockfile_generator.rb +24 -2
  41. data/{bundler/lib → lib}/bundler/lockfile_parser.rb +43 -5
  42. data/{bundler/lib → lib}/bundler/man/bundle-add.1 +7 -4
  43. data/{bundler/lib → lib}/bundler/man/bundle-add.1.ronn +8 -4
  44. data/{bundler/lib → lib}/bundler/man/bundle-binstubs.1 +1 -1
  45. data/{bundler/lib → lib}/bundler/man/bundle-cache.1 +2 -2
  46. data/{bundler/lib → lib}/bundler/man/bundle-cache.1.ronn +2 -2
  47. data/{bundler/lib → lib}/bundler/man/bundle-check.1 +1 -1
  48. data/{bundler/lib → lib}/bundler/man/bundle-clean.1 +1 -1
  49. data/{bundler/lib → lib}/bundler/man/bundle-config.1 +38 -6
  50. data/{bundler/lib → lib}/bundler/man/bundle-config.1.ronn +143 -10
  51. data/{bundler/lib → lib}/bundler/man/bundle-console.1 +1 -1
  52. data/{bundler/lib → lib}/bundler/man/bundle-doctor.1 +1 -1
  53. data/{bundler/lib → lib}/bundler/man/bundle-env.1 +1 -1
  54. data/{bundler/lib → lib}/bundler/man/bundle-exec.1 +1 -1
  55. data/{bundler/lib → lib}/bundler/man/bundle-fund.1 +1 -1
  56. data/{bundler/lib → lib}/bundler/man/bundle-gem.1 +1 -1
  57. data/{bundler/lib → lib}/bundler/man/bundle-help.1 +1 -1
  58. data/{bundler/lib → lib}/bundler/man/bundle-info.1 +1 -1
  59. data/{bundler/lib → lib}/bundler/man/bundle-init.1 +1 -1
  60. data/{bundler/lib → lib}/bundler/man/bundle-install.1 +2 -2
  61. data/{bundler/lib → lib}/bundler/man/bundle-install.1.ronn +4 -4
  62. data/{bundler/lib → lib}/bundler/man/bundle-issue.1 +1 -1
  63. data/{bundler/lib → lib}/bundler/man/bundle-licenses.1 +1 -1
  64. data/{bundler/lib → lib}/bundler/man/bundle-list.1 +1 -1
  65. data/{bundler/lib → lib}/bundler/man/bundle-lock.1 +3 -3
  66. data/{bundler/lib → lib}/bundler/man/bundle-lock.1.ronn +5 -5
  67. data/{bundler/lib → lib}/bundler/man/bundle-open.1 +1 -1
  68. data/{bundler/lib → lib}/bundler/man/bundle-outdated.1 +1 -1
  69. data/{bundler/lib → lib}/bundler/man/bundle-platform.1 +1 -1
  70. data/{bundler/lib → lib}/bundler/man/bundle-plugin.1 +1 -1
  71. data/{bundler/lib → lib}/bundler/man/bundle-pristine.1 +1 -1
  72. data/{bundler/lib → lib}/bundler/man/bundle-remove.1 +1 -1
  73. data/{bundler/lib → lib}/bundler/man/bundle-show.1 +1 -1
  74. data/{bundler/lib → lib}/bundler/man/bundle-update.1 +3 -3
  75. data/{bundler/lib → lib}/bundler/man/bundle-update.1.ronn +3 -5
  76. data/{bundler/lib → lib}/bundler/man/bundle-version.1 +1 -1
  77. data/{bundler/lib → lib}/bundler/man/bundle.1 +1 -1
  78. data/{bundler/lib → lib}/bundler/man/gemfile.5 +45 -1
  79. data/{bundler/lib → lib}/bundler/man/gemfile.5.ronn +53 -0
  80. data/lib/bundler/match_metadata.rb +50 -0
  81. data/{bundler/lib → lib}/bundler/match_platform.rb +25 -2
  82. data/lib/bundler/match_remote_metadata.rb +44 -0
  83. data/{bundler/lib → lib}/bundler/materialization.rb +2 -1
  84. data/lib/bundler/override.rb +69 -0
  85. data/{bundler/lib → lib}/bundler/plugin/dsl.rb +3 -5
  86. data/{bundler/lib → lib}/bundler/plugin/events.rb +55 -13
  87. data/{bundler/lib → lib}/bundler/plugin/index.rb +87 -11
  88. data/{bundler/lib → lib}/bundler/plugin/installer/path.rb +1 -1
  89. data/{bundler/lib → lib}/bundler/plugin/installer.rb +13 -5
  90. data/{bundler/lib → lib}/bundler/plugin.rb +58 -30
  91. data/{bundler/lib → lib}/bundler/remote_specification.rb +6 -3
  92. data/{bundler/lib → lib}/bundler/resolver/base.rb +2 -1
  93. data/{bundler/lib → lib}/bundler/resolver/incompatibility.rb +1 -1
  94. data/{bundler/lib → lib}/bundler/resolver.rb +73 -23
  95. data/{bundler/lib → lib}/bundler/ruby_version.rb +0 -2
  96. data/{bundler/lib → lib}/bundler/rubygems_ext.rb +71 -1
  97. data/{bundler/lib → lib}/bundler/rubygems_gem_installer.rb +41 -2
  98. data/{bundler/lib → lib}/bundler/rubygems_integration.rb +7 -2
  99. data/{bundler/lib → lib}/bundler/runtime.rb +69 -2
  100. data/{bundler/lib → lib}/bundler/self_manager.rb +9 -15
  101. data/{bundler/lib → lib}/bundler/settings.rb +373 -30
  102. data/{bundler/lib → lib}/bundler/shared_helpers.rb +2 -1
  103. data/{bundler/lib → lib}/bundler/source/git/git_proxy.rb +2 -10
  104. data/{bundler/lib → lib}/bundler/source/git.rb +15 -6
  105. data/{bundler/lib → lib}/bundler/source/path/installer.rb +1 -1
  106. data/{bundler/lib → lib}/bundler/source/rubygems/remote.rb +10 -5
  107. data/{bundler/lib → lib}/bundler/source/rubygems.rb +48 -12
  108. data/{bundler/lib → lib}/bundler/spec_set.rb +16 -4
  109. data/{bundler/lib → lib}/bundler/stub_specification.rb +2 -1
  110. data/{bundler/lib → lib}/bundler/templates/newgem/Gemfile.tt +4 -4
  111. data/{bundler/lib → lib}/bundler/templates/newgem/newgem.gemspec.tt +3 -3
  112. data/{bundler/lib → lib}/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -1
  113. data/{bundler/lib → lib}/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +1 -1
  114. data/{bundler/lib → lib}/bundler/ui/shell.rb +0 -4
  115. data/{bundler/lib → lib}/bundler/ui/silent.rb +0 -4
  116. data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +35 -2
  117. data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/base.rb +2 -1
  118. data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/basic.rb +14 -6
  119. data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/color.rb +2 -0
  120. data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/version.rb +1 -1
  121. data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor.rb +34 -1
  122. data/lib/bundler/vendored_pub_grub.rb +7 -0
  123. data/lib/bundler/vendored_securerandom.rb +15 -0
  124. data/lib/bundler/vendored_uri.rb +21 -0
  125. data/{bundler/lib → lib}/bundler/version.rb +1 -1
  126. data/{bundler/lib → lib}/bundler/worker.rb +3 -2
  127. data/{bundler/lib → lib}/bundler.rb +1 -1
  128. data/lib/rubygems/basic_specification.rb +15 -14
  129. data/lib/rubygems/bundler_settings.rb +137 -0
  130. data/lib/rubygems/bundler_version_finder.rb +13 -55
  131. data/lib/rubygems/ci_detector.rb +1 -1
  132. data/lib/rubygems/commands/build_command.rb +8 -1
  133. data/lib/rubygems/commands/cert_command.rb +9 -7
  134. data/lib/rubygems/commands/contents_command.rb +1 -1
  135. data/lib/rubygems/commands/dependency_command.rb +15 -3
  136. data/lib/rubygems/commands/environment_command.rb +1 -0
  137. data/lib/rubygems/commands/exec_command.rb +3 -0
  138. data/lib/rubygems/commands/fetch_command.rb +1 -1
  139. data/lib/rubygems/commands/help_command.rb +3 -1
  140. data/lib/rubygems/commands/install_command.rb +13 -3
  141. data/lib/rubygems/commands/lock_command.rb +2 -2
  142. data/lib/rubygems/commands/outdated_command.rb +77 -2
  143. data/lib/rubygems/commands/owner_command.rb +1 -1
  144. data/lib/rubygems/commands/push_command.rb +159 -21
  145. data/lib/rubygems/commands/setup_command.rb +20 -23
  146. data/lib/rubygems/commands/signin_command.rb +3 -1
  147. data/lib/rubygems/commands/signout_command.rb +26 -6
  148. data/lib/rubygems/commands/specification_command.rb +1 -1
  149. data/lib/rubygems/commands/uninstall_command.rb +1 -1
  150. data/lib/rubygems/commands/update_command.rb +84 -2
  151. data/lib/rubygems/commands/yank_command.rb +10 -7
  152. data/lib/rubygems/compact_index_client/cache.rb +122 -0
  153. data/lib/rubygems/compact_index_client/cache_file.rb +147 -0
  154. data/lib/rubygems/compact_index_client/http_fetcher.rb +88 -0
  155. data/lib/rubygems/compact_index_client/parser.rb +90 -0
  156. data/lib/rubygems/compact_index_client/updater.rb +113 -0
  157. data/lib/rubygems/compact_index_client.rb +111 -0
  158. data/lib/rubygems/config_file.rb +304 -22
  159. data/lib/rubygems/content_address.rb +194 -0
  160. data/lib/rubygems/cooldown.rb +173 -0
  161. data/lib/rubygems/cooldown_option.rb +27 -0
  162. data/lib/rubygems/cooldown_settings.rb +57 -0
  163. data/lib/rubygems/credential_store/native/linux.rb +97 -0
  164. data/lib/rubygems/credential_store/native/macos.rb +88 -0
  165. data/lib/rubygems/credential_store/native/windows.rb +130 -0
  166. data/lib/rubygems/credential_store.rb +332 -0
  167. data/lib/rubygems/defaults.rb +9 -0
  168. data/lib/rubygems/dependency_installer.rb +15 -0
  169. data/lib/rubygems/doctor.rb +23 -6
  170. data/lib/rubygems/exceptions.rb +11 -43
  171. data/lib/rubygems/ext/builder.rb +70 -5
  172. data/lib/rubygems/ext/cargo_builder.rb +0 -9
  173. data/lib/rubygems/ext/ext_conf_builder.rb +8 -15
  174. data/lib/rubygems/gemcutter_utilities.rb +44 -2
  175. data/lib/rubygems/install_update_options.rb +16 -0
  176. data/lib/rubygems/installer.rb +90 -11
  177. data/lib/rubygems/installer_uninstaller_utils.rb +24 -3
  178. data/lib/rubygems/name_tuple.rb +55 -18
  179. data/lib/rubygems/package/old.rb +1 -1
  180. data/lib/rubygems/package.rb +200 -47
  181. data/lib/rubygems/package_task.rb +2 -2
  182. data/lib/rubygems/platform.rb +2 -2
  183. data/lib/rubygems/query_utils.rb +84 -24
  184. data/lib/rubygems/remote_fetcher.rb +65 -17
  185. data/lib/rubygems/request/connection_pools.rb +3 -0
  186. data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
  187. data/lib/rubygems/request_set/lockfile.rb +0 -2
  188. data/lib/rubygems/request_set.rb +105 -17
  189. data/lib/rubygems/resolver/api_set.rb +14 -26
  190. data/lib/rubygems/resolver/api_specification.rb +56 -15
  191. data/lib/rubygems/resolver/incompatibility.rb +10 -0
  192. data/lib/rubygems/resolver/index_specification.rb +6 -4
  193. data/lib/rubygems/resolver/installer_set.rb +2 -2
  194. data/lib/rubygems/resolver/lock_specification.rb +5 -1
  195. data/lib/rubygems/resolver/spec_specification.rb +4 -0
  196. data/lib/rubygems/resolver/specification.rb +16 -1
  197. data/lib/rubygems/resolver/strategy.rb +44 -0
  198. data/lib/rubygems/resolver.rb +471 -145
  199. data/lib/rubygems/safe_marshal.rb +2 -1
  200. data/lib/rubygems/safe_yaml.rb +20 -3
  201. data/lib/rubygems/security/policy.rb +11 -3
  202. data/lib/rubygems/security/signer.rb +15 -7
  203. data/lib/rubygems/security.rb +111 -17
  204. data/lib/rubygems/source/local.rb +7 -2
  205. data/lib/rubygems/source.rb +270 -23
  206. data/lib/rubygems/spec_fetcher.rb +47 -12
  207. data/lib/rubygems/specification.rb +76 -32
  208. data/lib/rubygems/specification_policy.rb +33 -6
  209. data/lib/rubygems/specification_record.rb +41 -2
  210. data/lib/rubygems/stub_specification.rb +39 -16
  211. data/lib/rubygems/uninstaller.rb +2 -0
  212. data/lib/rubygems/util/atomic_file_writer.rb +109 -0
  213. data/lib/rubygems/vendor/net-http/lib/net/http/exceptions.rb +2 -1
  214. data/lib/rubygems/vendor/net-http/lib/net/http/generic_request.rb +5 -6
  215. data/lib/rubygems/vendor/net-http/lib/net/http/header.rb +8 -4
  216. data/lib/rubygems/vendor/net-http/lib/net/http/requests.rb +15 -1
  217. data/lib/rubygems/vendor/net-http/lib/net/http/response.rb +2 -1
  218. data/lib/rubygems/vendor/net-http/lib/net/http/responses.rb +68 -0
  219. data/lib/rubygems/vendor/net-http/lib/net/http.rb +60 -49
  220. data/lib/rubygems/vendor/optparse/lib/optparse.rb +23 -30
  221. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/assignment.rb +1 -1
  222. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +7 -7
  223. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/failure_writer.rb +1 -1
  224. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/incompatibility.rb +4 -4
  225. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/package.rb +1 -1
  226. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/partial_solution.rb +1 -1
  227. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/rubygems.rb +3 -3
  228. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/solve_failure.rb +1 -1
  229. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/static_package_source.rb +3 -3
  230. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/strategy.rb +2 -2
  231. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/term.rb +1 -1
  232. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/version.rb +1 -1
  233. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/version_constraint.rb +3 -3
  234. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/version_range.rb +1 -1
  235. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/version_solver.rb +2 -2
  236. data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/lib/pub_grub/version_union.rb +1 -1
  237. data/lib/rubygems/vendor/pub_grub/lib/pub_grub.rb +57 -0
  238. data/lib/rubygems/vendor/resolv/lib/resolv.rb +3508 -0
  239. data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +4 -0
  240. data/lib/rubygems/vendor/timeout/lib/timeout.rb +190 -77
  241. data/lib/rubygems/vendor/uri/lib/uri.rb +4 -0
  242. data/{bundler/lib/bundler → lib/rubygems}/vendored_pub_grub.rb +0 -1
  243. data/lib/rubygems/version.rb +129 -111
  244. data/lib/rubygems/version_option.rb +14 -0
  245. data/lib/rubygems/yaml_serializer.rb +853 -71
  246. data/lib/rubygems.rb +45 -11
  247. data/rubygems-update.gemspec +3 -4
  248. data/setup.rb +1 -0
  249. metadata +365 -410
  250. data/bundler/CHANGELOG.md +0 -5784
  251. data/bundler/LICENSE.md +0 -22
  252. data/bundler/README.md +0 -58
  253. data/bundler/bundler.gemspec +0 -46
  254. data/bundler/lib/bundler/compact_index_client/cache.rb +0 -107
  255. data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -148
  256. data/bundler/lib/bundler/compact_index_client/parser.rb +0 -87
  257. data/bundler/lib/bundler/compact_index_client/updater.rb +0 -105
  258. data/bundler/lib/bundler/compact_index_client.rb +0 -92
  259. data/bundler/lib/bundler/match_metadata.rb +0 -30
  260. data/bundler/lib/bundler/match_remote_metadata.rb +0 -29
  261. data/bundler/lib/bundler/vendor/connection_pool/LICENSE +0 -20
  262. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +0 -227
  263. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +0 -3
  264. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +0 -56
  265. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +0 -230
  266. data/bundler/lib/bundler/vendor/net-http-persistent/README.rdoc +0 -82
  267. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +0 -41
  268. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +0 -65
  269. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +0 -80
  270. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +0 -1153
  271. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +0 -31
  272. data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +0 -102
  273. data/bundler/lib/bundler/vendor/uri/COPYING +0 -56
  274. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +0 -922
  275. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +0 -100
  276. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -267
  277. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +0 -1592
  278. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +0 -137
  279. data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +0 -23
  280. data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +0 -261
  281. data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +0 -22
  282. data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -293
  283. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +0 -547
  284. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +0 -206
  285. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +0 -6
  286. data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +0 -83
  287. data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +0 -23
  288. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +0 -104
  289. data/bundler/lib/bundler/vendored_persistent.rb +0 -11
  290. data/bundler/lib/bundler/vendored_securerandom.rb +0 -12
  291. data/bundler/lib/bundler/vendored_uri.rb +0 -21
  292. data/bundler/lib/bundler/yaml_serializer.rb +0 -98
  293. data/doc/rubygems/CONTRIBUTING.md +0 -231
  294. data/doc/rubygems/POLICIES.md +0 -60
  295. data/lib/rubygems/request_set/lockfile/parser.rb +0 -344
  296. data/lib/rubygems/request_set/lockfile/tokenizer.rb +0 -122
  297. data/lib/rubygems/resolver/conflict.rb +0 -146
  298. data/lib/rubygems/resolver/stats.rb +0 -46
  299. data/lib/rubygems/util/list.rb +0 -40
  300. data/lib/rubygems/vendor/molinillo/LICENSE +0 -9
  301. data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +0 -57
  302. data/lib/rubygems/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +0 -88
  303. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +0 -36
  304. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +0 -66
  305. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +0 -62
  306. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +0 -63
  307. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +0 -61
  308. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +0 -126
  309. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +0 -46
  310. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +0 -36
  311. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +0 -164
  312. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -255
  313. data/lib/rubygems/vendor/molinillo/lib/molinillo/errors.rb +0 -149
  314. data/lib/rubygems/vendor/molinillo/lib/molinillo/gem_metadata.rb +0 -6
  315. data/lib/rubygems/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +0 -112
  316. data/lib/rubygems/vendor/molinillo/lib/molinillo/modules/ui.rb +0 -67
  317. data/lib/rubygems/vendor/molinillo/lib/molinillo/resolution.rb +0 -839
  318. data/lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb +0 -46
  319. data/lib/rubygems/vendor/molinillo/lib/molinillo/state.rb +0 -58
  320. data/lib/rubygems/vendor/molinillo/lib/molinillo.rb +0 -11
  321. data/lib/rubygems/vendored_molinillo.rb +0 -3
  322. /data/{bundler/exe → exe}/bundle +0 -0
  323. /data/{bundler/exe → exe}/bundler +0 -0
  324. /data/{bundler/lib → lib}/bundler/.document +0 -0
  325. /data/{bundler/lib → lib}/bundler/capistrano.rb +0 -0
  326. /data/{bundler/lib → lib}/bundler/cli/binstubs.rb +0 -0
  327. /data/{bundler/lib → lib}/bundler/cli/check.rb +0 -0
  328. /data/{bundler/lib → lib}/bundler/cli/console.rb +0 -0
  329. /data/{bundler/lib → lib}/bundler/cli/doctor/diagnose.rb +0 -0
  330. /data/{bundler/lib → lib}/bundler/cli/doctor/ssl.rb +0 -0
  331. /data/{bundler/lib → lib}/bundler/cli/doctor.rb +0 -0
  332. /data/{bundler/lib → lib}/bundler/cli/exec.rb +0 -0
  333. /data/{bundler/lib → lib}/bundler/cli/fund.rb +0 -0
  334. /data/{bundler/lib → lib}/bundler/cli/info.rb +0 -0
  335. /data/{bundler/lib → lib}/bundler/cli/init.rb +0 -0
  336. /data/{bundler/lib → lib}/bundler/cli/issue.rb +0 -0
  337. /data/{bundler/lib → lib}/bundler/cli/list.rb +0 -0
  338. /data/{bundler/lib → lib}/bundler/cli/open.rb +0 -0
  339. /data/{bundler/lib → lib}/bundler/cli/platform.rb +0 -0
  340. /data/{bundler/lib → lib}/bundler/cli/plugin.rb +0 -0
  341. /data/{bundler/lib → lib}/bundler/cli/remove.rb +0 -0
  342. /data/{bundler/lib → lib}/bundler/cli/show.rb +0 -0
  343. /data/{bundler/lib → lib}/bundler/constants.rb +0 -0
  344. /data/{bundler/lib → lib}/bundler/current_ruby.rb +0 -0
  345. /data/{bundler/lib → lib}/bundler/deployment.rb +0 -0
  346. /data/{bundler/lib → lib}/bundler/deprecate.rb +0 -0
  347. /data/{bundler/lib → lib}/bundler/digest.rb +0 -0
  348. /data/{bundler/lib → lib}/bundler/environment_preserver.rb +0 -0
  349. /data/{bundler/lib → lib}/bundler/feature_flag.rb +0 -0
  350. /data/{bundler/lib → lib}/bundler/fetcher/base.rb +0 -0
  351. /data/{bundler/lib → lib}/bundler/fetcher/dependency.rb +0 -0
  352. /data/{bundler/lib → lib}/bundler/fetcher/gem_remote_fetcher.rb +0 -0
  353. /data/{bundler/lib → lib}/bundler/fetcher/index.rb +0 -0
  354. /data/{bundler/lib → lib}/bundler/force_platform.rb +0 -0
  355. /data/{bundler/lib → lib}/bundler/friendly_errors.rb +0 -0
  356. /data/{bundler/lib → lib}/bundler/gem_helper.rb +0 -0
  357. /data/{bundler/lib → lib}/bundler/gem_tasks.rb +0 -0
  358. /data/{bundler/lib → lib}/bundler/gem_version_promoter.rb +0 -0
  359. /data/{bundler/lib → lib}/bundler/index.rb +0 -0
  360. /data/{bundler/lib → lib}/bundler/installer/gem_installer.rb +0 -0
  361. /data/{bundler/lib → lib}/bundler/installer/standalone.rb +0 -0
  362. /data/{bundler/lib → lib}/bundler/man/.document +0 -0
  363. /data/{bundler/lib → lib}/bundler/man/bundle-binstubs.1.ronn +0 -0
  364. /data/{bundler/lib → lib}/bundler/man/bundle-check.1.ronn +0 -0
  365. /data/{bundler/lib → lib}/bundler/man/bundle-clean.1.ronn +0 -0
  366. /data/{bundler/lib → lib}/bundler/man/bundle-console.1.ronn +0 -0
  367. /data/{bundler/lib → lib}/bundler/man/bundle-doctor.1.ronn +0 -0
  368. /data/{bundler/lib → lib}/bundler/man/bundle-env.1.ronn +0 -0
  369. /data/{bundler/lib → lib}/bundler/man/bundle-exec.1.ronn +0 -0
  370. /data/{bundler/lib → lib}/bundler/man/bundle-fund.1.ronn +0 -0
  371. /data/{bundler/lib → lib}/bundler/man/bundle-gem.1.ronn +0 -0
  372. /data/{bundler/lib → lib}/bundler/man/bundle-help.1.ronn +0 -0
  373. /data/{bundler/lib → lib}/bundler/man/bundle-info.1.ronn +0 -0
  374. /data/{bundler/lib → lib}/bundler/man/bundle-init.1.ronn +0 -0
  375. /data/{bundler/lib → lib}/bundler/man/bundle-issue.1.ronn +0 -0
  376. /data/{bundler/lib → lib}/bundler/man/bundle-licenses.1.ronn +0 -0
  377. /data/{bundler/lib → lib}/bundler/man/bundle-list.1.ronn +0 -0
  378. /data/{bundler/lib → lib}/bundler/man/bundle-open.1.ronn +0 -0
  379. /data/{bundler/lib → lib}/bundler/man/bundle-outdated.1.ronn +0 -0
  380. /data/{bundler/lib → lib}/bundler/man/bundle-platform.1.ronn +0 -0
  381. /data/{bundler/lib → lib}/bundler/man/bundle-plugin.1.ronn +0 -0
  382. /data/{bundler/lib → lib}/bundler/man/bundle-pristine.1.ronn +0 -0
  383. /data/{bundler/lib → lib}/bundler/man/bundle-remove.1.ronn +0 -0
  384. /data/{bundler/lib → lib}/bundler/man/bundle-show.1.ronn +0 -0
  385. /data/{bundler/lib → lib}/bundler/man/bundle-version.1.ronn +0 -0
  386. /data/{bundler/lib → lib}/bundler/man/bundle.1.ronn +0 -0
  387. /data/{bundler/lib → lib}/bundler/man/index.txt +0 -0
  388. /data/{bundler/lib → lib}/bundler/mirror.rb +0 -0
  389. /data/{bundler/lib → lib}/bundler/plugin/api/source.rb +0 -0
  390. /data/{bundler/lib → lib}/bundler/plugin/api.rb +0 -0
  391. /data/{bundler/lib → lib}/bundler/plugin/installer/git.rb +0 -0
  392. /data/{bundler/lib → lib}/bundler/plugin/installer/rubygems.rb +0 -0
  393. /data/{bundler/lib → lib}/bundler/plugin/source_list.rb +0 -0
  394. /data/{bundler/lib → lib}/bundler/plugin/unloaded_source.rb +0 -0
  395. /data/{bundler/lib → lib}/bundler/process_lock.rb +0 -0
  396. /data/{bundler/lib → lib}/bundler/resolver/candidate.rb +0 -0
  397. /data/{bundler/lib → lib}/bundler/resolver/package.rb +0 -0
  398. /data/{bundler/lib → lib}/bundler/resolver/root.rb +0 -0
  399. /data/{bundler/lib → lib}/bundler/resolver/spec_group.rb +0 -0
  400. /data/{bundler/lib → lib}/bundler/resolver/strategy.rb +0 -0
  401. /data/{bundler/lib → lib}/bundler/retry.rb +0 -0
  402. /data/{bundler/lib → lib}/bundler/ruby_dsl.rb +0 -0
  403. /data/{bundler/lib → lib}/bundler/safe_marshal.rb +0 -0
  404. /data/{bundler/lib → lib}/bundler/settings/validator.rb +0 -0
  405. /data/{bundler/lib → lib}/bundler/setup.rb +0 -0
  406. /data/{bundler/lib → lib}/bundler/source/gemspec.rb +0 -0
  407. /data/{bundler/lib → lib}/bundler/source/metadata.rb +0 -0
  408. /data/{bundler/lib → lib}/bundler/source/path.rb +0 -0
  409. /data/{bundler/lib → lib}/bundler/source/rubygems_aggregate.rb +0 -0
  410. /data/{bundler/lib → lib}/bundler/source.rb +0 -0
  411. /data/{bundler/lib → lib}/bundler/source_list.rb +0 -0
  412. /data/{bundler/lib → lib}/bundler/source_map.rb +0 -0
  413. /data/{bundler/lib → lib}/bundler/templates/.document +0 -0
  414. /data/{bundler/lib → lib}/bundler/templates/Executable +0 -0
  415. /data/{bundler/lib → lib}/bundler/templates/Executable.standalone +0 -0
  416. /data/{bundler/lib → lib}/bundler/templates/Gemfile +0 -0
  417. /data/{bundler/lib → lib}/bundler/templates/newgem/CHANGELOG.md.tt +0 -0
  418. /data/{bundler/lib → lib}/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +0 -0
  419. /data/{bundler/lib → lib}/bundler/templates/newgem/Cargo.toml.tt +0 -0
  420. /data/{bundler/lib → lib}/bundler/templates/newgem/LICENSE.txt.tt +0 -0
  421. /data/{bundler/lib → lib}/bundler/templates/newgem/README.md.tt +0 -0
  422. /data/{bundler/lib → lib}/bundler/templates/newgem/Rakefile.tt +0 -0
  423. /data/{bundler/lib → lib}/bundler/templates/newgem/bin/console.tt +0 -0
  424. /data/{bundler/lib → lib}/bundler/templates/newgem/bin/setup.tt +0 -0
  425. /data/{bundler/lib → lib}/bundler/templates/newgem/circleci/config.yml.tt +0 -0
  426. /data/{bundler/lib → lib}/bundler/templates/newgem/exe/newgem.tt +0 -0
  427. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +0 -0
  428. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/build.rs.tt +0 -0
  429. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +0 -0
  430. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +0 -0
  431. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +0 -0
  432. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/go.mod.tt +0 -0
  433. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +0 -0
  434. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/newgem.c.tt +0 -0
  435. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/newgem.go.tt +0 -0
  436. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/newgem.h.tt +0 -0
  437. /data/{bundler/lib → lib}/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +0 -0
  438. /data/{bundler/lib → lib}/bundler/templates/newgem/github/workflows/build-gems.yml.tt +0 -0
  439. /data/{bundler/lib → lib}/bundler/templates/newgem/github/workflows/main.yml.tt +0 -0
  440. /data/{bundler/lib → lib}/bundler/templates/newgem/gitignore.tt +0 -0
  441. /data/{bundler/lib → lib}/bundler/templates/newgem/gitlab-ci.yml.tt +0 -0
  442. /data/{bundler/lib → lib}/bundler/templates/newgem/lib/newgem/version.rb.tt +0 -0
  443. /data/{bundler/lib → lib}/bundler/templates/newgem/lib/newgem.rb.tt +0 -0
  444. /data/{bundler/lib → lib}/bundler/templates/newgem/rspec.tt +0 -0
  445. /data/{bundler/lib → lib}/bundler/templates/newgem/rubocop.yml.tt +0 -0
  446. /data/{bundler/lib → lib}/bundler/templates/newgem/sig/newgem.rbs.tt +0 -0
  447. /data/{bundler/lib → lib}/bundler/templates/newgem/spec/spec_helper.rb.tt +0 -0
  448. /data/{bundler/lib → lib}/bundler/templates/newgem/standard.yml.tt +0 -0
  449. /data/{bundler/lib → lib}/bundler/templates/newgem/test/minitest/test_helper.rb.tt +0 -0
  450. /data/{bundler/lib → lib}/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +0 -0
  451. /data/{bundler/lib → lib}/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +0 -0
  452. /data/{bundler/lib → lib}/bundler/ui/rg_proxy.rb +0 -0
  453. /data/{bundler/lib → lib}/bundler/ui.rb +0 -0
  454. /data/{bundler/lib → lib}/bundler/uri_credentials_filter.rb +0 -0
  455. /data/{bundler/lib → lib}/bundler/uri_normalizer.rb +0 -0
  456. /data/{bundler/lib → lib}/bundler/vendor/.document +0 -0
  457. /data/{bundler/lib → lib}/bundler/vendor/fileutils/COPYING +0 -0
  458. /data/{bundler/lib → lib}/bundler/vendor/fileutils/lib/fileutils.rb +0 -0
  459. /data/{bundler/lib → lib}/bundler/vendor/thor/LICENSE.md +0 -0
  460. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/create_file.rb +0 -0
  461. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/create_link.rb +0 -0
  462. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/directory.rb +0 -0
  463. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +0 -0
  464. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +0 -0
  465. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/actions.rb +0 -0
  466. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/command.rb +0 -0
  467. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +0 -0
  468. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/error.rb +0 -0
  469. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/group.rb +0 -0
  470. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/invocation.rb +0 -0
  471. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/line_editor/basic.rb +0 -0
  472. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/line_editor/readline.rb +0 -0
  473. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/line_editor.rb +0 -0
  474. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/nested_context.rb +0 -0
  475. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/parser/argument.rb +0 -0
  476. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/parser/arguments.rb +0 -0
  477. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/parser/option.rb +0 -0
  478. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/parser/options.rb +0 -0
  479. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/parser.rb +0 -0
  480. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/rake_compat.rb +0 -0
  481. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/runner.rb +0 -0
  482. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/column_printer.rb +0 -0
  483. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/html.rb +0 -0
  484. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/table_printer.rb +0 -0
  485. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/terminal.rb +0 -0
  486. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +0 -0
  487. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/shell.rb +0 -0
  488. /data/{bundler/lib → lib}/bundler/vendor/thor/lib/thor/util.rb +0 -0
  489. /data/{bundler/lib → lib}/bundler/vendored_fileutils.rb +0 -0
  490. /data/{bundler/lib → lib}/bundler/vendored_net_http.rb +0 -0
  491. /data/{bundler/lib → lib}/bundler/vendored_thor.rb +0 -0
  492. /data/{bundler/lib → lib}/bundler/vendored_timeout.rb +0 -0
  493. /data/{bundler/lib → lib}/bundler/vendored_tsort.rb +0 -0
  494. /data/{bundler/lib → lib}/bundler/vlad.rb +0 -0
  495. /data/{bundler/lib/bundler → lib/rubygems}/vendor/pub_grub/LICENSE.txt +0 -0
  496. /data/{bundler/lib/bundler/vendor/securerandom → lib/rubygems/vendor/resolv}/COPYING +0 -0
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "text"
4
+ require_relative "cooldown"
4
5
  ##
5
6
  # A Source knows how to list and fetch gems from a RubyGems marshal index.
6
7
  #
@@ -17,6 +18,24 @@ class Gem::Source
17
18
  prerelease: "prerelease_specs",
18
19
  }.freeze
19
20
 
21
+ ##
22
+ # Decoded compact index metadata for one content-addressable gem build:
23
+ # its +version+, content-address +suffix+, +ruby_abi+, and +platform+.
24
+ # Two infos are equal when their version and suffix match.
25
+
26
+ ContentAddressableInfo = Struct.new(:version, :suffix, :ruby_abi, :platform) do
27
+ def hash
28
+ [version, suffix].hash
29
+ end
30
+
31
+ def eql?(other)
32
+ other.is_a?(self.class) &&
33
+ version == other.version &&
34
+ suffix == other.suffix
35
+ end
36
+ alias_method :==, :eql?
37
+ end
38
+
20
39
  ##
21
40
  # The URI this source will fetch gems from.
22
41
 
@@ -162,8 +181,134 @@ class Gem::Source
162
181
  # :latest => Return the list of only the highest version of each gem
163
182
  # :prerelease => Return the list of all prerelease only specs
164
183
  #
184
+ # The compact index is used when the source provides it, falling back
185
+ # to the Marshal spec indexes.
165
186
 
166
187
  def load_specs(type)
188
+ load_compact_index_specs(type) || load_marshal_specs(type)
189
+ end
190
+
191
+ ##
192
+ # The compact index client for this source, caching under
193
+ # Gem.spec_cache_dir. Also used by Gem::Resolver::APISet.
194
+
195
+ def compact_index_client # :nodoc:
196
+ @compact_index_client ||= begin
197
+ require_relative "compact_index_client"
198
+
199
+ index_uri = compact_index_uri
200
+
201
+ Gem::CompactIndexClient.new(compact_index_cache_dir(index_uri),
202
+ Gem::CompactIndexClient::HTTPFetcher.new(index_uri))
203
+ end
204
+ end
205
+
206
+ ##
207
+ # Decodes content-addressable +tuples+ (whose platform field holds the
208
+ # content address) into tuples carrying their real platform and Ruby ABI
209
+ # from the compact index /info metadata.
210
+
211
+ def decode_content_addressable_tuples(tuples, latest: false)
212
+ ca_tuples = tuples.select(&:content_address)
213
+ return tuples if ca_tuples.empty?
214
+
215
+ decoded_tuples = ca_tuples.group_by(&:name).flat_map do |name, name_tuples|
216
+ rows = name_tuples.map do |tuple|
217
+ [tuple.name, tuple.version, tuple.version.to_s, tuple.content_address]
218
+ end
219
+
220
+ content_addressable_tuples(name, rows)
221
+ end
222
+
223
+ decoded_by_key = decoded_tuples.to_h do |tuple|
224
+ [[tuple.name, tuple.version, tuple.content_address], tuple]
225
+ end
226
+
227
+ decoded = tuples.filter_map do |tuple|
228
+ if tuple.content_address
229
+ decoded_by_key[[tuple.name, tuple.version, tuple.content_address]]
230
+ else
231
+ tuple
232
+ end
233
+ end
234
+
235
+ return decoded unless latest
236
+
237
+ decoded.group_by(&:name).flat_map do |_, name_tuples|
238
+ max_versions_by_platform(name_tuples)
239
+ end
240
+ end
241
+
242
+ ##
243
+ # The publish time of gem +name+ at +version+ for +suffix+, when this
244
+ # source provides it through the compact index created_at metadata.
245
+ # Returns nil when the source, the gem or the version has no known
246
+ # publish time.
247
+
248
+ def created_at(name, version, suffix = Gem::Platform::RUBY)
249
+ return unless %w[http https].include?(uri.scheme)
250
+
251
+ @created_at_info ||= {}
252
+ info = @created_at_info[name] ||= begin
253
+ compact_index_client.fetch_info(name)
254
+ rescue Gem::RemoteFetcher::FetchError, Gem::CompactIndexClient::Error
255
+ []
256
+ end
257
+
258
+ suffix = (suffix || Gem::Platform::RUBY).to_s
259
+ version = version.to_s
260
+
261
+ row = info.find do |row_info|
262
+ row_info[Gem::CompactIndexClient::INFO_VERSION] == version &&
263
+ (row_info[Gem::CompactIndexClient::INFO_SUFFIX] || Gem::Platform::RUBY) == suffix
264
+ end
265
+ return unless row
266
+
267
+ value = row[Gem::CompactIndexClient::INFO_REQS].assoc("created_at")&.last&.first
268
+
269
+ Gem::Cooldown.parse_created_at(value)
270
+ end
271
+
272
+ ##
273
+ # The publish time for +tuple+. Content-addressable tuples are looked up by
274
+ # content address; all other tuples are looked up by platform.
275
+
276
+ def created_at_for_tuple(tuple)
277
+ created_at(tuple.name, tuple.version, tuple.content_address || tuple.platform)
278
+ end
279
+
280
+ ##
281
+ # Downloads +spec+ and writes it to +dir+. See also
282
+ # Gem::RemoteFetcher#download.
283
+
284
+ def download(spec, dir = Dir.pwd)
285
+ fetcher = Gem::RemoteFetcher.fetcher
286
+ fetcher.download spec, uri.to_s, dir
287
+ end
288
+
289
+ def pretty_print(q) # :nodoc:
290
+ q.object_group(self) do
291
+ q.group 2, "[Remote:", "]" do
292
+ q.breakable
293
+ q.text @uri.to_s
294
+
295
+ if api = uri
296
+ q.breakable
297
+ q.text "API URI: "
298
+ q.text api.to_s
299
+ end
300
+ end
301
+ end
302
+ end
303
+
304
+ def typo_squatting?(host, distance_threshold = 4)
305
+ return if @uri.host.nil?
306
+ levenshtein_distance(@uri.host, host).between? 1, distance_threshold
307
+ end
308
+
309
+ private
310
+
311
+ def load_marshal_specs(type)
167
312
  file = FILES[type]
168
313
  fetcher = Gem::RemoteFetcher.fetcher
169
314
  file_name = "#{file}.#{Gem.marshal_version}"
@@ -194,48 +339,150 @@ class Gem::Source
194
339
  end
195
340
 
196
341
  ##
197
- # Downloads +spec+ and writes it to +dir+. See also
198
- # Gem::RemoteFetcher#download.
342
+ # Builds the name tuple list for +type+ from the compact index versions
343
+ # file. Returns nil when the source does not provide a usable compact
344
+ # index, so the caller can fall back to the Marshal spec indexes.
199
345
 
200
- def download(spec, dir = Dir.pwd)
201
- fetcher = Gem::RemoteFetcher.fetcher
202
- fetcher.download spec, uri.to_s, dir
346
+ def load_compact_index_specs(type)
347
+ return unless %w[http https].include?(uri.scheme)
348
+
349
+ versions = compact_index_versions
350
+ return if versions.nil? || versions.empty?
351
+
352
+ tuples = []
353
+
354
+ versions.each_value do |rows|
355
+ gem_tuples = rows.filter_map do |row_name, version_string, suffix|
356
+ next unless Gem::Version.correct?(version_string)
357
+
358
+ version = Gem::Version.new(version_string)
359
+ next if version.prerelease? != (type == :prerelease)
360
+
361
+ suffix ||= "ruby"
362
+ content_address = suffix if Gem::ContentAddress.match?(suffix)
363
+
364
+ Gem::NameTuple.new(row_name, version, suffix, content_address: content_address)
365
+ end
366
+
367
+ gem_tuples = max_versions_by_platform(gem_tuples) if type == :latest
368
+
369
+ tuples.concat(gem_tuples)
370
+ end
371
+
372
+ tuples
203
373
  end
204
374
 
205
- def pretty_print(q) # :nodoc:
206
- q.object_group(self) do
207
- q.group 2, "[Remote:", "]" do
208
- q.breakable
209
- q.text @uri.to_s
375
+ def compact_index_versions
376
+ @compact_index_versions ||= compact_index_client.versions
377
+ rescue Gem::RemoteFetcher::FetchError, Gem::CompactIndexClient::Error
378
+ @compact_index_versions = {}
379
+ nil
380
+ end
210
381
 
211
- if api = uri
212
- q.breakable
213
- q.text "API URI: "
214
- q.text api.to_s
215
- end
382
+ def compact_index_info_rows(name)
383
+ compact_index_client.info(name)
384
+ rescue Gem::RemoteFetcher::FetchError, Gem::CompactIndexClient::Error
385
+ []
386
+ end
387
+
388
+ def content_addressable_tuples(name, rows)
389
+ metadata = content_addressable_metadata(name, rows)
390
+
391
+ rows.filter_map do |row_name, version, version_string, suffix|
392
+ row_metadata = metadata.find do |entry|
393
+ entry.version == version_string && entry.suffix == suffix
216
394
  end
395
+ next unless row_metadata
396
+
397
+ Gem::NameTuple.new(
398
+ row_name,
399
+ version,
400
+ row_metadata.platform,
401
+ content_address: suffix,
402
+ ruby_abi: row_metadata.ruby_abi
403
+ )
217
404
  end
218
405
  end
219
406
 
220
- def typo_squatting?(host, distance_threshold = 4)
221
- return if @uri.host.nil?
222
- levenshtein_distance(@uri.host, host).between? 1, distance_threshold
407
+ def content_addressable_metadata(name, rows)
408
+ wanted_rows = rows.map do |row|
409
+ ContentAddressableInfo.new(row[2], row[3], nil, nil)
410
+ end
411
+
412
+ available_rows = compact_index_info_rows(name).filter_map do |info_row|
413
+ version = info_row[Gem::CompactIndexClient::INFO_VERSION]
414
+ suffix = info_row[Gem::CompactIndexClient::INFO_SUFFIX]
415
+
416
+ requirements = compact_index_requirements(info_row)
417
+ platform = required_platform_from(requirements[:platform])
418
+ next unless platform
419
+ next unless requirements[:ruby]
420
+
421
+ ruby_abi = Gem::ContentAddress.ruby_abi_for(Gem::Requirement.new(requirements[:ruby]))
422
+ ContentAddressableInfo.new(version, suffix, ruby_abi, platform)
423
+ end
424
+
425
+ available_rows & wanted_rows
223
426
  end
224
427
 
225
- private
428
+ def compact_index_requirements(info_row)
429
+ info_row[Gem::CompactIndexClient::INFO_REQS].to_h do |key, requirements|
430
+ [key.to_sym, requirements]
431
+ end
432
+ end
226
433
 
227
- def new_dependency_resolver_set
228
- return Gem::Resolver::IndexSet.new self if uri.scheme == "file"
434
+ def required_platform_from(requirement)
435
+ platform = Array(requirement).last.to_s
436
+ return if platform.empty?
437
+
438
+ platform
439
+ end
229
440
 
230
- fetch_uri = if uri.host == "rubygems.org"
441
+ def max_versions_by_platform(tuples)
442
+ grouped_tuples = tuples.group_by {|tuple| latest_platform_key(tuple) }
443
+ grouped_tuples.map do |_, platform_tuples|
444
+ platform_tuples.max_by(&:version)
445
+ end
446
+ end
447
+
448
+ def latest_platform_key(tuple)
449
+ if tuple.content_address
450
+ [tuple.platform, tuple.ruby_abi || tuple.content_address]
451
+ else
452
+ tuple.platform
453
+ end
454
+ end
455
+
456
+ def compact_index_uri
457
+ if uri.host == "rubygems.org"
231
458
  index_uri = uri.dup
232
459
  index_uri.host = "index.rubygems.org"
233
460
  index_uri
234
461
  else
235
462
  uri
236
463
  end
464
+ end
465
+
466
+ def compact_index_cache_dir(index_uri)
467
+ if update_cache?
468
+ # Correct for windows paths
469
+ escaped_path = index_uri.path.sub(%r{^/([a-z]):/}i, '/\\1-/')
470
+
471
+ File.join Gem.spec_cache_dir, "compact_index",
472
+ "#{index_uri.host}%#{index_uri.port}", *escaped_path.split("/").reject(&:empty?)
473
+ else
474
+ require "tmpdir"
475
+ require "fileutils"
476
+ dir = Dir.mktmpdir "gem_compact_index"
477
+ at_exit { FileUtils.rm_rf dir }
478
+ dir
479
+ end
480
+ end
481
+
482
+ def new_dependency_resolver_set
483
+ return Gem::Resolver::IndexSet.new self if uri.scheme == "file"
237
484
 
238
- bundler_api_uri = enforce_trailing_slash(fetch_uri) + "versions"
485
+ bundler_api_uri = enforce_trailing_slash(compact_index_uri) + "versions"
239
486
 
240
487
  begin
241
488
  fetcher = Gem::RemoteFetcher.fetcher
@@ -82,13 +82,17 @@ class Gem::SpecFetcher
82
82
  # Find and fetch gem name tuples that match +dependency+.
83
83
  #
84
84
  # If +matching_platform+ is false, gems for all platforms are returned.
85
+ #
86
+ # +type+ overrides the index type derived from +dependency+. See
87
+ # #available_specs for the list of types.
85
88
 
86
- def search_for_dependency(dependency, matching_platform = true)
89
+ def search_for_dependency(dependency, matching_platform = true, type: nil)
87
90
  found = {}
88
91
 
89
92
  rejected_specs = {}
90
93
 
91
- list, errors = available_specs(dependency.identity)
94
+ specs_type = type || dependency.identity
95
+ list, errors = available_specs(specs_type)
92
96
 
93
97
  list.each do |source, specs|
94
98
  if dependency.name.is_a?(String) && specs.respond_to?(:bsearch)
@@ -97,17 +101,20 @@ class Gem::SpecFetcher
97
101
  specs = specs[start_index...end_index] if start_index && end_index
98
102
  end
99
103
 
104
+ specs = specs.select {|tup| dependency.match?(tup) }
105
+ specs = decode_source_content_addressable_tuples(source, specs, latest: specs_type == :latest)
106
+
100
107
  found[source] = specs.select do |tup|
101
- if dependency.match?(tup)
102
- if matching_platform && !Gem::Platform.match_gem?(tup.platform, tup.name)
103
- pm = (
104
- rejected_specs[dependency] ||= \
105
- Gem::PlatformMismatch.new(tup.name, tup.version))
106
- pm.add_platform tup.platform
107
- false
108
- else
109
- true
110
- end
108
+ if matching_platform && !Gem::Platform.match_gem?(tup.platform, tup.name)
109
+ pm = (
110
+ rejected_specs[dependency] ||= \
111
+ Gem::PlatformMismatch.new(tup.name, tup.version))
112
+ pm.add_platform tup.platform
113
+ false
114
+ elsif matching_platform && !ruby_abi_match?(tup)
115
+ false
116
+ else
117
+ true
111
118
  end
112
119
  end
113
120
  end
@@ -156,6 +163,7 @@ class Gem::SpecFetcher
156
163
  specs = []
157
164
  tuples.each do |tup, source|
158
165
  spec = source.fetch_spec(tup)
166
+ spec.content_address = tup.content_address if tup.content_address
159
167
  rescue Gem::RemoteFetcher::FetchError => e
160
168
  errors << Gem::SourceFetchProblem.new(source, e)
161
169
  else
@@ -165,6 +173,17 @@ class Gem::SpecFetcher
165
173
  [specs, errors]
166
174
  end
167
175
 
176
+ ##
177
+ # Decodes the content-addressable tuples in +spec_tuples+ ([tuple, source]
178
+ # pairs) to carry their real platform and Ruby ABI via each source.
179
+
180
+ def decode_content_addressable_tuples(spec_tuples, latest: false)
181
+ spec_tuples.group_by {|_, source| source }.flat_map do |source, source_tuples|
182
+ tuples = source_tuples.map(&:first)
183
+ decode_source_content_addressable_tuples(source, tuples, latest: latest).map {|tuple| [tuple, source] }
184
+ end
185
+ end
186
+
168
187
  ##
169
188
  # Suggests gems based on the supplied +gem_name+. Returns an array of
170
189
  # alternative gem names.
@@ -287,4 +306,20 @@ class Gem::SpecFetcher
287
306
  raise unless gracefully_ignore
288
307
  []
289
308
  end
309
+
310
+ private
311
+
312
+ def decode_source_content_addressable_tuples(source, tuples, latest: false) # :nodoc:
313
+ return tuples unless source.respond_to?(:decode_content_addressable_tuples)
314
+
315
+ source.decode_content_addressable_tuples(tuples, latest: latest)
316
+ end
317
+
318
+ def ruby_abi_match?(tuple) # :nodoc:
319
+ !tuple.ruby_abi || tuple.ruby_abi == current_ruby_abi
320
+ end
321
+
322
+ def current_ruby_abi # :nodoc:
323
+ @current_ruby_abi ||= Gem.ruby_abi
324
+ end
290
325
  end
@@ -11,7 +11,6 @@ require_relative "basic_specification"
11
11
  require_relative "stub_specification"
12
12
  require_relative "platform"
13
13
  require_relative "specification_record"
14
- require_relative "util/list"
15
14
 
16
15
  require "rbconfig"
17
16
 
@@ -420,6 +419,13 @@ class Gem::Specification < Gem::BasicSpecification
420
419
 
421
420
  attr_accessor :metadata
422
421
 
422
+ ##
423
+ # The content address of this gem, a SHA-256 prefix of the gem file
424
+ # contents used in place of the platform in file and install names
425
+ # (e.g. "example-1.0-78be552b"), or +nil+ for non-content-addressable gems.
426
+
427
+ attr_accessor :content_address
428
+
423
429
  ######################################################################
424
430
  # :section: Optional gemspec attributes
425
431
 
@@ -545,7 +551,7 @@ class Gem::Specification < Gem::BasicSpecification
545
551
  #
546
552
  # Usage:
547
553
  #
548
- # spec.add_development_dependency 'example', '~> 1.1', '>= 1.1.4'
554
+ # spec.add_development_dependency 'example', '>= 1.1.4', '< 2'
549
555
  #
550
556
  # Development dependencies aren't installed by default and aren't
551
557
  # activated when a gem is required.
@@ -559,7 +565,7 @@ class Gem::Specification < Gem::BasicSpecification
559
565
  #
560
566
  # Usage:
561
567
  #
562
- # spec.add_dependency 'example', '~> 1.1', '>= 1.1.4'
568
+ # spec.add_dependency 'example', '>= 1.1.4', '< 2'
563
569
 
564
570
  def add_dependency(gem, *requirements)
565
571
  if requirements.uniq.size != requirements.size
@@ -569,6 +575,15 @@ class Gem::Specification < Gem::BasicSpecification
569
575
  add_dependency_with_type(gem, :runtime, requirements)
570
576
  end
571
577
 
578
+ ##
579
+ # Ruby ABI of the gem derived from required_ruby_version
580
+ # Only supports required_ruby_version in "~> X.Y.0" format (single pessimistic requirement with 3 segments)
581
+ # Returns nil if the required_ruby_version does not specify a single Ruby ABI
582
+
583
+ def ruby_abi
584
+ Gem::ContentAddress.ruby_abi_for(required_ruby_version)
585
+ end
586
+
572
587
  ##
573
588
  # Executables included in the gem.
574
589
  #
@@ -1248,7 +1263,9 @@ class Gem::Specification < Gem::BasicSpecification
1248
1263
  # Keeps track of all currently known specifications
1249
1264
 
1250
1265
  def self.specification_record
1251
- @specification_record ||= Gem::SpecificationRecord.new(dirs)
1266
+ @specification_record ||= Gem::SpecificationRecord.new(
1267
+ Gem::SpecificationRecord.dirs_with_abi(dirs)
1268
+ )
1252
1269
  end
1253
1270
 
1254
1271
  # DOC: This method needs documented or nodoc'd
@@ -1288,7 +1305,7 @@ class Gem::Specification < Gem::BasicSpecification
1288
1305
  raise unless message.include?("YAML::")
1289
1306
 
1290
1307
  unless Object.const_defined?(:YAML)
1291
- Object.const_set "YAML", Psych
1308
+ Object.const_set "YAML", Module.new
1292
1309
  yaml_set = true
1293
1310
  end
1294
1311
 
@@ -1297,7 +1314,7 @@ class Gem::Specification < Gem::BasicSpecification
1297
1314
 
1298
1315
  YAML::Syck.const_set "DefaultKey", Class.new if message.include?("YAML::Syck::DefaultKey") && !YAML::Syck.const_defined?(:DefaultKey)
1299
1316
  elsif message.include?("YAML::PrivateType") && !YAML.const_defined?(:PrivateType)
1300
- YAML.const_set "PrivateType", Class.new
1317
+ YAML.const_set "PrivateType", Class.new { attr_accessor :type_id, :value }
1301
1318
  end
1302
1319
 
1303
1320
  retry_count += 1
@@ -1355,7 +1372,8 @@ class Gem::Specification < Gem::BasicSpecification
1355
1372
  self.class === other &&
1356
1373
  name == other.name &&
1357
1374
  version == other.version &&
1358
- platform == other.platform
1375
+ platform == other.platform &&
1376
+ content_address == other.content_address
1359
1377
  end
1360
1378
 
1361
1379
  ##
@@ -1926,7 +1944,7 @@ class Gem::Specification < Gem::BasicSpecification
1926
1944
  # :startdoc:
1927
1945
 
1928
1946
  def hash # :nodoc:
1929
- name.hash ^ version.hash
1947
+ [name, version, platform, content_address].hash
1930
1948
  end
1931
1949
 
1932
1950
  def init_with(coder) # :nodoc:
@@ -1962,6 +1980,7 @@ class Gem::Specification < Gem::BasicSpecification
1962
1980
  @loaded_from = nil
1963
1981
  @original_platform = nil
1964
1982
  @installed_by_version = nil
1983
+ @content_address = nil
1965
1984
 
1966
1985
  set_nil_attributes_to_nil
1967
1986
  set_not_nil_attributes_to_default_values
@@ -2009,13 +2028,19 @@ class Gem::Specification < Gem::BasicSpecification
2009
2028
 
2010
2029
  def base_dir
2011
2030
  return Gem.dir unless loaded_from
2012
- @base_dir ||= if default_gem?
2031
+ @base_dir ||= if default_gem? || loaded_from_abi_scoped_spec_dir?
2013
2032
  File.dirname File.dirname File.dirname loaded_from
2014
2033
  else
2015
2034
  File.dirname File.dirname loaded_from
2016
2035
  end
2017
2036
  end
2018
2037
 
2038
+ def loaded_from_abi_scoped_spec_dir?
2039
+ !loaded_from.nil? &&
2040
+ Gem::SpecificationRecord.abi_scoped_spec_dir?(File.dirname(loaded_from))
2041
+ end
2042
+ private :loaded_from_abi_scoped_spec_dir?
2043
+
2019
2044
  def inspect # :nodoc:
2020
2045
  if $DEBUG
2021
2046
  super
@@ -2115,7 +2140,7 @@ class Gem::Specification < Gem::BasicSpecification
2115
2140
  # Return a NameTuple that represents this Specification
2116
2141
 
2117
2142
  def name_tuple
2118
- Gem::NameTuple.new name, version, original_platform
2143
+ Gem::NameTuple.new name, version, original_platform, content_address: content_address
2119
2144
  end
2120
2145
 
2121
2146
  ##
@@ -2204,10 +2229,13 @@ class Gem::Specification < Gem::BasicSpecification
2204
2229
  end
2205
2230
 
2206
2231
  ##
2207
- # Sets rdoc_options to +value+, ensuring it is an array.
2232
+ # Sets rdoc_options to +value+, ensuring it is a flat array of strings.
2233
+ # Handles malformed gemspecs where rdoc_options may be a Hash or contain Hashes.
2208
2234
 
2209
2235
  def rdoc_options=(options)
2210
- @rdoc_options = Array options
2236
+ @rdoc_options = Array(options).flat_map do |opt|
2237
+ opt.is_a?(Hash) ? opt.to_a.flatten.map(&:to_s) : opt
2238
+ end
2211
2239
  end
2212
2240
 
2213
2241
  ##
@@ -2279,7 +2307,8 @@ class Gem::Specification < Gem::BasicSpecification
2279
2307
  # True if this gem has the same attributes as +other+.
2280
2308
 
2281
2309
  def same_attributes?(spec)
2282
- @@attributes.all? {|name, _default| send(name) == spec.send(name) }
2310
+ @@attributes.all? {|name, _default| send(name) == spec.send(name) } &&
2311
+ content_address == spec.content_address
2283
2312
  end
2284
2313
 
2285
2314
  private :same_attributes?
@@ -2307,11 +2336,14 @@ class Gem::Specification < Gem::BasicSpecification
2307
2336
  end
2308
2337
 
2309
2338
  ##
2310
- # Returns the full path to the directory containing this spec's
2311
- # gemspec file. eg: /usr/local/lib/ruby/gems/1.8/specifications
2312
-
2339
+ # Full path to the directory containing this spec's gemspec file.
2340
+ # ABI-scoped for content-addressed specs.
2313
2341
  def spec_dir
2314
- @spec_dir ||= File.join base_dir, "specifications"
2342
+ @spec_dir ||= if loaded_from && Gem::ContentAddress.content_addressed?(self)
2343
+ File.dirname loaded_from
2344
+ else
2345
+ Gem::SpecificationRecord.specification_dir_for(self, base_dir)
2346
+ end
2315
2347
  end
2316
2348
 
2317
2349
  ##
@@ -2378,11 +2410,14 @@ class Gem::Specification < Gem::BasicSpecification
2378
2410
  # still have their default values are omitted.
2379
2411
 
2380
2412
  def to_ruby
2413
+ content_addressed = Gem::ContentAddress.content_addressed?(self)
2414
+ gem_suffix = content_addressed ? content_address : platform
2381
2415
  result = []
2382
2416
  result << "# -*- encoding: utf-8 -*-"
2383
- result << "#{Gem::StubSpecification::PREFIX}#{name} #{version} #{platform} #{raw_require_paths.join("\0")}"
2417
+ result << "#{Gem::StubSpecification::PREFIX}#{name} #{version} #{gem_suffix} #{raw_require_paths.join("\0")}"
2384
2418
  result << "#{Gem::StubSpecification::PREFIX}#{extensions.join "\0"}" unless
2385
2419
  extensions.empty?
2420
+ result << "#{Gem::StubSpecification::TARGET_PREFIX}platform=#{platform}" if content_addressed
2386
2421
  result << nil
2387
2422
  result << "Gem::Specification.new do |s|"
2388
2423
 
@@ -2391,6 +2426,7 @@ class Gem::Specification < Gem::BasicSpecification
2391
2426
  unless platform.nil? || platform == Gem::Platform::RUBY
2392
2427
  result << " s.platform = #{ruby_code original_platform}"
2393
2428
  end
2429
+ result << " s.content_address = #{ruby_code content_address} if s.respond_to? :content_address=" if content_addressed
2394
2430
  result << ""
2395
2431
  result << " s.required_rubygems_version = #{ruby_code required_rubygems_version} if s.respond_to? :required_rubygems_version="
2396
2432
 
@@ -2469,24 +2505,28 @@ class Gem::Specification < Gem::BasicSpecification
2469
2505
  def to_yaml(opts = {}) # :nodoc:
2470
2506
  Gem.load_yaml
2471
2507
 
2472
- # Because the user can switch the YAML engine behind our
2473
- # back, we have to check again here to make sure that our
2474
- # psych code was properly loaded, and load it if not.
2475
- unless Gem.const_defined?(:NoAliasYAMLTree)
2476
- require_relative "psych_tree"
2477
- end
2508
+ if Gem.use_psych?
2509
+ # Because the user can switch the YAML engine behind our
2510
+ # back, we have to check again here to make sure that our
2511
+ # psych code was properly loaded, and load it if not.
2512
+ unless Gem.const_defined?(:NoAliasYAMLTree)
2513
+ require_relative "psych_tree"
2514
+ end
2478
2515
 
2479
- builder = Gem::NoAliasYAMLTree.create
2480
- builder << self
2481
- ast = builder.tree
2516
+ builder = Gem::NoAliasYAMLTree.create
2517
+ builder << self
2518
+ ast = builder.tree
2482
2519
 
2483
- require "stringio"
2484
- io = StringIO.new
2485
- io.set_encoding Encoding::UTF_8
2520
+ require "stringio"
2521
+ io = StringIO.new
2522
+ io.set_encoding Encoding::UTF_8
2486
2523
 
2487
- Psych::Visitors::Emitter.new(io).accept(ast)
2524
+ Psych::Visitors::Emitter.new(io).accept(ast)
2488
2525
 
2489
- io.string.gsub(/ !!null \n/, " \n")
2526
+ io.string.gsub(/ !!null \n/, " \n")
2527
+ else
2528
+ Gem::YAMLSerializer.dump(self)
2529
+ end
2490
2530
  end
2491
2531
 
2492
2532
  ##
@@ -2563,6 +2603,10 @@ class Gem::Specification < Gem::BasicSpecification
2563
2603
  self.date = val
2564
2604
  when "platform"
2565
2605
  self.platform = val
2606
+ when "rdoc_options"
2607
+ self.rdoc_options = val
2608
+ when "requirements"
2609
+ self.requirements = val
2566
2610
  else
2567
2611
  instance_variable_set "@#{ivar}", val
2568
2612
  end