rubygems-update 1.8.30 → 2.0.0.preview2

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 (241) hide show
  1. checksums.yaml +6 -6
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +3 -0
  4. data/.autotest +6 -3
  5. data/History.txt +137 -63
  6. data/LICENSE.txt +1 -5
  7. data/Manifest.txt +69 -32
  8. data/README.rdoc +11 -9
  9. data/Rakefile +24 -38
  10. data/bin/gem +0 -9
  11. data/bin/update_rubygems +1 -0
  12. data/lib/rubygems.rb +193 -405
  13. data/lib/rubygems/available_set.rb +95 -0
  14. data/lib/rubygems/command.rb +88 -45
  15. data/lib/rubygems/command_manager.rb +67 -40
  16. data/lib/rubygems/commands/build_command.rb +5 -23
  17. data/lib/rubygems/commands/cert_command.rb +199 -57
  18. data/lib/rubygems/commands/check_command.rb +14 -39
  19. data/lib/rubygems/commands/cleanup_command.rb +9 -1
  20. data/lib/rubygems/commands/contents_command.rb +30 -12
  21. data/lib/rubygems/commands/dependency_command.rb +3 -8
  22. data/lib/rubygems/commands/environment_command.rb +13 -8
  23. data/lib/rubygems/commands/fetch_command.rb +3 -16
  24. data/lib/rubygems/commands/generate_index_command.rb +7 -47
  25. data/lib/rubygems/commands/help_command.rb +1 -1
  26. data/lib/rubygems/commands/install_command.rb +69 -36
  27. data/lib/rubygems/commands/list_command.rb +6 -4
  28. data/lib/rubygems/commands/lock_command.rb +1 -1
  29. data/lib/rubygems/commands/mirror_command.rb +17 -0
  30. data/lib/rubygems/commands/outdated_command.rb +6 -3
  31. data/lib/rubygems/commands/owner_command.rb +13 -5
  32. data/lib/rubygems/commands/pristine_command.rb +19 -4
  33. data/lib/rubygems/commands/push_command.rb +12 -1
  34. data/lib/rubygems/commands/query_command.rb +43 -27
  35. data/lib/rubygems/commands/rdoc_command.rb +23 -28
  36. data/lib/rubygems/commands/search_command.rb +4 -18
  37. data/lib/rubygems/commands/server_command.rb +1 -1
  38. data/lib/rubygems/commands/setup_command.rb +124 -38
  39. data/lib/rubygems/commands/sources_command.rb +16 -16
  40. data/lib/rubygems/commands/specification_command.rb +11 -13
  41. data/lib/rubygems/commands/uninstall_command.rb +24 -7
  42. data/lib/rubygems/commands/unpack_command.rb +7 -3
  43. data/lib/rubygems/commands/update_command.rb +22 -36
  44. data/lib/rubygems/commands/yank_command.rb +98 -0
  45. data/lib/rubygems/compatibility.rb +51 -0
  46. data/lib/rubygems/config_file.rb +82 -54
  47. data/lib/rubygems/core_ext/kernel_gem.rb +53 -0
  48. data/lib/rubygems/core_ext/kernel_require.rb +119 -0
  49. data/lib/rubygems/defaults.rb +10 -21
  50. data/lib/rubygems/dependency.rb +61 -10
  51. data/lib/rubygems/dependency_installer.rb +157 -69
  52. data/lib/rubygems/dependency_list.rb +11 -19
  53. data/lib/rubygems/dependency_resolver.rb +562 -0
  54. data/lib/rubygems/deprecate.rb +40 -40
  55. data/lib/rubygems/errors.rb +77 -24
  56. data/lib/rubygems/exceptions.rb +25 -7
  57. data/lib/rubygems/ext/builder.rb +20 -23
  58. data/lib/rubygems/ext/configure_builder.rb +2 -2
  59. data/lib/rubygems/ext/ext_conf_builder.rb +5 -45
  60. data/lib/rubygems/ext/rake_builder.rb +2 -2
  61. data/lib/rubygems/gem_runner.rb +3 -16
  62. data/lib/rubygems/gemcutter_utilities.rb +22 -7
  63. data/lib/rubygems/indexer.rb +6 -159
  64. data/lib/rubygems/install_message.rb +12 -0
  65. data/lib/rubygems/install_update_options.rb +56 -18
  66. data/lib/rubygems/installer.rb +244 -134
  67. data/lib/rubygems/installer_test_case.rb +71 -19
  68. data/lib/rubygems/mock_gem_ui.rb +17 -0
  69. data/lib/rubygems/name_tuple.rb +110 -0
  70. data/lib/rubygems/package.rb +514 -43
  71. data/lib/rubygems/package/digest_io.rb +64 -0
  72. data/lib/rubygems/package/old.rb +147 -0
  73. data/lib/rubygems/package/tar_header.rb +18 -55
  74. data/lib/rubygems/package/tar_reader.rb +20 -3
  75. data/lib/rubygems/package/tar_writer.rb +63 -7
  76. data/lib/rubygems/package_task.rb +3 -4
  77. data/lib/rubygems/path_support.rb +14 -7
  78. data/lib/rubygems/platform.rb +19 -26
  79. data/lib/rubygems/rdoc.rb +316 -0
  80. data/lib/rubygems/remote_fetcher.rb +117 -54
  81. data/lib/rubygems/request_set.rb +182 -0
  82. data/lib/rubygems/requirement.rb +63 -26
  83. data/lib/rubygems/security.rb +295 -555
  84. data/lib/rubygems/security/policies.rb +115 -0
  85. data/lib/rubygems/security/policy.rb +227 -0
  86. data/lib/rubygems/security/signer.rb +136 -0
  87. data/lib/rubygems/security/trust_dir.rb +104 -0
  88. data/lib/rubygems/server.rb +45 -55
  89. data/lib/rubygems/source.rb +144 -0
  90. data/lib/rubygems/source_list.rb +87 -0
  91. data/lib/rubygems/source_local.rb +92 -0
  92. data/lib/rubygems/source_specific_file.rb +28 -0
  93. data/lib/rubygems/spec_fetcher.rb +116 -184
  94. data/lib/rubygems/specification.rb +731 -335
  95. data/lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem +88 -30
  96. data/lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem +90 -0
  97. data/lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem +57 -0
  98. data/lib/rubygems/syck_hack.rb +2 -0
  99. data/lib/rubygems/test_case.rb +199 -109
  100. data/lib/rubygems/test_utilities.rb +25 -5
  101. data/lib/rubygems/uninstaller.rb +62 -20
  102. data/lib/rubygems/user_interaction.rb +10 -0
  103. data/lib/rubygems/validator.rb +33 -40
  104. data/lib/rubygems/version.rb +19 -8
  105. data/setup.rb +8 -1
  106. data/test/rubygems/alternate_cert.pem +9 -0
  107. data/test/rubygems/alternate_cert_32.pem +9 -0
  108. data/test/rubygems/alternate_key.pem +9 -0
  109. data/test/rubygems/bad_rake.rb +1 -0
  110. data/test/rubygems/child_cert.pem +9 -0
  111. data/test/rubygems/child_cert_32.pem +9 -0
  112. data/test/rubygems/child_key.pem +9 -0
  113. data/test/rubygems/data/null-type.gemspec.rz +0 -0
  114. data/test/rubygems/expired_cert.pem +9 -0
  115. data/test/rubygems/future_cert.pem +9 -0
  116. data/test/rubygems/future_cert_32.pem +9 -0
  117. data/test/rubygems/good_rake.rb +1 -0
  118. data/test/rubygems/grandchild_cert.pem +9 -0
  119. data/test/rubygems/grandchild_cert_32.pem +9 -0
  120. data/test/rubygems/grandchild_key.pem +9 -0
  121. data/test/rubygems/invalid_issuer_cert.pem +9 -0
  122. data/test/rubygems/invalid_issuer_cert_32.pem +9 -0
  123. data/test/rubygems/invalid_key.pem +9 -0
  124. data/test/rubygems/invalid_signer_cert.pem +9 -0
  125. data/test/rubygems/invalid_signer_cert_32.pem +9 -0
  126. data/test/rubygems/invalidchild_cert.pem +9 -0
  127. data/test/rubygems/invalidchild_cert_32.pem +9 -0
  128. data/test/rubygems/invalidchild_key.pem +9 -0
  129. data/test/rubygems/plugin/exception/rubygems_plugin.rb +1 -1
  130. data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +1 -1
  131. data/test/rubygems/private_key.pem +7 -25
  132. data/test/rubygems/public_cert.pem +8 -18
  133. data/test/rubygems/public_cert_32.pem +10 -0
  134. data/test/rubygems/public_key.pem +4 -0
  135. data/test/rubygems/rubygems/commands/crash_command.rb +1 -1
  136. data/test/rubygems/test_config.rb +4 -6
  137. data/test/rubygems/test_deprecate.rb +76 -0
  138. data/test/rubygems/test_gem.rb +318 -83
  139. data/test/rubygems/test_gem_available_set.rb +106 -0
  140. data/test/rubygems/test_gem_command.rb +10 -0
  141. data/test/rubygems/test_gem_command_manager.rb +55 -9
  142. data/test/rubygems/test_gem_commands_build_command.rb +11 -19
  143. data/test/rubygems/test_gem_commands_cert_command.rb +441 -42
  144. data/test/rubygems/test_gem_commands_cleanup_command.rb +29 -1
  145. data/test/rubygems/test_gem_commands_contents_command.rb +23 -0
  146. data/test/rubygems/test_gem_commands_dependency_command.rb +5 -0
  147. data/test/rubygems/test_gem_commands_fetch_command.rb +19 -20
  148. data/test/rubygems/test_gem_commands_generate_index_command.rb +2 -83
  149. data/test/rubygems/test_gem_commands_help_command.rb +2 -1
  150. data/test/rubygems/test_gem_commands_install_command.rb +647 -48
  151. data/test/rubygems/test_gem_commands_mirror.rb +32 -0
  152. data/test/rubygems/test_gem_commands_owner_command.rb +4 -8
  153. data/test/rubygems/test_gem_commands_pristine_command.rb +99 -4
  154. data/test/rubygems/test_gem_commands_push_command.rb +62 -8
  155. data/test/rubygems/test_gem_commands_query_command.rb +51 -0
  156. data/test/rubygems/test_gem_commands_search_command.rb +25 -0
  157. data/test/rubygems/test_gem_commands_setup_command.rb +45 -0
  158. data/test/rubygems/test_gem_commands_sources_command.rb +21 -6
  159. data/test/rubygems/test_gem_commands_specification_command.rb +33 -1
  160. data/test/rubygems/test_gem_commands_uninstall_command.rb +91 -31
  161. data/test/rubygems/test_gem_commands_unpack_command.rb +3 -3
  162. data/test/rubygems/test_gem_commands_update_command.rb +56 -38
  163. data/test/rubygems/test_gem_commands_which_command.rb +4 -4
  164. data/test/rubygems/test_gem_commands_yank_command.rb +97 -0
  165. data/test/rubygems/test_gem_config_file.rb +66 -21
  166. data/test/rubygems/test_gem_dependency.rb +46 -0
  167. data/test/rubygems/test_gem_dependency_installer.rb +228 -18
  168. data/test/rubygems/test_gem_dependency_list.rb +0 -9
  169. data/test/rubygems/test_gem_dependency_resolver.rb +327 -0
  170. data/test/rubygems/test_gem_ext_configure_builder.rb +4 -4
  171. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +21 -49
  172. data/test/rubygems/test_gem_ext_rake_builder.rb +13 -13
  173. data/test/rubygems/test_gem_gem_runner.rb +27 -5
  174. data/test/rubygems/test_gem_gemcutter_utilities.rb +19 -0
  175. data/test/rubygems/test_gem_indexer.rb +14 -227
  176. data/test/rubygems/test_gem_install_update_options.rb +83 -3
  177. data/test/rubygems/test_gem_installer.rb +211 -236
  178. data/test/rubygems/test_gem_local_remote_options.rb +8 -2
  179. data/test/rubygems/test_gem_name_tuple.rb +15 -0
  180. data/test/rubygems/test_gem_package.rb +547 -0
  181. data/test/rubygems/test_gem_package_old.rb +37 -0
  182. data/test/rubygems/test_gem_package_tar_reader.rb +32 -0
  183. data/test/rubygems/test_gem_package_tar_writer.rb +84 -1
  184. data/test/rubygems/test_gem_path_support.rb +4 -30
  185. data/test/rubygems/test_gem_platform.rb +3 -6
  186. data/test/rubygems/test_gem_rdoc.rb +245 -0
  187. data/test/rubygems/test_gem_remote_fetcher.rb +51 -5
  188. data/test/rubygems/test_gem_request_set.rb +70 -0
  189. data/test/rubygems/test_gem_requirement.rb +53 -24
  190. data/test/rubygems/test_gem_security.rb +189 -43
  191. data/test/rubygems/test_gem_security_policy.rb +376 -0
  192. data/test/rubygems/test_gem_security_signer.rb +184 -0
  193. data/test/rubygems/test_gem_security_trust_dir.rb +94 -0
  194. data/test/rubygems/test_gem_server.rb +31 -36
  195. data/test/rubygems/test_gem_silent_ui.rb +2 -2
  196. data/test/rubygems/test_gem_source.rb +188 -0
  197. data/test/rubygems/test_gem_source_list.rb +87 -0
  198. data/test/rubygems/test_gem_source_local.rb +83 -0
  199. data/test/rubygems/test_gem_source_specific_file.rb +33 -0
  200. data/test/rubygems/test_gem_spec_fetcher.rb +91 -255
  201. data/test/rubygems/test_gem_specification.rb +293 -39
  202. data/test/rubygems/test_gem_uninstaller.rb +136 -13
  203. data/test/rubygems/test_gem_validator.rb +14 -41
  204. data/test/rubygems/test_gem_version.rb +15 -21
  205. data/test/rubygems/test_require.rb +193 -0
  206. data/test/rubygems/wrong_key_cert.pem +9 -0
  207. data/test/rubygems/wrong_key_cert_32.pem +9 -0
  208. metadata +171 -83
  209. metadata.gz.sig +1 -0
  210. data/CVE-2013-4287.txt +0 -36
  211. data/CVE-2013-4363.txt +0 -45
  212. data/ci_build.sh +0 -27
  213. data/cruise_config.rb +0 -32
  214. data/lib/rbconfig/datadir.rb +0 -13
  215. data/lib/rubygems/builder.rb +0 -99
  216. data/lib/rubygems/custom_require.rb +0 -69
  217. data/lib/rubygems/doc_manager.rb +0 -243
  218. data/lib/rubygems/format.rb +0 -82
  219. data/lib/rubygems/gem_openssl.rb +0 -90
  220. data/lib/rubygems/gem_path_searcher.rb +0 -172
  221. data/lib/rubygems/old_format.rb +0 -153
  222. data/lib/rubygems/package/f_sync_dir.rb +0 -23
  223. data/lib/rubygems/package/tar_input.rb +0 -234
  224. data/lib/rubygems/package/tar_output.rb +0 -146
  225. data/lib/rubygems/require_paths_builder.rb +0 -18
  226. data/lib/rubygems/source_index.rb +0 -406
  227. data/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
  228. data/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
  229. data/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
  230. data/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
  231. data/lib/rubygems/ssl_certs/GeoTrustGlobalCA.pem +0 -20
  232. data/test/rubygems/test_bundled_ca.rb +0 -59
  233. data/test/rubygems/test_gem_builder.rb +0 -44
  234. data/test/rubygems/test_gem_doc_manager.rb +0 -32
  235. data/test/rubygems/test_gem_ext_builder.rb +0 -58
  236. data/test/rubygems/test_gem_format.rb +0 -88
  237. data/test/rubygems/test_gem_gem_path_searcher.rb +0 -94
  238. data/test/rubygems/test_gem_package_tar_input.rb +0 -129
  239. data/test/rubygems/test_gem_package_tar_output.rb +0 -101
  240. data/test/rubygems/test_gem_source_index.rb +0 -250
  241. data/util/update_bundled_ca_certificates.rb +0 -103
@@ -1,32 +1,90 @@
1
+ This CA certificate is for verifying HTTPS connection to;
2
+ - https://rubygems.org/ (obtained by RubyGems team)
3
+
4
+ Certificate:
5
+ Data:
6
+ Version: 3 (0x2)
7
+ Serial Number: 1 (0x1)
8
+ Signature Algorithm: sha1WithRSAEncryption
9
+ Issuer: C=SE, O=AddTrust AB, OU=AddTrust External TTP Network, CN=AddTrust External CA Root
10
+ Validity
11
+ Not Before: May 30 10:48:38 2000 GMT
12
+ Not After : May 30 10:48:38 2020 GMT
13
+ Subject: C=SE, O=AddTrust AB, OU=AddTrust External TTP Network, CN=AddTrust External CA Root
14
+ Subject Public Key Info:
15
+ Public Key Algorithm: rsaEncryption
16
+ Public-Key: (2048 bit)
17
+ Modulus:
18
+ 00:b7:f7:1a:33:e6:f2:00:04:2d:39:e0:4e:5b:ed:
19
+ 1f:bc:6c:0f:cd:b5:fa:23:b6:ce:de:9b:11:33:97:
20
+ a4:29:4c:7d:93:9f:bd:4a:bc:93:ed:03:1a:e3:8f:
21
+ cf:e5:6d:50:5a:d6:97:29:94:5a:80:b0:49:7a:db:
22
+ 2e:95:fd:b8:ca:bf:37:38:2d:1e:3e:91:41:ad:70:
23
+ 56:c7:f0:4f:3f:e8:32:9e:74:ca:c8:90:54:e9:c6:
24
+ 5f:0f:78:9d:9a:40:3c:0e:ac:61:aa:5e:14:8f:9e:
25
+ 87:a1:6a:50:dc:d7:9a:4e:af:05:b3:a6:71:94:9c:
26
+ 71:b3:50:60:0a:c7:13:9d:38:07:86:02:a8:e9:a8:
27
+ 69:26:18:90:ab:4c:b0:4f:23:ab:3a:4f:84:d8:df:
28
+ ce:9f:e1:69:6f:bb:d7:42:d7:6b:44:e4:c7:ad:ee:
29
+ 6d:41:5f:72:5a:71:08:37:b3:79:65:a4:59:a0:94:
30
+ 37:f7:00:2f:0d:c2:92:72:da:d0:38:72:db:14:a8:
31
+ 45:c4:5d:2a:7d:b7:b4:d6:c4:ee:ac:cd:13:44:b7:
32
+ c9:2b:dd:43:00:25:fa:61:b9:69:6a:58:23:11:b7:
33
+ a7:33:8f:56:75:59:f5:cd:29:d7:46:b7:0a:2b:65:
34
+ b6:d3:42:6f:15:b2:b8:7b:fb:ef:e9:5d:53:d5:34:
35
+ 5a:27
36
+ Exponent: 65537 (0x10001)
37
+ X509v3 extensions:
38
+ X509v3 Subject Key Identifier:
39
+ AD:BD:98:7A:34:B4:26:F7:FA:C4:26:54:EF:03:BD:E0:24:CB:54:1A
40
+ X509v3 Key Usage:
41
+ Certificate Sign, CRL Sign
42
+ X509v3 Basic Constraints: critical
43
+ CA:TRUE
44
+ X509v3 Authority Key Identifier:
45
+ keyid:AD:BD:98:7A:34:B4:26:F7:FA:C4:26:54:EF:03:BD:E0:24:CB:54:1A
46
+ DirName:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
47
+ serial:01
48
+
49
+ Signature Algorithm: sha1WithRSAEncryption
50
+ b0:9b:e0:85:25:c2:d6:23:e2:0f:96:06:92:9d:41:98:9c:d9:
51
+ 84:79:81:d9:1e:5b:14:07:23:36:65:8f:b0:d8:77:bb:ac:41:
52
+ 6c:47:60:83:51:b0:f9:32:3d:e7:fc:f6:26:13:c7:80:16:a5:
53
+ bf:5a:fc:87:cf:78:79:89:21:9a:e2:4c:07:0a:86:35:bc:f2:
54
+ de:51:c4:d2:96:b7:dc:7e:4e:ee:70:fd:1c:39:eb:0c:02:51:
55
+ 14:2d:8e:bd:16:e0:c1:df:46:75:e7:24:ad:ec:f4:42:b4:85:
56
+ 93:70:10:67:ba:9d:06:35:4a:18:d3:2b:7a:cc:51:42:a1:7a:
57
+ 63:d1:e6:bb:a1:c5:2b:c2:36:be:13:0d:e6:bd:63:7e:79:7b:
58
+ a7:09:0d:40:ab:6a:dd:8f:8a:c3:f6:f6:8c:1a:42:05:51:d4:
59
+ 45:f5:9f:a7:62:21:68:15:20:43:3c:99:e7:7c:bd:24:d8:a9:
60
+ 91:17:73:88:3f:56:1b:31:38:18:b4:71:0f:9a:cd:c8:0e:9e:
61
+ 8e:2e:1b:e1:8c:98:83:cb:1f:31:f1:44:4c:c6:04:73:49:76:
62
+ 60:0f:c7:f8:bd:17:80:6b:2e:e9:cc:4c:0e:5a:9a:79:0f:20:
63
+ 0a:2e:d5:9e:63:26:1e:55:92:94:d8:82:17:5a:7b:d0:bc:c7:
64
+ 8f:4e:86:04
65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N
84
+ AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
85
+ YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
86
+ 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
87
+ Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
88
+ c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
89
+ mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
32
90
  -----END CERTIFICATE-----
@@ -0,0 +1,90 @@
1
+ This CA certificate is for verifying HTTPS connection to;
2
+ - https://d2chzxaqi4y7f8.cloudfront.net/ (prepared by AWS)
3
+
4
+ Certificate:
5
+ Data:
6
+ Version: 3 (0x2)
7
+ Serial Number: 927650371 (0x374ad243)
8
+ Signature Algorithm: sha1WithRSAEncryption
9
+ Issuer: C=US, O=Entrust.net, OU=www.entrust.net/CPS incorp. by ref. (limits liab.), OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Secure Server Certification Authority
10
+ Validity
11
+ Not Before: May 25 16:09:40 1999 GMT
12
+ Not After : May 25 16:39:40 2019 GMT
13
+ Subject: C=US, O=Entrust.net, OU=www.entrust.net/CPS incorp. by ref. (limits liab.), OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Secure Server Certification Authority
14
+ Subject Public Key Info:
15
+ Public Key Algorithm: rsaEncryption
16
+ Public-Key: (1024 bit)
17
+ Modulus:
18
+ 00:cd:28:83:34:54:1b:89:f3:0f:af:37:91:31:ff:
19
+ af:31:60:c9:a8:e8:b2:10:68:ed:9f:e7:93:36:f1:
20
+ 0a:64:bb:47:f5:04:17:3f:23:47:4d:c5:27:19:81:
21
+ 26:0c:54:72:0d:88:2d:d9:1f:9a:12:9f:bc:b3:71:
22
+ d3:80:19:3f:47:66:7b:8c:35:28:d2:b9:0a:df:24:
23
+ da:9c:d6:50:79:81:7a:5a:d3:37:f7:c2:4a:d8:29:
24
+ 92:26:64:d1:e4:98:6c:3a:00:8a:f5:34:9b:65:f8:
25
+ ed:e3:10:ff:fd:b8:49:58:dc:a0:de:82:39:6b:81:
26
+ b1:16:19:61:b9:54:b6:e6:43
27
+ Exponent: 3 (0x3)
28
+ X509v3 extensions:
29
+ Netscape Cert Type:
30
+ SSL CA, S/MIME CA, Object Signing CA
31
+ X509v3 CRL Distribution Points:
32
+
33
+ Full Name:
34
+ DirName: C = US, O = Entrust.net, OU = www.entrust.net/CPS incorp. by ref. (limits liab.), OU = (c) 1999 Entrust.net Limited, CN = Entrust.net Secure Server Certification Authority, CN = CRL1
35
+
36
+ Full Name:
37
+ URI:http://www.entrust.net/CRL/net1.crl
38
+
39
+ X509v3 Private Key Usage Period:
40
+ Not Before: May 25 16:09:40 1999 GMT, Not After: May 25 16:09:40 2019 GMT
41
+ X509v3 Key Usage:
42
+ Certificate Sign, CRL Sign
43
+ X509v3 Authority Key Identifier:
44
+ keyid:F0:17:62:13:55:3D:B3:FF:0A:00:6B:FB:50:84:97:F3:ED:62:D0:1A
45
+
46
+ X509v3 Subject Key Identifier:
47
+ F0:17:62:13:55:3D:B3:FF:0A:00:6B:FB:50:84:97:F3:ED:62:D0:1A
48
+ X509v3 Basic Constraints:
49
+ CA:TRUE
50
+ 1.2.840.113533.7.65.0:
51
+ 0
52
+ ..V4.0....
53
+ Signature Algorithm: sha1WithRSAEncryption
54
+ 90:dc:30:02:fa:64:74:c2:a7:0a:a5:7c:21:8d:34:17:a8:fb:
55
+ 47:0e:ff:25:7c:8d:13:0a:fb:e4:98:b5:ef:8c:f8:c5:10:0d:
56
+ f7:92:be:f1:c3:d5:d5:95:6a:04:bb:2c:ce:26:36:65:c8:31:
57
+ c6:e7:ee:3f:e3:57:75:84:7a:11:ef:46:4f:18:f4:d3:98:bb:
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EP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC
77
+ AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb
78
+ oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5
79
+ BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p
80
+ dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk
81
+ MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp
82
+ b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu
83
+ dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0
84
+ MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi
85
+ E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa
86
+ MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI
87
+ hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN
88
+ 95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd
89
+ 2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
90
+ -----END CERTIFICATE-----
@@ -0,0 +1,57 @@
1
+ This CA certificate is for verifying HTTPS connection to;
2
+ - https://s3.amazon.com/ (prepared by AWS)
3
+
4
+ Certificate:
5
+ Data:
6
+ Version: 1 (0x0)
7
+ Serial Number:
8
+ 7d:d9:fe:07:cf:a8:1e:b7:10:79:67:fb:a7:89:34:c6
9
+ Signature Algorithm: sha1WithRSAEncryption
10
+ Issuer: C=US, O=VeriSign, Inc., OU=Class 3 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network
11
+ Validity
12
+ Not Before: May 18 00:00:00 1998 GMT
13
+ Not After : Aug 1 23:59:59 2028 GMT
14
+ Subject: C=US, O=VeriSign, Inc., OU=Class 3 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network
15
+ Subject Public Key Info:
16
+ Public Key Algorithm: rsaEncryption
17
+ Public-Key: (1024 bit)
18
+ Modulus:
19
+ 00:cc:5e:d1:11:5d:5c:69:d0:ab:d3:b9:6a:4c:99:
20
+ 1f:59:98:30:8e:16:85:20:46:6d:47:3f:d4:85:20:
21
+ 84:e1:6d:b3:f8:a4:ed:0c:f1:17:0f:3b:f9:a7:f9:
22
+ 25:d7:c1:cf:84:63:f2:7c:63:cf:a2:47:f2:c6:5b:
23
+ 33:8e:64:40:04:68:c1:80:b9:64:1c:45:77:c7:d8:
24
+ 6e:f5:95:29:3c:50:e8:34:d7:78:1f:a8:ba:6d:43:
25
+ 91:95:8f:45:57:5e:7e:c5:fb:ca:a4:04:eb:ea:97:
26
+ 37:54:30:6f:bb:01:47:32:33:cd:dc:57:9b:64:69:
27
+ 61:f8:9b:1d:1c:89:4f:5c:67
28
+ Exponent: 65537 (0x10001)
29
+ Signature Algorithm: sha1WithRSAEncryption
30
+ 51:4d:cd:be:5c:cb:98:19:9c:15:b2:01:39:78:2e:4d:0f:67:
31
+ 70:70:99:c6:10:5a:94:a4:53:4d:54:6d:2b:af:0d:5d:40:8b:
32
+ 64:d3:d7:ee:de:56:61:92:5f:a6:c4:1d:10:61:36:d3:2c:27:
33
+ 3c:e8:29:09:b9:11:64:74:cc:b5:73:9f:1c:48:a9:bc:61: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Xn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID
53
+ AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk
54
+ U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i
55
+ F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY
56
+ oJ2daZH9
57
+ -----END CERTIFICATE-----
@@ -46,6 +46,8 @@ module YAML
46
46
  end
47
47
  end
48
48
  end
49
+
50
+ SyntaxError = Error unless defined? SyntaxError
49
51
  end
50
52
 
51
53
  # Sometime in the 1.9 dev cycle, the Syck constant was moved from under YAML
@@ -1,6 +1,4 @@
1
- at_exit { $SAFE = 1 }
2
-
3
- gem 'minitest', '~> 4.0'
1
+ # TODO: $SAFE = 1
4
2
 
5
3
  if defined? Gem::QuickLoader
6
4
  Gem::QuickLoader.load_full_rubygems_library
@@ -13,7 +11,14 @@ begin
13
11
  rescue Gem::LoadError
14
12
  end
15
13
 
16
- require "rubygems/deprecate"
14
+ # We have to load these up front because otherwise we'll try to load
15
+ # them while we're testing rubygems, and thus we can't actually load them.
16
+ unless Gem::Dependency.new('rdoc', '>= 3.10').matching_specs.empty?
17
+ gem 'rdoc'
18
+ gem 'json'
19
+ end
20
+
21
+ require 'rubygems/deprecate'
17
22
  require 'minitest/autorun'
18
23
  require 'fileutils'
19
24
  require 'tmpdir'
@@ -23,7 +28,6 @@ require 'rubygems/test_utilities'
23
28
  require 'pp'
24
29
  require 'zlib'
25
30
  require 'pathname'
26
- require 'shellwords'
27
31
  Gem.load_yaml
28
32
 
29
33
  require 'rubygems/mock_gem_ui'
@@ -38,16 +42,6 @@ module Gem
38
42
  @searcher = searcher
39
43
  end
40
44
 
41
- ##
42
- # Allows setting the default SourceIndex. This method is available when
43
- # requiring 'rubygems/test_case'
44
-
45
- def self.source_index=(si)
46
- raise "This method is not supported"
47
- Gem::Specification.reset if si # HACK
48
- @@source_index = si
49
- end
50
-
51
45
  ##
52
46
  # Allows toggling Windows behavior. This method is available when requiring
53
47
  # 'rubygems/test_case'
@@ -95,69 +89,14 @@ class Gem::TestCase < MiniTest::Unit::TestCase
95
89
  refute File.exist?(path), msg
96
90
  end
97
91
 
98
- def scan_make_command_lines(output)
99
- output.scan(/^#{Regexp.escape make_command}(?:[[:blank:]].*)?$/)
100
- end
101
-
102
- def parse_make_command_line(line)
103
- command, *args = line.shellsplit
104
-
105
- targets = []
106
- macros = {}
107
-
108
- args.each do |arg|
109
- case arg
110
- when /\A(\w+)=/
111
- macros[$1] = $'
112
- else
113
- targets << arg
114
- end
115
- end
116
-
117
- targets << '' if targets.empty?
118
-
119
- {
120
- :command => command,
121
- :targets => targets,
122
- :macros => macros,
123
- }
124
- end
125
-
126
- def assert_contains_make_command(target, output, msg = nil)
127
- if output.match(/\n/)
128
- msg = message(msg) {
129
- 'Expected output containing make command "%s": %s' % [
130
- ('%s %s' % [make_command, target]).rstrip,
131
- output.inspect
132
- ]
133
- }
134
- else
135
- msg = message(msg) {
136
- 'Expected make command "%s": %s' % [
137
- ('%s %s' % [make_command, target]).rstrip,
138
- output.inspect
139
- ]
140
- }
141
- end
142
-
143
- assert scan_make_command_lines(output).any? { |line|
144
- make = parse_make_command_line(line)
145
-
146
- if make[:targets].include?(target)
147
- yield make, line if block_given?
148
- true
149
- else
150
- false
151
- end
152
- }, msg
153
- end
154
-
155
92
  include Gem::DefaultUserInteraction
156
93
 
157
94
  undef_method :default_test if instance_methods.include? 'default_test' or
158
95
  instance_methods.include? :default_test
159
96
 
160
- @@project_dir = Dir.pwd unless defined?(@@project_dir)
97
+ @@project_dir = Dir.pwd.untaint unless defined?(@@project_dir)
98
+
99
+ @@initial_reset = false
161
100
 
162
101
  ##
163
102
  # #setup prepares a sandboxed location to install gems. All installs are
@@ -179,8 +118,8 @@ class Gem::TestCase < MiniTest::Unit::TestCase
179
118
  @current_dir = Dir.pwd
180
119
  @ui = Gem::MockGemUi.new
181
120
 
182
- tmpdir = nil
183
- Dir.chdir Dir.tmpdir do tmpdir = Dir.pwd end # HACK OSX /private/tmp
121
+ # Need to do this in the project because $SAFE fucks up _everything_
122
+ tmpdir = File.expand_path("tmp/test")
184
123
 
185
124
  if ENV['KEEP_FILES'] then
186
125
  @tempdir = File.join(tmpdir, "test_rubygems_#{$$}.#{Time.now.to_i}")
@@ -192,14 +131,14 @@ class Gem::TestCase < MiniTest::Unit::TestCase
192
131
  @userhome = File.join @tempdir, 'userhome'
193
132
 
194
133
  @orig_ruby = if ruby = ENV['RUBY'] then
195
- Gem.class_eval { ruby, @ruby = @ruby, ruby }
134
+ Gem.class_eval { ruby, @ruby = @ruby, ruby.dup }
196
135
  ruby
197
136
  end
198
137
 
199
138
  Gem.ensure_gem_subdirectories @gemhome
200
139
 
201
140
  @orig_LOAD_PATH = $LOAD_PATH.dup
202
- $LOAD_PATH.map! { |s| File.expand_path s }
141
+ $LOAD_PATH.map! { |s| File.expand_path(s).untaint }
203
142
 
204
143
  Dir.chdir @tempdir
205
144
 
@@ -210,21 +149,39 @@ class Gem::TestCase < MiniTest::Unit::TestCase
210
149
  FileUtils.mkdir_p @gemhome
211
150
  FileUtils.mkdir_p @userhome
212
151
 
152
+ @default_dir = File.join @tempdir, 'default'
153
+ @default_spec_dir = File.join @default_dir, "specifications", "default"
154
+ Gem.instance_variable_set :@default_dir, @default_dir
155
+ FileUtils.mkdir_p @default_spec_dir
156
+
157
+ # We use Gem::Specification.reset the first time only so that if there
158
+ # are unresolved deps that leak into the whole test suite, they're at least
159
+ # reported once.
160
+ if @@initial_reset
161
+ Gem::Specification.unresolved_deps.clear # done to avoid cross-test warnings
162
+ else
163
+ @@initial_reset = true
164
+ Gem::Specification.reset
165
+ end
213
166
  Gem.use_paths(@gemhome)
214
167
 
168
+ Gem::Security.reset
169
+
215
170
  Gem.loaded_specs.clear
216
- Gem.unresolved_deps.clear
171
+ Gem.clear_default_specs
172
+ Gem::Specification.unresolved_deps.clear
217
173
 
218
174
  Gem.configuration.verbose = true
219
175
  Gem.configuration.update_sources = true
220
176
 
177
+ Gem::RemoteFetcher.fetcher = Gem::FakeFetcher.new
178
+
221
179
  @gem_repo = "http://gems.example.com/"
222
180
  @uri = URI.parse @gem_repo
223
181
  Gem.sources.replace [@gem_repo]
224
182
 
225
183
  Gem.searcher = nil
226
184
  Gem::SpecFetcher.fetcher = nil
227
-
228
185
  @orig_BASERUBY = Gem::ConfigMap[:BASERUBY]
229
186
  Gem::ConfigMap[:BASERUBY] = Gem::ConfigMap[:ruby_install_name]
230
187
 
@@ -241,8 +198,11 @@ class Gem::TestCase < MiniTest::Unit::TestCase
241
198
  # TODO: move to installer test cases
242
199
  Gem.post_build_hooks.clear
243
200
  Gem.post_install_hooks.clear
201
+ Gem.done_installing_hooks.clear
202
+ Gem.post_reset_hooks.clear
244
203
  Gem.post_uninstall_hooks.clear
245
204
  Gem.pre_install_hooks.clear
205
+ Gem.pre_reset_hooks.clear
246
206
  Gem.pre_uninstall_hooks.clear
247
207
 
248
208
  # TODO: move to installer test cases
@@ -274,7 +234,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
274
234
  # tempdir unless the +KEEP_FILES+ environment variable was set.
275
235
 
276
236
  def teardown
277
- $LOAD_PATH.replace @orig_LOAD_PATH
237
+ $LOAD_PATH.replace @orig_LOAD_PATH if @orig_LOAD_PATH
278
238
 
279
239
  Gem::ConfigMap[:BASERUBY] = @orig_BASERUBY
280
240
  Gem::ConfigMap[:arch] = @orig_arch
@@ -298,6 +258,8 @@ class Gem::TestCase < MiniTest::Unit::TestCase
298
258
  else
299
259
  ENV.delete 'HOME'
300
260
  end
261
+
262
+ Gem.instance_variable_set :@default_dir, nil
301
263
  end
302
264
 
303
265
  ##
@@ -306,13 +268,17 @@ class Gem::TestCase < MiniTest::Unit::TestCase
306
268
  def install_gem spec, options = {}
307
269
  require 'rubygems/installer'
308
270
 
309
- use_ui Gem::MockGemUi.new do
310
- Dir.chdir @tempdir do
311
- Gem::Builder.new(spec).build
271
+ gem = File.join @tempdir, "gems", "#{spec.full_name}.gem"
272
+
273
+ unless File.exists? gem
274
+ use_ui Gem::MockGemUi.new do
275
+ Dir.chdir @tempdir do
276
+ Gem::Package.build spec
277
+ end
312
278
  end
313
- end
314
279
 
315
- gem = File.join(@tempdir, File.basename(spec.cache_file)).untaint
280
+ gem = File.join(@tempdir, File.basename(spec.cache_file)).untaint
281
+ end
316
282
 
317
283
  Gem::Installer.new(gem, options.merge({:wrappers => true})).install
318
284
  end
@@ -335,6 +301,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
335
301
 
336
302
  ##
337
303
  # creates a temporary directory with hax
304
+ # TODO: deprecate and remove
338
305
 
339
306
  def create_tmpdir
340
307
  tmpdir = nil
@@ -395,8 +362,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
395
362
  # homepage, summary and description are defaulted. The specification is
396
363
  # yielded for customization.
397
364
  #
398
- # The gem is added to the installed gems in +@gemhome+ and to the current
399
- # source_index.
365
+ # The gem is added to the installed gems in +@gemhome+ and the runtime.
400
366
  #
401
367
  # Use this with #write_file to build an installed gem.
402
368
 
@@ -469,7 +435,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
469
435
  end
470
436
 
471
437
  use_ui Gem::MockGemUi.new do
472
- Gem::Builder.new(spec).build
438
+ Gem::Package.build spec
473
439
  end
474
440
 
475
441
  cache = spec.cache_file
@@ -499,6 +465,16 @@ class Gem::TestCase < MiniTest::Unit::TestCase
499
465
  Gem.searcher = nil
500
466
  end
501
467
 
468
+ ##
469
+ # Install the provided default specs
470
+
471
+ def install_default_specs(*specs)
472
+ install_specs(*specs)
473
+ specs.each do |spec|
474
+ Gem.register_default_spec(spec)
475
+ end
476
+ end
477
+
502
478
  ##
503
479
  # Create a new spec (or gem if passed an array of files) and set it
504
480
  # up properly. Use this instead of util_spec and util_gem.
@@ -543,6 +519,24 @@ class Gem::TestCase < MiniTest::Unit::TestCase
543
519
  spec
544
520
  end
545
521
 
522
+ def new_default_spec(name, version, deps = nil, *files)
523
+ spec = new_spec(name, version, deps)
524
+ spec.loaded_from = File.join(@default_spec_dir, spec.spec_name)
525
+ spec.files = files
526
+
527
+ lib_dir = File.join(@tempdir, "default_gems", "lib")
528
+ $LOAD_PATH.unshift(lib_dir)
529
+ files.each do |file|
530
+ rb_path = File.join(lib_dir, file)
531
+ FileUtils.mkdir_p(File.dirname(rb_path))
532
+ File.open(rb_path, "w") do |rb|
533
+ rb << "# #{file}"
534
+ end
535
+ end
536
+
537
+ spec
538
+ end
539
+
546
540
  ##
547
541
  # Creates a spec with +name+, +version+ and +deps+.
548
542
 
@@ -657,6 +651,12 @@ Also, a list:
657
651
  @a_evil9 = quick_gem('a_evil', '9', &init)
658
652
  @b2 = quick_gem('b', '2', &init)
659
653
  @c1_2 = quick_gem('c', '1.2', &init)
654
+ @x = quick_gem('x', '1', &init)
655
+ @dep_x = quick_gem('dep_x', '1') do |s|
656
+ s.files = %w[lib/code.rb]
657
+ s.require_paths = %w[lib]
658
+ s.add_dependency 'x', '>= 1'
659
+ end
660
660
 
661
661
  @pl1 = quick_gem 'pl', '1' do |s| # l for legacy
662
662
  s.files = %w[lib/code.rb]
@@ -677,8 +677,10 @@ Also, a list:
677
677
  write_file File.join(*%W[gems #{@b2.original_name} lib code.rb])
678
678
  write_file File.join(*%W[gems #{@c1_2.original_name} lib code.rb])
679
679
  write_file File.join(*%W[gems #{@pl1.original_name} lib code.rb])
680
+ write_file File.join(*%W[gems #{@x.original_name} lib code.rb])
681
+ write_file File.join(*%W[gems #{@dep_x.original_name} lib code.rb])
680
682
 
681
- [@a1, @a2, @a3a, @a_evil9, @b2, @c1_2, @pl1].each do |spec|
683
+ [@a1, @a2, @a3a, @a_evil9, @b2, @c1_2, @pl1, @x, @dep_x].each do |spec|
682
684
  util_build_gem spec
683
685
  end
684
686
 
@@ -723,6 +725,15 @@ Also, a list:
723
725
  Gem::RemoteFetcher.fetcher = @fetcher
724
726
  end
725
727
 
728
+ ##
729
+ # Add +spec+ to +@fetcher+ serving the data in the file +path+.
730
+ # +repo+ indicates which repo to make +spec+ appear to be in.
731
+
732
+ def add_to_fetcher(spec, path=nil, repo=@gem_repo)
733
+ path ||= spec.cache_file
734
+ @fetcher.data["#{@gem_repo}gems/#{spec.file_name}"] = read_binary(path)
735
+ end
736
+
726
737
  ##
727
738
  # Sets up Gem::SpecFetcher to return information from the gems in +specs+.
728
739
  # Best used with +@all_gems+ from #util_setup_fake_fetcher.
@@ -733,26 +744,23 @@ Also, a list:
733
744
 
734
745
  spec_fetcher = Gem::SpecFetcher.fetcher
735
746
 
736
- prerelease, _ = Gem::Specification.partition { |spec|
747
+ prerelease, all = Gem::Specification.partition { |spec|
737
748
  spec.version.prerelease?
738
749
  }
739
750
 
740
751
  spec_fetcher.specs[@uri] = []
741
- Gem::Specification.each do |spec|
742
- spec_tuple = [spec.name, spec.version, spec.original_platform]
743
- spec_fetcher.specs[@uri] << spec_tuple
752
+ all.each do |spec|
753
+ spec_fetcher.specs[@uri] << spec.name_tuple
744
754
  end
745
755
 
746
756
  spec_fetcher.latest_specs[@uri] = []
747
757
  Gem::Specification.latest_specs.each do |spec|
748
- spec_tuple = [spec.name, spec.version, spec.original_platform]
749
- spec_fetcher.latest_specs[@uri] << spec_tuple
758
+ spec_fetcher.latest_specs[@uri] << spec.name_tuple
750
759
  end
751
760
 
752
761
  spec_fetcher.prerelease_specs[@uri] = []
753
762
  prerelease.each do |spec|
754
- spec_tuple = [spec.name, spec.version, spec.original_platform]
755
- spec_fetcher.prerelease_specs[@uri] << spec_tuple
763
+ spec_fetcher.prerelease_specs[@uri] << spec.name_tuple
756
764
  end
757
765
 
758
766
  v = Gem.marshal_version
@@ -829,6 +837,14 @@ Also, a list:
829
837
  system('nmake /? 1>NUL 2>&1')
830
838
  end
831
839
 
840
+ # In case we're building docs in a background process, this method waits for
841
+ # that process to exit (or if it's already been reaped, or never happened,
842
+ # swallows the Errno::ECHILD error).
843
+ def wait_for_child_process_to_exit
844
+ Process.wait if Process.respond_to?(:fork)
845
+ rescue Errno::ECHILD
846
+ end
847
+
832
848
  ##
833
849
  # Allows tests to use a random (but controlled) port number instead of
834
850
  # a hardcoded one. This helps CI tools when running parallels builds on
@@ -848,12 +864,13 @@ Also, a list:
848
864
  ##
849
865
  # Allows the proper version of +rake+ to be used for the test.
850
866
 
851
- def build_rake_in
867
+ def build_rake_in(good=true)
852
868
  gem_ruby = Gem.ruby
853
869
  Gem.ruby = @@ruby
854
870
  env_rake = ENV["rake"]
855
- ENV["rake"] = @@rake
856
- yield @@rake
871
+ rake = (good ? @@good_rake : @@bad_rake)
872
+ ENV["rake"] = rake
873
+ yield rake
857
874
  ensure
858
875
  Gem.ruby = gem_ruby
859
876
  if env_rake
@@ -893,15 +910,8 @@ Also, a list:
893
910
  end
894
911
 
895
912
  @@ruby = rubybin
896
- env_rake = ENV['rake']
897
- ruby19_rake = File.expand_path("bin/rake", @@project_dir)
898
- @@rake = if env_rake then
899
- ENV["rake"]
900
- elsif File.exist? ruby19_rake then
901
- @@ruby + " " + ruby19_rake
902
- else
903
- 'rake'
904
- end
913
+ @@good_rake = "#{rubybin} #{File.expand_path('../../../test/rubygems/good_rake.rb', __FILE__)}"
914
+ @@bad_rake = "#{rubybin} #{File.expand_path('../../../test/rubygems/bad_rake.rb', __FILE__)}"
905
915
 
906
916
  ##
907
917
  # Construct a new Gem::Dependency.
@@ -932,4 +942,84 @@ Also, a list:
932
942
  Gem::Version.create string
933
943
  end
934
944
 
945
+ class StaticSet
946
+ def initialize(specs)
947
+ @specs = specs.sort_by { |s| s.full_name }
948
+ end
949
+
950
+ def find_spec(dep)
951
+ @specs.reverse_each do |s|
952
+ return s if dep.matches_spec? s
953
+ end
954
+ end
955
+
956
+ def find_all(dep)
957
+ @specs.find_all { |s| dep.matches_spec? s }
958
+ end
959
+
960
+ def prefetch(reqs)
961
+ end
962
+ end
963
+
964
+ ##
965
+ # Loads certificate named +cert_name+ from <tt>test/rubygems/</tt>.
966
+
967
+ def self.load_cert cert_name
968
+ cert_file = cert_path cert_name
969
+
970
+ cert = File.read cert_file
971
+
972
+ OpenSSL::X509::Certificate.new cert
973
+ end
974
+
975
+ ##
976
+ # Returns the path to the certificate named +cert_name+ from
977
+ # <tt>test/rubygems/</tt>.
978
+
979
+ def self.cert_path cert_name
980
+ if 32 == (Time.at(2**32) rescue 32) then
981
+ cert_file =
982
+ File.expand_path "../../../test/rubygems/#{cert_name}_cert_32.pem",
983
+ __FILE__
984
+
985
+ return cert_file if File.exist? cert_file
986
+ end
987
+
988
+ File.expand_path "../../../test/rubygems/#{cert_name}_cert.pem", __FILE__
989
+ end
990
+
991
+ ##
992
+ # Loads an RSA private key named +key_name+ in <tt>test/rubygems/</tt>
993
+
994
+ def self.load_key key_name
995
+ key_file = key_path key_name
996
+
997
+ key = File.read key_file
998
+
999
+ OpenSSL::PKey::RSA.new key
1000
+ end
1001
+
1002
+ ##
1003
+ # Returns the path tot he key named +key_name+ from <tt>test/rubygems</tt>
1004
+
1005
+ def self.key_path key_name
1006
+ File.expand_path "../../../test/rubygems/#{key_name}_key.pem", __FILE__
1007
+ end
1008
+
1009
+ # :stopdoc:
1010
+ # only available in RubyGems tests
1011
+
1012
+ begin
1013
+ PRIVATE_KEY = load_key 'private'
1014
+ PRIVATE_KEY_PATH = key_path 'private'
1015
+ PUBLIC_KEY = PRIVATE_KEY.public_key
1016
+
1017
+ PUBLIC_CERT = load_cert 'public'
1018
+ PUBLIC_CERT_PATH = cert_path 'public'
1019
+ rescue Errno::ENOENT
1020
+ PRIVATE_KEY = nil
1021
+ PUBLIC_KEY = nil
1022
+ PUBLIC_CERT = nil
1023
+ end
1024
+
935
1025
  end