rubygems-update 2.0.2 → 2.0.3
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.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.autotest +0 -1
- data/History.txt +19 -2
- data/Manifest.txt +0 -1
- data/lib/rubygems.rb +1 -1
- data/lib/rubygems/commands/cert_command.rb +2 -2
- data/lib/rubygems/commands/setup_command.rb +8 -3
- data/lib/rubygems/defaults.rb +14 -0
- data/lib/rubygems/ext/ext_conf_builder.rb +4 -2
- data/lib/rubygems/package.rb +3 -0
- data/lib/rubygems/security/signer.rb +5 -5
- data/lib/rubygems/source.rb +0 -10
- data/lib/rubygems/spec_fetcher.rb +0 -37
- data/test/rubygems/test_gem_commands_cert_command.rb +10 -4
- data/test/rubygems/test_gem_commands_setup_command.rb +22 -7
- data/test/rubygems/test_gem_package.rb +20 -2
- data/test/rubygems/test_gem_package_old.rb +2 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +0 -3
- data/test/rubygems/test_gem_security_signer.rb +9 -7
- data/test/rubygems/test_gem_source.rb +0 -11
- data/test/rubygems/test_gem_spec_fetcher.rb +8 -80
- metadata +4 -6
- metadata.gz.sig +0 -0
- data/test/rubygems/test_gem_dependency_resolver_api_set.rb +0 -80
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3715c090bb9c46a51a84c8eca827fd3bd7ac44c8
|
4
|
+
data.tar.gz: 80c3d4c9042d3c70b4f4581ccbbe6d13608f6b8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56f3726b20096af80cc5772b838ff6ff4eb44fb0479d6855795730d163f07635a7a854bf2cc4ea9dee77cd6b83ced4c47af7e805496aff6c2fefe318b3cdc162
|
7
|
+
data.tar.gz: 1960e19c702fcdea527e28e95c9f94b3eb790fa58eb9dcb57073516524e23e46db38e5310903f0f009ae50dd121157e48c5130b7f88cf40759d519244e29d4bf
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.autotest
CHANGED
data/History.txt
CHANGED
@@ -1,16 +1,33 @@
|
|
1
1
|
# coding: UTF-8
|
2
2
|
|
3
|
+
=== 2.0.3 / 2012-03-1
|
4
|
+
|
5
|
+
* Bug fixes:
|
6
|
+
* Reverted automatic upgrade to HTTPS as it breaks RubyGems APIs. Fixes
|
7
|
+
#506 by André Arko
|
8
|
+
* Use File.realpath to remove extra / while checking if files are
|
9
|
+
installable. Issue #508 by Jacob Evans.
|
10
|
+
* When installing RubyGems on JRuby, the standard library is no longer
|
11
|
+
deleted. Fixes #504 by Juan Sanchez, #507 by Charles Oliver Nutter.
|
12
|
+
* When building extconf.rb extensions use the intermediate destination
|
13
|
+
directory. This addresses further issues with C extension building.
|
14
|
+
* Use the absolute path to the generated siteconf in case the extension
|
15
|
+
changes directories to run extconf.rb (like memcached). Fixes #498 by
|
16
|
+
Chris Morris.
|
17
|
+
* Fixed default gem key and cert locations. Pull request #511 by Samuel
|
18
|
+
Cochran.
|
19
|
+
|
3
20
|
=== 2.0.2 / 2013-03-06
|
4
21
|
|
5
22
|
* Bug fixes:
|
23
|
+
* HTTPS URLs are preferred over HTTP URLs. RubyGems will now attempt to
|
24
|
+
upgrade any HTTP source to HTTPS. Credit to Alex Gaynor.
|
6
25
|
* SSL Certificates are now installed properly. Fixes #491 by hemanth.hm
|
7
26
|
* Fixed HTTP to HTTPS upgrade for rubygems.org.
|
8
27
|
|
9
28
|
=== 2.0.1 / 2013-03-05
|
10
29
|
|
11
30
|
* Bug fixes:
|
12
|
-
* HTTPS URLs are preferred over HTTP URLs. RubyGems will now attempt to
|
13
|
-
upgrade any HTTP source to HTTPS. Credit to Alex Gaynor.
|
14
31
|
* Lazily load RubyGems.org API credentials to avoid failure during
|
15
32
|
RubyGems installation. Bug #465 by Isaac Sanders.
|
16
33
|
* RubyGems now picks the latest prerelease to install. Fixes bug #468 by
|
data/Manifest.txt
CHANGED
@@ -205,7 +205,6 @@ test/rubygems/test_gem_dependency.rb
|
|
205
205
|
test/rubygems/test_gem_dependency_installer.rb
|
206
206
|
test/rubygems/test_gem_dependency_list.rb
|
207
207
|
test/rubygems/test_gem_dependency_resolver.rb
|
208
|
-
test/rubygems/test_gem_dependency_resolver_api_set.rb
|
209
208
|
test/rubygems/test_gem_doctor.rb
|
210
209
|
test/rubygems/test_gem_ext_cmake_builder.rb
|
211
210
|
test/rubygems/test_gem_ext_configure_builder.rb
|
data/lib/rubygems.rb
CHANGED
@@ -180,7 +180,7 @@ For further reading on signing gems see `ri Gem::Security`.
|
|
180
180
|
end
|
181
181
|
|
182
182
|
def load_default_cert
|
183
|
-
cert_file = File.join Gem.
|
183
|
+
cert_file = File.join Gem.default_cert_path
|
184
184
|
cert = File.read cert_file
|
185
185
|
options[:issuer_cert] = OpenSSL::X509::Certificate.new cert
|
186
186
|
rescue Errno::ENOENT
|
@@ -196,7 +196,7 @@ For further reading on signing gems see `ri Gem::Security`.
|
|
196
196
|
end
|
197
197
|
|
198
198
|
def load_default_key
|
199
|
-
key_file = File.join Gem.
|
199
|
+
key_file = File.join Gem.default_key_path
|
200
200
|
key = File.read key_file
|
201
201
|
options[:key] = OpenSSL::PKey::RSA.new key
|
202
202
|
rescue Errno::ENOENT
|
@@ -437,13 +437,18 @@ abort "#{deprecation_message}"
|
|
437
437
|
end
|
438
438
|
|
439
439
|
def remove_old_lib_files lib_dir
|
440
|
-
|
440
|
+
rubygems_dir = File.join lib_dir, 'rubygems'
|
441
|
+
lib_files = rb_files_in 'lib/rubygems'
|
441
442
|
|
442
|
-
old_lib_files = rb_files_in
|
443
|
+
old_lib_files = rb_files_in rubygems_dir
|
443
444
|
|
444
445
|
to_remove = old_lib_files - lib_files
|
445
446
|
|
446
|
-
|
447
|
+
to_remove.delete_if do |file|
|
448
|
+
file.start_with? 'defaults'
|
449
|
+
end
|
450
|
+
|
451
|
+
Dir.chdir rubygems_dir do
|
447
452
|
to_remove.each do |file|
|
448
453
|
FileUtils.rm_f file
|
449
454
|
|
data/lib/rubygems/defaults.rb
CHANGED
@@ -110,4 +110,18 @@ module Gem
|
|
110
110
|
'ruby'
|
111
111
|
end
|
112
112
|
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# The default signing key path
|
116
|
+
|
117
|
+
def self.default_key_path
|
118
|
+
File.join Gem.user_home, ".gem", "gem-private_key.pem"
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# The default signing certificate chain path
|
123
|
+
|
124
|
+
def self.default_cert_path
|
125
|
+
File.join Gem.user_home, ".gem", "gem-public_cert.pem"
|
126
|
+
end
|
113
127
|
end
|
@@ -13,7 +13,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|
13
13
|
FileEntry = FileUtils::Entry_ # :nodoc:
|
14
14
|
|
15
15
|
def self.build(extension, directory, dest_path, results, args=[])
|
16
|
-
tmp_dest = Dir.mktmpdir(".gem.", ".")
|
16
|
+
tmp_dest = Dir.mktmpdir(".gem.", ".")
|
17
17
|
|
18
18
|
Tempfile.open %w"siteconf .rb", "." do |siteconf|
|
19
19
|
siteconf.puts "require 'rbconfig'"
|
@@ -25,11 +25,13 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|
25
25
|
|
26
26
|
siteconf.flush
|
27
27
|
|
28
|
+
siteconf_path = File.expand_path siteconf.path
|
29
|
+
|
28
30
|
rubyopt = ENV["RUBYOPT"]
|
29
31
|
destdir = ENV["DESTDIR"]
|
30
32
|
|
31
33
|
begin
|
32
|
-
ENV["RUBYOPT"] = ["-r#{
|
34
|
+
ENV["RUBYOPT"] = ["-r#{siteconf_path}", rubyopt].compact.join(' ')
|
33
35
|
cmd = [Gem.ruby, File.basename(extension), *args].join ' '
|
34
36
|
|
35
37
|
run cmd, results
|
data/lib/rubygems/package.rb
CHANGED
@@ -368,6 +368,9 @@ EOM
|
|
368
368
|
raise Gem::Package::PathError.new(filename, destination_dir) if
|
369
369
|
filename.start_with? '/'
|
370
370
|
|
371
|
+
destination_dir = File.realpath destination_dir if
|
372
|
+
File.respond_to? :realpath
|
373
|
+
|
371
374
|
destination = File.join destination_dir, filename
|
372
375
|
destination = File.expand_path destination
|
373
376
|
|
@@ -34,12 +34,12 @@ class Gem::Security::Signer
|
|
34
34
|
@key = key
|
35
35
|
|
36
36
|
unless @key then
|
37
|
-
default_key = File.join Gem.
|
37
|
+
default_key = File.join Gem.default_key_path
|
38
38
|
@key = default_key if File.exist? default_key
|
39
39
|
end
|
40
40
|
|
41
41
|
unless @cert_chain then
|
42
|
-
default_cert = File.join Gem.
|
42
|
+
default_cert = File.join Gem.default_cert_path
|
43
43
|
@cert_chain = [default_cert] if File.exist? default_cert
|
44
44
|
end
|
45
45
|
|
@@ -110,15 +110,15 @@ class Gem::Security::Signer
|
|
110
110
|
def re_sign_key # :nodoc:
|
111
111
|
old_cert = @cert_chain.last
|
112
112
|
|
113
|
-
disk_cert_path = File.join Gem.
|
113
|
+
disk_cert_path = File.join Gem.default_cert_path
|
114
114
|
disk_cert = File.read disk_cert_path rescue nil
|
115
115
|
disk_key =
|
116
|
-
File.read File.join(Gem.
|
116
|
+
File.read File.join(Gem.default_key_path) rescue nil
|
117
117
|
|
118
118
|
if disk_key == @key.to_pem and disk_cert == old_cert.to_pem then
|
119
119
|
expiry = old_cert.not_after.strftime '%Y%m%d%H%M%S'
|
120
120
|
old_cert_file = "gem-public_cert.pem.expired.#{expiry}"
|
121
|
-
old_cert_path = File.join Gem.user_home, old_cert_file
|
121
|
+
old_cert_path = File.join Gem.user_home, ".gem", old_cert_file
|
122
122
|
|
123
123
|
unless File.exist? old_cert_path then
|
124
124
|
Gem::Security.write old_cert, old_cert_path
|
data/lib/rubygems/source.rb
CHANGED
@@ -141,14 +141,4 @@ class Gem::Source
|
|
141
141
|
fetcher = Gem::RemoteFetcher.fetcher
|
142
142
|
fetcher.download spec, @uri.to_s, dir
|
143
143
|
end
|
144
|
-
|
145
|
-
##
|
146
|
-
# Replaces the URI for this source with +uri+. Used for upgrading this
|
147
|
-
# source to HTTPS
|
148
|
-
|
149
|
-
def uri= uri # :nodoc:
|
150
|
-
@api_uri = nil
|
151
|
-
@uri = uri
|
152
|
-
end
|
153
|
-
|
154
144
|
end
|
@@ -188,8 +188,6 @@ class Gem::SpecFetcher
|
|
188
188
|
list = {}
|
189
189
|
|
190
190
|
Gem.sources.each_source do |source|
|
191
|
-
source = upgrade_http_source source
|
192
|
-
|
193
191
|
begin
|
194
192
|
names = case type
|
195
193
|
when :latest
|
@@ -228,40 +226,5 @@ class Gem::SpecFetcher
|
|
228
226
|
end
|
229
227
|
end
|
230
228
|
|
231
|
-
##
|
232
|
-
# Attempts to upgrade +source+ to HTTPS if it is for http://rubygems.org
|
233
|
-
|
234
|
-
def upgrade_http_source source
|
235
|
-
uri = source.uri
|
236
|
-
|
237
|
-
return source unless uri.scheme.downcase == 'http' &&
|
238
|
-
uri.host.downcase == 'rubygems.org'
|
239
|
-
|
240
|
-
https_uri = uri.dup
|
241
|
-
https_uri.scheme = 'https'
|
242
|
-
https_uri += '/'
|
243
|
-
|
244
|
-
https_uri = URI https_uri.to_s # cast to URI::HTTPS
|
245
|
-
|
246
|
-
begin
|
247
|
-
Gem::RemoteFetcher.fetcher.fetch_path https_uri, nil, true
|
248
|
-
rescue Gem::RemoteFetcher::FetchError => e
|
249
|
-
raise unless e.message =~ / Not Allowed 405 /
|
250
|
-
end
|
251
|
-
|
252
|
-
say "Upgraded #{uri} to HTTPS"
|
253
|
-
|
254
|
-
https_uri += uri.request_uri
|
255
|
-
|
256
|
-
source.uri = URI https_uri.to_s # cast to URI::HTTPS
|
257
|
-
|
258
|
-
source
|
259
|
-
rescue Gem::RemoteFetcher::FetchError
|
260
|
-
say "Upgrading #{uri} to HTTPS failed, continuing" if
|
261
|
-
Gem.configuration.really_verbose
|
262
|
-
|
263
|
-
source
|
264
|
-
end
|
265
|
-
|
266
229
|
end
|
267
230
|
|
@@ -308,10 +308,12 @@ Removed '/CN=alternate/DC=example'
|
|
308
308
|
end
|
309
309
|
|
310
310
|
def test_execute_sign_default
|
311
|
-
|
311
|
+
FileUtils.mkdir_p File.join Gem.user_home, '.gem'
|
312
|
+
|
313
|
+
private_key_path = File.join Gem.user_home, '.gem', 'gem-private_key.pem'
|
312
314
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
313
315
|
|
314
|
-
public_cert_path = File.join Gem.user_home, 'gem-public_cert.pem'
|
316
|
+
public_cert_path = File.join Gem.user_home, '.gem', 'gem-public_cert.pem'
|
315
317
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
316
318
|
|
317
319
|
path = File.join @tempdir, 'cert.pem'
|
@@ -338,7 +340,9 @@ Removed '/CN=alternate/DC=example'
|
|
338
340
|
end
|
339
341
|
|
340
342
|
def test_execute_sign_no_cert
|
341
|
-
|
343
|
+
FileUtils.mkdir_p File.join Gem.user_home, '.gem'
|
344
|
+
|
345
|
+
private_key_path = File.join Gem.user_home, '.gem', 'gem-private_key.pem'
|
342
346
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
343
347
|
|
344
348
|
path = File.join @tempdir, 'cert.pem'
|
@@ -364,7 +368,9 @@ ERROR: --certificate not specified and ~/.gem/gem-public_cert.pem does not exis
|
|
364
368
|
end
|
365
369
|
|
366
370
|
def test_execute_sign_no_key
|
367
|
-
|
371
|
+
FileUtils.mkdir_p File.join Gem.user_home, '.gem'
|
372
|
+
|
373
|
+
public_cert_path = File.join Gem.user_home, '.gem', 'gem-public_cert.pem'
|
368
374
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
369
375
|
|
370
376
|
path = File.join @tempdir, 'cert.pem'
|
@@ -41,21 +41,36 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_remove_old_lib_files
|
44
|
-
lib
|
45
|
-
lib_rubygems
|
44
|
+
lib = File.join @install_dir, 'lib'
|
45
|
+
lib_rubygems = File.join lib, 'rubygems'
|
46
|
+
lib_rubygems_defaults = File.join lib_rubygems, 'defaults'
|
46
47
|
|
47
|
-
|
48
|
-
old_format_rb = File.join lib_rubygems, 'format.rb'
|
48
|
+
securerandom_rb = File.join lib, 'securerandom.rb'
|
49
49
|
|
50
|
-
|
50
|
+
engine_defaults_rb = File.join lib_rubygems_defaults, 'jruby.rb'
|
51
|
+
os_defaults_rb = File.join lib_rubygems_defaults, 'operating_system.rb'
|
51
52
|
|
52
|
-
|
53
|
-
|
53
|
+
old_builder_rb = File.join lib_rubygems, 'builder.rb'
|
54
|
+
old_format_rb = File.join lib_rubygems, 'format.rb'
|
55
|
+
|
56
|
+
FileUtils.mkdir_p lib_rubygems_defaults
|
57
|
+
|
58
|
+
open securerandom_rb, 'w' do |io| io.puts '# securerandom.rb' end
|
59
|
+
|
60
|
+
open old_builder_rb, 'w' do |io| io.puts '# builder.rb' end
|
61
|
+
open old_format_rb, 'w' do |io| io.puts '# format.rb' end
|
62
|
+
|
63
|
+
open engine_defaults_rb, 'w' do |io| io.puts '# jruby.rb' end
|
64
|
+
open os_defaults_rb, 'w' do |io| io.puts '# operating_system.rb' end
|
54
65
|
|
55
66
|
@cmd.remove_old_lib_files lib
|
56
67
|
|
57
68
|
refute_path_exists old_builder_rb
|
58
69
|
refute_path_exists old_format_rb
|
70
|
+
|
71
|
+
assert_path_exists securerandom_rb
|
72
|
+
assert_path_exists engine_defaults_rb
|
73
|
+
assert_path_exists os_defaults_rb
|
59
74
|
end
|
60
75
|
|
61
76
|
end
|
@@ -18,6 +18,8 @@ class TestGemPackage < Gem::Package::TarTestCase
|
|
18
18
|
@gem = @spec.cache_file
|
19
19
|
|
20
20
|
@destination = File.join @tempdir, 'extract'
|
21
|
+
|
22
|
+
FileUtils.mkdir_p @destination
|
21
23
|
end
|
22
24
|
|
23
25
|
def test_class_new_old_format
|
@@ -160,10 +162,12 @@ class TestGemPackage < Gem::Package::TarTestCase
|
|
160
162
|
end
|
161
163
|
|
162
164
|
def test_build_auto_signed
|
163
|
-
|
165
|
+
FileUtils.mkdir_p File.join(Gem.user_home, '.gem')
|
166
|
+
|
167
|
+
private_key_path = File.join Gem.user_home, '.gem', 'gem-private_key.pem'
|
164
168
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
165
169
|
|
166
|
-
public_cert_path = File.join Gem.user_home, 'gem-public_cert.pem'
|
170
|
+
public_cert_path = File.join Gem.user_home, '.gem', 'gem-public_cert.pem'
|
167
171
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
168
172
|
|
169
173
|
spec = Gem::Specification.new 'build', '1'
|
@@ -330,6 +334,20 @@ class TestGemPackage < Gem::Package::TarTestCase
|
|
330
334
|
"#{@destination} is not allowed", e.message)
|
331
335
|
end
|
332
336
|
|
337
|
+
def test_install_location_extra_slash
|
338
|
+
package = Gem::Package.new @gem
|
339
|
+
|
340
|
+
file = 'foo//file.rb'
|
341
|
+
file.taint
|
342
|
+
|
343
|
+
destination = @destination.sub '/', '//'
|
344
|
+
|
345
|
+
destination = package.install_location file, destination
|
346
|
+
|
347
|
+
assert_equal File.join(@destination, 'foo', 'file.rb'), destination
|
348
|
+
refute destination.tainted?
|
349
|
+
end
|
350
|
+
|
333
351
|
def test_install_location_relative
|
334
352
|
package = Gem::Package.new @gem
|
335
353
|
|
@@ -399,9 +399,6 @@ gems:
|
|
399
399
|
@fetcher.instance_variable_set :@a1, @a1
|
400
400
|
@fetcher.instance_variable_set :@a2, @a2
|
401
401
|
def @fetcher.fetch_path uri, mtime = nil, head = false
|
402
|
-
raise Gem::RemoteFetcher::FetchError.new 'no http upgrade', uri if
|
403
|
-
uri.scheme != 'http'
|
404
|
-
|
405
402
|
case uri.request_uri
|
406
403
|
when /#{@a1.spec_name}/ then
|
407
404
|
Gem.deflate Marshal.dump @a1
|
@@ -50,10 +50,12 @@ class TestGemSecuritySigner < Gem::TestCase
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_initialize_default
|
53
|
-
|
53
|
+
FileUtils.mkdir_p File.join(Gem.user_home, '.gem')
|
54
|
+
|
55
|
+
private_key_path = File.join Gem.user_home, '.gem', 'gem-private_key.pem'
|
54
56
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
55
57
|
|
56
|
-
public_cert_path = File.join Gem.user_home, 'gem-public_cert.pem'
|
58
|
+
public_cert_path = File.join Gem.user_home, '.gem', 'gem-public_cert.pem'
|
57
59
|
Gem::Security.write PUBLIC_CERT, public_cert_path
|
58
60
|
|
59
61
|
signer = Gem::Security::Signer.new nil, nil
|
@@ -120,12 +122,12 @@ c7NM7KZZjj7G++SXjYTEI1PHSA7aFQ/i/+qSUvx+Pg==
|
|
120
122
|
end
|
121
123
|
|
122
124
|
def test_sign_expired_auto_update
|
123
|
-
FileUtils.mkdir_p Gem.user_home, :mode => 0700
|
125
|
+
FileUtils.mkdir_p File.join(Gem.user_home, '.gem'), :mode => 0700
|
124
126
|
|
125
|
-
private_key_path = File.join(Gem.user_home, 'gem-private_key.pem')
|
127
|
+
private_key_path = File.join(Gem.user_home, '.gem', 'gem-private_key.pem')
|
126
128
|
Gem::Security.write PRIVATE_KEY, private_key_path
|
127
129
|
|
128
|
-
cert_path = File.join Gem.user_home, 'gem-public_cert.pem'
|
130
|
+
cert_path = File.join Gem.user_home, '.gem', 'gem-public_cert.pem'
|
129
131
|
Gem::Security.write EXPIRED_CERT, cert_path
|
130
132
|
|
131
133
|
signer = Gem::Security::Signer.new PRIVATE_KEY, [EXPIRED_CERT]
|
@@ -140,14 +142,14 @@ c7NM7KZZjj7G++SXjYTEI1PHSA7aFQ/i/+qSUvx+Pg==
|
|
140
142
|
expiry = EXPIRED_CERT.not_after.strftime "%Y%m%d%H%M%S"
|
141
143
|
|
142
144
|
expired_path =
|
143
|
-
File.join Gem.user_home, "gem-public_cert.pem.expired.#{expiry}"
|
145
|
+
File.join Gem.user_home, '.gem', "gem-public_cert.pem.expired.#{expiry}"
|
144
146
|
|
145
147
|
assert_path_exists expired_path
|
146
148
|
assert_equal EXPIRED_CERT.to_pem, File.read(expired_path)
|
147
149
|
end
|
148
150
|
|
149
151
|
def test_sign_expired_auto_update_exists
|
150
|
-
FileUtils.mkdir_p Gem.user_home, :mode => 0700
|
152
|
+
FileUtils.mkdir_p File.join(Gem.user_home, '.gem'), :mode => 0700
|
151
153
|
|
152
154
|
expiry = EXPIRED_CERT.not_after.strftime "%Y%m%d%H%M%S"
|
153
155
|
expired_path =
|
@@ -184,16 +184,5 @@ class TestGemSource < Gem::TestCase
|
|
184
184
|
end
|
185
185
|
end
|
186
186
|
|
187
|
-
def test_uri_equals
|
188
|
-
@source.api_uri # cached
|
189
|
-
|
190
|
-
refute_equal URI('https://secure.example'), @source.api_uri
|
191
|
-
|
192
|
-
@source.uri = URI 'https://secure.example'
|
193
|
-
|
194
|
-
assert_equal URI('https://secure.example'), @source.uri
|
195
|
-
assert_equal URI('https://secure.example'), @source.api_uri
|
196
|
-
end
|
197
|
-
|
198
187
|
end
|
199
188
|
|
@@ -32,14 +32,13 @@ class TestGemSpecFetcher < Gem::TestCase
|
|
32
32
|
Gem::NameTuple.new(spec.name, spec.version, spec.original_platform)
|
33
33
|
}
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
@fetcher.data["#{@gem_repo}
|
41
|
-
@fetcher.data["#{@gem_repo}
|
42
|
-
@fetcher.data["#{@gem_repo}prerelease_specs.#{@v}.gz"] = @p_zip
|
35
|
+
v = Gem.marshal_version
|
36
|
+
s_zip = util_gzip(Marshal.dump(Gem::NameTuple.to_basic(@specs)))
|
37
|
+
l_zip = util_gzip(Marshal.dump(Gem::NameTuple.to_basic(@latest_specs)))
|
38
|
+
p_zip = util_gzip(Marshal.dump(Gem::NameTuple.to_basic(@prerelease_specs)))
|
39
|
+
@fetcher.data["#{@gem_repo}specs.#{v}.gz"] = s_zip
|
40
|
+
@fetcher.data["#{@gem_repo}latest_specs.#{v}.gz"] = l_zip
|
41
|
+
@fetcher.data["#{@gem_repo}prerelease_specs.#{v}.gz"] = p_zip
|
43
42
|
|
44
43
|
@sf = Gem::SpecFetcher.new
|
45
44
|
|
@@ -201,6 +200,7 @@ class TestGemSpecFetcher < Gem::TestCase
|
|
201
200
|
assert_equal comp.sort, specs[@source].sort
|
202
201
|
end
|
203
202
|
|
203
|
+
|
204
204
|
def test_available_specs_cache
|
205
205
|
specs, _ = @sf.available_specs(:latest)
|
206
206
|
|
@@ -240,77 +240,5 @@ class TestGemSpecFetcher < Gem::TestCase
|
|
240
240
|
assert_kind_of Gem::SourceFetchProblem, errors.first
|
241
241
|
end
|
242
242
|
|
243
|
-
def test_upgrade_http_source
|
244
|
-
Gem.configuration.verbose = :really
|
245
|
-
|
246
|
-
source = Gem::Source.new URI 'http://example'
|
247
|
-
same_source = nil
|
248
|
-
|
249
|
-
use_ui @ui do
|
250
|
-
same_source = @sf.upgrade_http_source source
|
251
|
-
end
|
252
|
-
|
253
|
-
assert_equal URI('http://example'), same_source.uri
|
254
|
-
|
255
|
-
assert_empty @ui.output
|
256
|
-
assert_empty @ui.error
|
257
|
-
end
|
258
|
-
|
259
|
-
def test_upgrade_http_source_rubygems
|
260
|
-
Gem.configuration.verbose = :really
|
261
|
-
|
262
|
-
source = Gem::Source.new URI 'http://rubygems.org'
|
263
|
-
same_source = nil
|
264
|
-
https_source = nil
|
265
|
-
|
266
|
-
use_ui @ui do
|
267
|
-
same_source = @sf.upgrade_http_source source
|
268
|
-
end
|
269
|
-
|
270
|
-
assert_equal URI('http://rubygems.org'), same_source.uri
|
271
|
-
|
272
|
-
@fetcher.data['https://rubygems.org/'] = 'hello'
|
273
|
-
|
274
|
-
use_ui @ui do
|
275
|
-
https_source = @sf.upgrade_http_source source
|
276
|
-
end
|
277
|
-
|
278
|
-
assert_equal URI('https://rubygems.org'), https_source.uri
|
279
|
-
|
280
|
-
assert_empty @ui.error
|
281
|
-
|
282
|
-
expected = <<-EXPECTED
|
283
|
-
Upgrading http://rubygems.org to HTTPS failed, continuing
|
284
|
-
Upgraded http://rubygems.org to HTTPS
|
285
|
-
EXPECTED
|
286
|
-
|
287
|
-
assert_equal expected, @ui.output
|
288
|
-
end
|
289
|
-
|
290
|
-
def test_upgrade_http_source_rubygems_405
|
291
|
-
Gem.configuration.verbose = :really
|
292
|
-
|
293
|
-
source = Gem::Source.new URI 'http://rubygems.org'
|
294
|
-
https_source = nil
|
295
|
-
|
296
|
-
@fetcher.data['https://rubygems.org/'] = proc do
|
297
|
-
raise Gem::RemoteFetcher::FetchError.new ' Not Allowed 405 ', nil
|
298
|
-
end
|
299
|
-
|
300
|
-
use_ui @ui do
|
301
|
-
https_source = @sf.upgrade_http_source source
|
302
|
-
end
|
303
|
-
|
304
|
-
assert_equal URI('https://rubygems.org'), https_source.uri
|
305
|
-
|
306
|
-
assert_empty @ui.error
|
307
|
-
|
308
|
-
expected = <<-EXPECTED
|
309
|
-
Upgraded http://rubygems.org to HTTPS
|
310
|
-
EXPECTED
|
311
|
-
|
312
|
-
assert_equal expected, @ui.output
|
313
|
-
end
|
314
|
-
|
315
243
|
end
|
316
244
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems-update
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Weirich
|
@@ -32,7 +32,7 @@ cert_chain:
|
|
32
32
|
KDyY1VIazVgoC8XvR4h/95/iScPiuglzA+DBG1hip1xScAtw05BrXyUNrc9CEMYU
|
33
33
|
wgF94UVoHRp6ywo8I7NP3HcwFQDFNEZPNGXsng==
|
34
34
|
-----END CERTIFICATE-----
|
35
|
-
date: 2013-03-
|
35
|
+
date: 2013-03-12 00:00:00.000000000 Z
|
36
36
|
dependencies:
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: minitest
|
@@ -392,7 +392,6 @@ files:
|
|
392
392
|
- test/rubygems/test_gem_dependency_installer.rb
|
393
393
|
- test/rubygems/test_gem_dependency_list.rb
|
394
394
|
- test/rubygems/test_gem_dependency_resolver.rb
|
395
|
-
- test/rubygems/test_gem_dependency_resolver_api_set.rb
|
396
395
|
- test/rubygems/test_gem_doctor.rb
|
397
396
|
- test/rubygems/test_gem_ext_cmake_builder.rb
|
398
397
|
- test/rubygems/test_gem_ext_configure_builder.rb
|
@@ -450,7 +449,7 @@ post_install_message:
|
|
450
449
|
rdoc_options:
|
451
450
|
- --main
|
452
451
|
- README.rdoc
|
453
|
-
- --title=RubyGems 2.0.
|
452
|
+
- --title=RubyGems 2.0.3 Documentation
|
454
453
|
require_paths:
|
455
454
|
- hide_lib_for_update
|
456
455
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -465,7 +464,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
465
464
|
version: '0'
|
466
465
|
requirements: []
|
467
466
|
rubyforge_project: rubygems
|
468
|
-
rubygems_version: 2.0.
|
467
|
+
rubygems_version: 2.0.2
|
469
468
|
signing_key:
|
470
469
|
specification_version: 4
|
471
470
|
summary: RubyGems is a package management framework for Ruby
|
@@ -511,7 +510,6 @@ test_files:
|
|
511
510
|
- test/rubygems/test_gem_dependency_installer.rb
|
512
511
|
- test/rubygems/test_gem_dependency_list.rb
|
513
512
|
- test/rubygems/test_gem_dependency_resolver.rb
|
514
|
-
- test/rubygems/test_gem_dependency_resolver_api_set.rb
|
515
513
|
- test/rubygems/test_gem_doctor.rb
|
516
514
|
- test/rubygems/test_gem_ext_cmake_builder.rb
|
517
515
|
- test/rubygems/test_gem_ext_configure_builder.rb
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,80 +0,0 @@
|
|
1
|
-
require 'rubygems/test_case'
|
2
|
-
require 'rubygems/dependency_resolver'
|
3
|
-
|
4
|
-
class TestGemDependencyResolverAPISet < Gem::TestCase
|
5
|
-
|
6
|
-
def setup
|
7
|
-
super
|
8
|
-
|
9
|
-
@DR = Gem::DependencyResolver
|
10
|
-
|
11
|
-
@api_set = @DR::APISet.new
|
12
|
-
@uri = 'https://rubygems.org/api/v1/dependencies'
|
13
|
-
@fetcher = Gem::FakeFetcher.new
|
14
|
-
Gem::RemoteFetcher.fetcher = @fetcher
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_find_all
|
18
|
-
b_entry = {
|
19
|
-
:name => 'b',
|
20
|
-
:number => '2',
|
21
|
-
:platform => 'ruby',
|
22
|
-
:dependencies => [['a', '>= 0']],
|
23
|
-
}
|
24
|
-
|
25
|
-
@fetcher.data["#{@uri}?gems=b"] = Marshal.dump [b_entry]
|
26
|
-
|
27
|
-
b_req = @DR::DependencyRequest.new dep('b', '>= 0'), nil
|
28
|
-
|
29
|
-
expected = [
|
30
|
-
@DR::APISpecification.new(@api_set, b_entry)
|
31
|
-
]
|
32
|
-
|
33
|
-
assert_equal expected, @api_set.find_all(b_req)
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_prefetch
|
37
|
-
b_entry = {
|
38
|
-
:name => 'b',
|
39
|
-
:number => '2',
|
40
|
-
:platform => 'ruby',
|
41
|
-
:dependencies => [['a', '>= 0']],
|
42
|
-
}
|
43
|
-
|
44
|
-
a_entry = {
|
45
|
-
:name => 'a',
|
46
|
-
:number => '2',
|
47
|
-
:platform => 'ruby',
|
48
|
-
:dependencies => [],
|
49
|
-
}
|
50
|
-
|
51
|
-
@fetcher.data["#{@uri}?gems=a,b"] = Marshal.dump [a_entry, b_entry]
|
52
|
-
|
53
|
-
a_req = @DR::DependencyRequest.new dep('a', '>= 0'), nil
|
54
|
-
b_req = @DR::DependencyRequest.new dep('b', '>= 0'), nil
|
55
|
-
|
56
|
-
@api_set.prefetch([b_req, a_req])
|
57
|
-
|
58
|
-
assert_equal [a_entry], @api_set.versions('a')
|
59
|
-
assert_equal [b_entry], @api_set.versions('b')
|
60
|
-
end
|
61
|
-
|
62
|
-
def test_versions_cache
|
63
|
-
entry = {
|
64
|
-
:name => 'b',
|
65
|
-
:number => '2',
|
66
|
-
:platform => 'ruby',
|
67
|
-
:dependencies => [['a', '>= 0']],
|
68
|
-
}
|
69
|
-
|
70
|
-
@fetcher.data["#{@uri}?gems=b"] = Marshal.dump [entry]
|
71
|
-
|
72
|
-
assert_equal [entry], @api_set.versions('b')
|
73
|
-
|
74
|
-
@fetcher.data["#{@uri}?gems=b"] = 'garbage'
|
75
|
-
|
76
|
-
assert_equal [entry], @api_set.versions('b'), 'version data must be cached'
|
77
|
-
end
|
78
|
-
|
79
|
-
end
|
80
|
-
|