rubygems-update 2.0.17 → 2.1.0.rc.1

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 (154) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +2 -0
  4. data/.autotest +1 -1
  5. data/History.txt +82 -153
  6. data/Manifest.txt +35 -9
  7. data/Rakefile +35 -36
  8. data/lib/rubygems.rb +106 -18
  9. data/lib/rubygems/available_set.rb +68 -0
  10. data/lib/rubygems/basic_specification.rb +139 -0
  11. data/lib/rubygems/command_manager.rb +37 -40
  12. data/lib/rubygems/commands/cert_command.rb +78 -29
  13. data/lib/rubygems/commands/cleanup_command.rb +2 -2
  14. data/lib/rubygems/commands/contents_command.rb +101 -58
  15. data/lib/rubygems/commands/dependency_command.rb +94 -53
  16. data/lib/rubygems/commands/environment_command.rb +70 -53
  17. data/lib/rubygems/commands/fetch_command.rb +1 -2
  18. data/lib/rubygems/commands/help_command.rb +85 -55
  19. data/lib/rubygems/commands/install_command.rb +84 -42
  20. data/lib/rubygems/commands/outdated_command.rb +2 -12
  21. data/lib/rubygems/commands/owner_command.rb +6 -0
  22. data/lib/rubygems/commands/pristine_command.rb +26 -16
  23. data/lib/rubygems/commands/sources_command.rb +85 -70
  24. data/lib/rubygems/commands/uninstall_command.rb +32 -2
  25. data/lib/rubygems/commands/update_command.rb +111 -75
  26. data/lib/rubygems/config_file.rb +15 -3
  27. data/lib/rubygems/core_ext/kernel_require.rb +9 -31
  28. data/lib/rubygems/defaults.rb +8 -0
  29. data/lib/rubygems/dependency.rb +4 -2
  30. data/lib/rubygems/dependency_installer.rb +180 -170
  31. data/lib/rubygems/dependency_resolver.rb +191 -526
  32. data/lib/rubygems/dependency_resolver/activation_request.rb +109 -0
  33. data/lib/rubygems/dependency_resolver/api_set.rb +65 -0
  34. data/lib/rubygems/dependency_resolver/api_specification.rb +36 -0
  35. data/lib/rubygems/dependency_resolver/composed_set.rb +18 -0
  36. data/lib/rubygems/dependency_resolver/current_set.rb +16 -0
  37. data/lib/rubygems/dependency_resolver/dependency_conflict.rb +85 -0
  38. data/lib/rubygems/dependency_resolver/dependency_request.rb +51 -0
  39. data/lib/rubygems/dependency_resolver/index_set.rb +59 -0
  40. data/lib/rubygems/dependency_resolver/index_specification.rb +53 -0
  41. data/lib/rubygems/dependency_resolver/installed_specification.rb +38 -0
  42. data/lib/rubygems/dependency_resolver/installer_set.rb +130 -0
  43. data/lib/rubygems/exceptions.rb +88 -1
  44. data/lib/rubygems/ext/builder.rb +1 -1
  45. data/lib/rubygems/gem_runner.rb +17 -9
  46. data/lib/rubygems/gemcutter_utilities.rb +72 -42
  47. data/lib/rubygems/install_default_message.rb +12 -0
  48. data/lib/rubygems/install_update_options.rb +3 -0
  49. data/lib/rubygems/installer.rb +55 -30
  50. data/lib/rubygems/name_tuple.rb +18 -7
  51. data/lib/rubygems/package.rb +50 -25
  52. data/lib/rubygems/package/tar_test_case.rb +9 -9
  53. data/lib/rubygems/package/tar_writer.rb +35 -12
  54. data/lib/rubygems/package_task.rb +2 -5
  55. data/lib/rubygems/path_support.rb +10 -0
  56. data/lib/rubygems/platform.rb +9 -3
  57. data/lib/rubygems/psych_additions.rb +1 -1
  58. data/lib/rubygems/remote_fetcher.rb +9 -276
  59. data/lib/rubygems/request.rb +267 -0
  60. data/lib/rubygems/request_set.rb +123 -125
  61. data/lib/rubygems/request_set/gem_dependency_api.rb +39 -0
  62. data/lib/rubygems/security.rb +32 -23
  63. data/lib/rubygems/security/policy.rb +35 -9
  64. data/lib/rubygems/security/signer.rb +2 -2
  65. data/lib/rubygems/server.rb +8 -16
  66. data/lib/rubygems/source.rb +25 -14
  67. data/lib/rubygems/source/installed.rb +28 -0
  68. data/lib/rubygems/source/local.rb +122 -0
  69. data/lib/rubygems/source/specific_file.rb +28 -0
  70. data/lib/rubygems/source_local.rb +2 -89
  71. data/lib/rubygems/source_specific_file.rb +2 -26
  72. data/lib/rubygems/spec_fetcher.rb +11 -11
  73. data/lib/rubygems/specification.rb +186 -198
  74. data/lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem +88 -30
  75. data/lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem +90 -0
  76. data/lib/rubygems/ssl_certs/{GeoTrustGlobalCA.pem → GeoTrust_Global_CA.pem} +20 -20
  77. data/lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem +57 -0
  78. data/lib/rubygems/stub_specification.rb +119 -0
  79. data/lib/rubygems/test_case.rb +117 -49
  80. data/lib/rubygems/uninstaller.rb +14 -9
  81. data/lib/rubygems/uri_formatter.rb +39 -0
  82. data/lib/rubygems/util/list.rb +44 -0
  83. data/lib/rubygems/version.rb +15 -5
  84. data/lib/rubygems/version_option.rb +8 -2
  85. data/test/rubygems/ca_cert.pem +23 -0
  86. data/test/rubygems/client.pem +49 -0
  87. data/test/rubygems/encrypted_private_key.pem +30 -0
  88. data/test/rubygems/invalid_client.pem +49 -0
  89. data/test/rubygems/specifications/bar-0.0.2.gemspec +9 -0
  90. data/test/rubygems/specifications/foo-0.0.1.gemspec +0 -0
  91. data/test/rubygems/test_gem.rb +76 -454
  92. data/test/rubygems/test_gem_command_manager.rb +23 -21
  93. data/test/rubygems/test_gem_commands_cert_command.rb +154 -14
  94. data/test/rubygems/test_gem_commands_cleanup_command.rb +15 -0
  95. data/test/rubygems/test_gem_commands_contents_command.rb +32 -4
  96. data/test/rubygems/test_gem_commands_environment_command.rb +9 -1
  97. data/test/rubygems/test_gem_commands_fetch_command.rb +2 -28
  98. data/test/rubygems/test_gem_commands_help_command.rb +6 -3
  99. data/test/rubygems/test_gem_commands_install_command.rb +2 -65
  100. data/test/rubygems/test_gem_commands_owner_command.rb +49 -0
  101. data/test/rubygems/test_gem_commands_pristine_command.rb +30 -0
  102. data/test/rubygems/test_gem_commands_sources_command.rb +1 -1
  103. data/test/rubygems/test_gem_commands_uninstall_command.rb +33 -0
  104. data/test/rubygems/test_gem_commands_update_command.rb +2 -1
  105. data/test/rubygems/test_gem_config_file.rb +12 -0
  106. data/test/rubygems/test_gem_dependency_installer.rb +58 -65
  107. data/test/rubygems/test_gem_dependency_resolver.rb +6 -3
  108. data/test/rubygems/test_gem_dependency_resolver_dependency_conflict.rb +36 -0
  109. data/test/rubygems/test_gem_ext_builder.rb +2 -4
  110. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +7 -2
  111. data/test/rubygems/test_gem_gem_runner.rb +17 -13
  112. data/test/rubygems/test_gem_gemcutter_utilities.rb +6 -19
  113. data/test/rubygems/test_gem_impossible_dependencies_error.rb +41 -0
  114. data/test/rubygems/test_gem_install_update_options.rb +4 -1
  115. data/test/rubygems/test_gem_installer.rb +31 -2
  116. data/test/rubygems/test_gem_name_tuple.rb +22 -0
  117. data/test/rubygems/test_gem_package.rb +122 -11
  118. data/test/rubygems/test_gem_package_old.rb +8 -0
  119. data/test/rubygems/test_gem_package_tar_reader.rb +9 -8
  120. data/test/rubygems/test_gem_package_tar_reader_entry.rb +1 -1
  121. data/test/rubygems/test_gem_package_tar_writer.rb +78 -56
  122. data/test/rubygems/test_gem_package_task.rb +2 -23
  123. data/test/rubygems/test_gem_path_support.rb +17 -0
  124. data/test/rubygems/test_gem_platform.rb +18 -0
  125. data/test/rubygems/test_gem_remote_fetcher.rb +106 -385
  126. data/test/rubygems/test_gem_request.rb +239 -0
  127. data/test/rubygems/test_gem_requirement.rb +9 -11
  128. data/test/rubygems/test_gem_security.rb +58 -2
  129. data/test/rubygems/test_gem_security_policy.rb +42 -1
  130. data/test/rubygems/test_gem_security_signer.rb +13 -1
  131. data/test/rubygems/test_gem_security_trust_dir.rb +5 -1
  132. data/test/rubygems/test_gem_server.rb +1 -105
  133. data/test/rubygems/test_gem_source.rb +4 -14
  134. data/test/rubygems/test_gem_source_local.rb +4 -4
  135. data/test/rubygems/test_gem_source_specific_file.rb +1 -1
  136. data/test/rubygems/test_gem_spec_fetcher.rb +0 -12
  137. data/test/rubygems/test_gem_specification.rb +452 -28
  138. data/test/rubygems/test_gem_stub_specification.rb +30 -0
  139. data/test/rubygems/test_gem_uninstaller.rb +14 -0
  140. data/test/rubygems/test_gem_uri_formatter.rb +20 -0
  141. data/test/rubygems/test_gem_version.rb +23 -13
  142. data/test/rubygems/test_gem_version_option.rb +63 -1
  143. data/test/rubygems/test_require.rb +0 -12
  144. data/util/create_encrypted_key.rb +16 -0
  145. metadata +161 -23
  146. metadata.gz.sig +0 -0
  147. data/CVE-2013-4287.txt +0 -36
  148. data/CVE-2013-4363.txt +0 -45
  149. data/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
  150. data/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
  151. data/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
  152. data/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
  153. data/test/rubygems/test_bundled_ca.rb +0 -59
  154. 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
+
1
66
  -----BEGIN CERTIFICATE-----
2
- MIIFdDCCBFygAwIBAgIQJ2buVutJ846r13Ci/ITeIjANBgkqhkiG9w0BAQwFADBv
3
- MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
4
- ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
5
- eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow
6
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+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:
58
+ a8:87:32:ba:72:f6:3c:e2:3d:9f:d7:1d:d9:c3:60:43:8c:58:
59
+ 0e:22:96:2f:62:a3:2c:1f:ba:ad:05:ef:ab:32:78:87:a0:54:
60
+ 73:19:b5:5c:05:f9:52:3e:6d:2d:45:0b:f7:0a:93:ea:ed:06:
61
+ f9:b2
62
+
63
+ -----BEGIN CERTIFICATE-----
64
+ MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
65
+ VVMxFDASBgNVBAoTC0VudHJ1c3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ICATE-----
@@ -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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FoUgRm1HP9SFIIThbbP4
51
+ pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0
52
+ 13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID
53
+ AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk
54
+ U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i
55
+ F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY
56
+ oJ2daZH9
57
+ -----END CERTIFICATE-----
@@ -0,0 +1,119 @@
1
+ module Gem
2
+ # Gem::StubSpecification reads the stub: line from the gemspec
3
+ # This prevents us having to eval the entire gemspec in order to
4
+ # find out certain information.
5
+ class StubSpecification < BasicSpecification
6
+ # :nodoc:
7
+ PREFIX = "# stub: "
8
+
9
+ OPEN_MODE = # :nodoc:
10
+ if Object.const_defined? :Encoding then
11
+ 'r:UTF-8:-'
12
+ else
13
+ 'r'
14
+ end
15
+
16
+ # :nodoc:
17
+ class StubLine
18
+ attr_reader :parts
19
+
20
+ def initialize(data)
21
+ @parts = data[PREFIX.length..-1].split(" ")
22
+ end
23
+
24
+ def name
25
+ @parts[0]
26
+ end
27
+
28
+ def version
29
+ Gem::Version.new @parts[1]
30
+ end
31
+
32
+ def platform
33
+ Gem::Platform.new @parts[2]
34
+ end
35
+
36
+ def require_paths
37
+ @parts[3..-1].join(" ").split("\0")
38
+ end
39
+ end
40
+
41
+ def initialize(filename)
42
+ self.filename = filename
43
+ @data = nil
44
+ @spec = nil
45
+ end
46
+
47
+ ##
48
+ # Name of the gem
49
+
50
+ def name
51
+ @name ||= data.name
52
+ end
53
+
54
+ ##
55
+ # Version of the gem
56
+
57
+ def version
58
+ @version ||= data.version
59
+ end
60
+
61
+ ##
62
+ # Platform of the gem
63
+
64
+ def platform
65
+ @platform ||= data.platform
66
+ end
67
+
68
+ ##
69
+ # Require paths of the gem
70
+
71
+ def require_paths
72
+ @require_paths ||= data.require_paths
73
+ end
74
+
75
+ ##
76
+ # The full Gem::Specification for this gem, loaded from evalling its gemspec
77
+
78
+ def to_spec
79
+ @spec ||= Gem::Specification.load(filename)
80
+ end
81
+
82
+ ##
83
+ # True when this gem has been activated
84
+
85
+ def activated?
86
+ loaded = Gem.loaded_specs[name]
87
+ loaded && loaded.version == version
88
+ end
89
+
90
+ ##
91
+ # Is this StubSpecification valid? i.e. have we found a stub line, OR does
92
+ # the filename contain a valid gemspec?
93
+
94
+ def valid?
95
+ data
96
+ end
97
+
98
+ private
99
+
100
+ ##
101
+ # If the gemspec contains a stubline, returns a StubLine instance. Otherwise
102
+ # returns the full Gem::Specification.
103
+
104
+ def data
105
+ unless @data
106
+ open filename, OPEN_MODE do |file|
107
+ begin
108
+ file.readline # discard encoding line
109
+ stubline = file.readline.chomp
110
+ @data = StubLine.new(stubline) if stubline.start_with?(PREFIX)
111
+ rescue EOFError
112
+ end
113
+ end
114
+ end
115
+
116
+ @data ||= to_spec
117
+ end
118
+ end
119
+ end
@@ -58,7 +58,7 @@ module Gem
58
58
  end
59
59
 
60
60
  ##
61
- # Allows setting path to ruby. This method is available when requiring
61
+ # Allows setting path to Ruby. This method is available when requiring
62
62
  # 'rubygems/test_case'
63
63
 
64
64
  def self.ruby= ruby
@@ -84,6 +84,23 @@ end
84
84
 
85
85
  class Gem::TestCase < MiniTest::Unit::TestCase
86
86
 
87
+ def assert_activate expected, *specs
88
+ specs.each do |spec|
89
+ case spec
90
+ when String then
91
+ Gem::Specification.find_by_name(spec).activate
92
+ when Gem::Specification then
93
+ spec.activate
94
+ else
95
+ flunk spec.inspect
96
+ end
97
+ end
98
+
99
+ loaded = Gem.loaded_specs.values.map(&:full_name)
100
+
101
+ assert_equal expected.sort, loaded.sort if expected
102
+ end
103
+
87
104
  # TODO: move to minitest
88
105
  def assert_path_exists path, msg = nil
89
106
  msg = message(msg) { "Expected path '#{path}' to exist" }
@@ -206,10 +223,11 @@ class Gem::TestCase < MiniTest::Unit::TestCase
206
223
 
207
224
  @gemhome = File.join @tempdir, 'gemhome'
208
225
  @userhome = File.join @tempdir, 'userhome'
226
+ ENV["GEM_SPEC_CACHE"] = File.join @tempdir, 'spec_cache'
209
227
 
210
228
  @orig_ruby = if ENV['RUBY'] then
211
- ruby = Gem.instance_variable_get :@ruby
212
- Gem.instance_variable_set :@ruby, ENV['RUBY']
229
+ ruby = Gem.ruby
230
+ Gem.ruby = ENV['RUBY']
213
231
  ruby
214
232
  end
215
233
 
@@ -227,6 +245,9 @@ class Gem::TestCase < MiniTest::Unit::TestCase
227
245
  FileUtils.mkdir_p @gemhome
228
246
  FileUtils.mkdir_p @userhome
229
247
 
248
+ @orig_gem_private_key_passphrase = ENV['GEM_PRIVATE_KEY_PASSPHRASE']
249
+ ENV['GEM_PRIVATE_KEY_PASSPHRASE'] = PRIVATE_KEY_PASSPHRASE
250
+
230
251
  @default_dir = File.join @tempdir, 'default'
231
252
  @default_spec_dir = File.join @default_dir, "specifications", "default"
232
253
  Gem.instance_variable_set :@default_dir, @default_dir
@@ -272,39 +293,6 @@ class Gem::TestCase < MiniTest::Unit::TestCase
272
293
  end
273
294
 
274
295
  @marshal_version = "#{Marshal::MAJOR_VERSION}.#{Marshal::MINOR_VERSION}"
275
-
276
- # TODO: move to installer test cases
277
- Gem.post_build_hooks.clear
278
- Gem.post_install_hooks.clear
279
- Gem.done_installing_hooks.clear
280
- Gem.post_reset_hooks.clear
281
- Gem.post_uninstall_hooks.clear
282
- Gem.pre_install_hooks.clear
283
- Gem.pre_reset_hooks.clear
284
- Gem.pre_uninstall_hooks.clear
285
-
286
- # TODO: move to installer test cases
287
- Gem.post_build do |installer|
288
- @post_build_hook_arg = installer
289
- true
290
- end
291
-
292
- Gem.post_install do |installer|
293
- @post_install_hook_arg = installer
294
- end
295
-
296
- Gem.post_uninstall do |uninstaller|
297
- @post_uninstall_hook_arg = uninstaller
298
- end
299
-
300
- Gem.pre_install do |installer|
301
- @pre_install_hook_arg = installer
302
- true
303
- end
304
-
305
- Gem.pre_uninstall do |uninstaller|
306
- @pre_uninstall_hook_arg = uninstaller
307
- end
308
296
  end
309
297
 
310
298
  ##
@@ -328,8 +316,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
328
316
  ENV['GEM_HOME'] = @orig_gem_home
329
317
  ENV['GEM_PATH'] = @orig_gem_path
330
318
 
331
- _ = @orig_ruby
332
- Gem.instance_variable_set :@ruby, @orig_ruby if @orig_ruby
319
+ Gem.ruby = @orig_ruby if @orig_ruby
333
320
 
334
321
  if @orig_ENV_HOME then
335
322
  ENV['HOME'] = @orig_ENV_HOME
@@ -338,6 +325,47 @@ class Gem::TestCase < MiniTest::Unit::TestCase
338
325
  end
339
326
 
340
327
  Gem.instance_variable_set :@default_dir, nil
328
+
329
+ ENV['GEM_PRIVATE_KEY_PASSPHRASE'] = @orig_gem_private_key_passphrase
330
+
331
+ Gem::Specification._clear_load_cache
332
+ end
333
+
334
+ def common_installer_setup
335
+ common_installer_teardown
336
+
337
+ Gem.post_build do |installer|
338
+ @post_build_hook_arg = installer
339
+ true
340
+ end
341
+
342
+ Gem.post_install do |installer|
343
+ @post_install_hook_arg = installer
344
+ end
345
+
346
+ Gem.post_uninstall do |uninstaller|
347
+ @post_uninstall_hook_arg = uninstaller
348
+ end
349
+
350
+ Gem.pre_install do |installer|
351
+ @pre_install_hook_arg = installer
352
+ true
353
+ end
354
+
355
+ Gem.pre_uninstall do |uninstaller|
356
+ @pre_uninstall_hook_arg = uninstaller
357
+ end
358
+ end
359
+
360
+ def common_installer_teardown
361
+ Gem.post_build_hooks.clear
362
+ Gem.post_install_hooks.clear
363
+ Gem.done_installing_hooks.clear
364
+ Gem.post_reset_hooks.clear
365
+ Gem.post_uninstall_hooks.clear
366
+ Gem.pre_install_hooks.clear
367
+ Gem.pre_reset_hooks.clear
368
+ Gem.pre_uninstall_hooks.clear
341
369
  end
342
370
 
343
371
  ##
@@ -566,6 +594,21 @@ class Gem::TestCase < MiniTest::Unit::TestCase
566
594
  end
567
595
  end
568
596
 
597
+ def loaded_spec_names
598
+ Gem.loaded_specs.values.map(&:full_name).sort
599
+ end
600
+
601
+ def unresolved_names
602
+ Gem::Specification.unresolved_deps.values.map(&:to_s).sort
603
+ end
604
+
605
+ def save_loaded_features
606
+ old_loaded_features = $LOADED_FEATURES.dup
607
+ yield
608
+ ensure
609
+ $LOADED_FEATURES.replace old_loaded_features
610
+ end
611
+
569
612
  ##
570
613
  # Create a new spec (or gem if passed an array of files) and set it
571
614
  # up properly. Use this instead of util_spec and util_gem.
@@ -972,7 +1015,7 @@ Also, a list:
972
1015
  end
973
1016
 
974
1017
  ##
975
- # Finds the path to the ruby executable
1018
+ # Finds the path to the Ruby executable
976
1019
 
977
1020
  def self.rubybin
978
1021
  ruby = ENV["RUBY"]
@@ -1011,6 +1054,24 @@ Also, a list:
1011
1054
  Gem::Dependency.new name, *requirements
1012
1055
  end
1013
1056
 
1057
+ ##
1058
+ # Constructs a Gem::DependencyResolver::DependencyRequest from a
1059
+ # Gem::Dependency +dep+, a +from_name+ and +from_version+ requesting the
1060
+ # dependency and a +parent+ DependencyRequest
1061
+
1062
+ def dependency_request dep, from_name, from_version, parent = nil
1063
+ remote = Gem::Source.new @uri
1064
+
1065
+ parent ||= Gem::DependencyResolver::DependencyRequest.new \
1066
+ dep, nil
1067
+
1068
+ spec = Gem::DependencyResolver::IndexSpecification.new \
1069
+ nil, from_name, from_version, remote, Gem::Platform::RUBY
1070
+ activation = Gem::DependencyResolver::ActivationRequest.new spec, parent
1071
+
1072
+ Gem::DependencyResolver::DependencyRequest.new dep, activation
1073
+ end
1074
+
1014
1075
  ##
1015
1076
  # Constructs a new Gem::Requirement.
1016
1077
 
@@ -1080,18 +1141,18 @@ Also, a list:
1080
1141
  end
1081
1142
 
1082
1143
  ##
1083
- # Loads an RSA private key named +key_name+ in <tt>test/rubygems/</tt>
1144
+ # Loads an RSA private key named +key_name+ with +passphrase+ in <tt>test/rubygems/</tt>
1084
1145
 
1085
- def self.load_key key_name
1146
+ def self.load_key key_name, passphrase = nil
1086
1147
  key_file = key_path key_name
1087
1148
 
1088
1149
  key = File.read key_file
1089
1150
 
1090
- OpenSSL::PKey::RSA.new key
1151
+ OpenSSL::PKey::RSA.new key, passphrase
1091
1152
  end
1092
1153
 
1093
1154
  ##
1094
- # Returns the path tot he key named +key_name+ from <tt>test/rubygems</tt>
1155
+ # Returns the path to the key named +key_name+ from <tt>test/rubygems</tt>
1095
1156
 
1096
1157
  def self.key_path key_name
1097
1158
  File.expand_path "../../../test/rubygems/#{key_name}_key.pem", __FILE__
@@ -1100,17 +1161,24 @@ Also, a list:
1100
1161
  # :stopdoc:
1101
1162
  # only available in RubyGems tests
1102
1163
 
1164
+ PRIVATE_KEY_PASSPHRASE = 'Foo bar'
1165
+
1103
1166
  begin
1104
- PRIVATE_KEY = load_key 'private'
1105
- PRIVATE_KEY_PATH = key_path 'private'
1106
- PUBLIC_KEY = PRIVATE_KEY.public_key
1167
+ PRIVATE_KEY = load_key 'private'
1168
+ PRIVATE_KEY_PATH = key_path 'private'
1169
+
1170
+ # ENCRYPTED_PRIVATE_KEY is PRIVATE_KEY encrypted with PRIVATE_KEY_PASSPHRASE
1171
+ ENCRYPTED_PRIVATE_KEY = load_key 'encrypted_private', PRIVATE_KEY_PASSPHRASE
1172
+ ENCRYPTED_PRIVATE_KEY_PATH = key_path 'encrypted_private'
1107
1173
 
1108
- PUBLIC_CERT = load_cert 'public'
1109
- PUBLIC_CERT_PATH = cert_path 'public'
1174
+ PUBLIC_KEY = PRIVATE_KEY.public_key
1175
+
1176
+ PUBLIC_CERT = load_cert 'public'
1177
+ PUBLIC_CERT_PATH = cert_path 'public'
1110
1178
  rescue Errno::ENOENT
1111
1179
  PRIVATE_KEY = nil
1112
1180
  PUBLIC_KEY = nil
1113
1181
  PUBLIC_CERT = nil
1114
- end
1182
+ end if defined?(OpenSSL::SSL)
1115
1183
 
1116
1184
  end