rubygems-update 2.0.0 → 2.0.2
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -1
- data/.autotest +1 -0
- data/History.txt +32 -0
- data/Manifest.txt +2 -0
- data/lib/rubygems.rb +14 -5
- data/lib/rubygems/available_set.rb +70 -72
- data/lib/rubygems/commands/cert_command.rb +1 -0
- data/lib/rubygems/commands/query_command.rb +7 -7
- data/lib/rubygems/commands/setup_command.rb +21 -4
- data/lib/rubygems/commands/sources_command.rb +13 -0
- data/lib/rubygems/config_file.rb +29 -16
- data/lib/rubygems/defaults.rb +1 -1
- data/lib/rubygems/dependency_installer.rb +18 -10
- data/lib/rubygems/dependency_list.rb +1 -1
- data/lib/rubygems/dependency_resolver.rb +17 -4
- data/lib/rubygems/ext/builder.rb +0 -7
- data/lib/rubygems/ext/ext_conf_builder.rb +43 -8
- data/lib/rubygems/installer.rb +4 -4
- data/lib/rubygems/package.rb +2 -1
- data/lib/rubygems/rdoc.rb +10 -1
- data/lib/rubygems/remote_fetcher.rb +8 -3
- data/lib/rubygems/security.rb +21 -1
- data/lib/rubygems/security/policy.rb +2 -0
- data/lib/rubygems/source.rb +10 -0
- data/lib/rubygems/spec_fetcher.rb +38 -0
- data/lib/rubygems/specification.rb +1 -1
- data/lib/rubygems/ssl_certs/GeoTrust_Global_CA.pem +20 -0
- data/lib/rubygems/test_utilities.rb +6 -3
- data/test/rubygems/test_gem.rb +13 -1
- data/test/rubygems/test_gem_commands_fetch_command.rb +4 -0
- data/test/rubygems/test_gem_commands_query_command.rb +16 -0
- data/test/rubygems/test_gem_commands_setup_command.rb +18 -1
- data/test/rubygems/test_gem_commands_sources_command.rb +39 -0
- data/test/rubygems/test_gem_config_file.rb +15 -0
- data/test/rubygems/test_gem_dependency_installer.rb +55 -0
- data/test/rubygems/test_gem_dependency_resolver_api_set.rb +80 -0
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +1 -7
- data/test/rubygems/test_gem_installer.rb +92 -1
- data/test/rubygems/test_gem_remote_fetcher.rb +3 -0
- data/test/rubygems/test_gem_source.rb +11 -0
- data/test/rubygems/test_gem_source_list.rb +1 -1
- data/test/rubygems/test_gem_spec_fetcher.rb +80 -8
- data/test/rubygems/test_require.rb +19 -8
- metadata +14 -11
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55828383c26eb529d41e882bc3bf284931fd84d1
|
4
|
+
data.tar.gz: a64439fc94a099fb4342ebb47e4361835d0b326f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 703c84109f6bab51f52d97cfda5dbed84401bd1284c0b8c387d5c1bbded19911060989f56b0927a2cf8200bc678fd7464e1f39150b68767c0bfc8181a7753cb3
|
7
|
+
data.tar.gz: 58a92fc46f3852195fc1dd2c437b0043245ed6ba3a2af7baf8fe0bee39d9532d88ea711fb8bcd4fa5b9c6f305f16fd34627edec685f42178b232a2fa2a7ca45b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
�f3�{��E�F�U9��������=ᔝ�aF�
|
2
|
+
�N��!_j\�vp�C�����qOkd�7|s',n�i��ʓ#�̽]�B�V*O�=�5��UPb$���n2�����X��_0����~RӇ�9�|X�"`�MJ���"��D�O���%����3sS�X��`�C��B_mW~2,6ȃ���X®��� S��[܋�4�^*F��z� �rCÏB��f�&�x~�����x�.b�
|
data/.autotest
CHANGED
data/History.txt
CHANGED
@@ -1,5 +1,37 @@
|
|
1
1
|
# coding: UTF-8
|
2
2
|
|
3
|
+
=== 2.0.2 / 2013-03-06
|
4
|
+
|
5
|
+
* Bug fixes:
|
6
|
+
* SSL Certificates are now installed properly. Fixes #491 by hemanth.hm
|
7
|
+
* Fixed HTTP to HTTPS upgrade for rubygems.org.
|
8
|
+
|
9
|
+
=== 2.0.1 / 2013-03-05
|
10
|
+
|
11
|
+
* 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
|
+
* Lazily load RubyGems.org API credentials to avoid failure during
|
15
|
+
RubyGems installation. Bug #465 by Isaac Sanders.
|
16
|
+
* RubyGems now picks the latest prerelease to install. Fixes bug #468 by
|
17
|
+
Santiago Pastorino.
|
18
|
+
* Improved detection of missing Zlib::GzipReader encoding support. Works
|
19
|
+
around JRuby-only bug #472 by Matt Beedle.
|
20
|
+
* "Done installing documentation" is no longer displayed when documentation
|
21
|
+
generation is disabled. Fixes bug #469 by Jeff Sandberg
|
22
|
+
* The existing executable check now respects --format-executable. Pull
|
23
|
+
request #471 by Jeremy Evans.
|
24
|
+
* RubyGems no longer creates gem subdirectories when fetching gems. Fixes
|
25
|
+
#482 by Loren Segal.
|
26
|
+
* RubyGems does not require OpenSSL like RubyGems 1.8, but still prefers it.
|
27
|
+
Fixes #481 by André Arko.
|
28
|
+
* RubyGems only fetches specs for list, search and query commands when
|
29
|
+
needed like RubyGems 1.x. Fixes bug #487 by bitbuerster, Ruby bug #8019
|
30
|
+
by Ike Miller.
|
31
|
+
* Allow specification of mode for gem subdirectory creation.
|
32
|
+
Ruby bug #7713 by nobu
|
33
|
+
* Fix tests when an 'a.rb' exists. Ruby bug #7749 by nobu.
|
34
|
+
|
3
35
|
=== 2.0.0 / 2013-02-24
|
4
36
|
|
5
37
|
RubyGems 2.0 includes several new features and many breaking changes. Some of
|
data/Manifest.txt
CHANGED
@@ -107,6 +107,7 @@ lib/rubygems/specification.rb
|
|
107
107
|
lib/rubygems/ssl_certs/.document
|
108
108
|
lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem
|
109
109
|
lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem
|
110
|
+
lib/rubygems/ssl_certs/GeoTrust_Global_CA.pem
|
110
111
|
lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem
|
111
112
|
lib/rubygems/syck_hack.rb
|
112
113
|
lib/rubygems/test_case.rb
|
@@ -204,6 +205,7 @@ test/rubygems/test_gem_dependency.rb
|
|
204
205
|
test/rubygems/test_gem_dependency_installer.rb
|
205
206
|
test/rubygems/test_gem_dependency_list.rb
|
206
207
|
test/rubygems/test_gem_dependency_resolver.rb
|
208
|
+
test/rubygems/test_gem_dependency_resolver_api_set.rb
|
207
209
|
test/rubygems/test_gem_doctor.rb
|
208
210
|
test/rubygems/test_gem_ext_cmake_builder.rb
|
209
211
|
test/rubygems/test_gem_ext_configure_builder.rb
|
data/lib/rubygems.rb
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
require 'rbconfig'
|
9
9
|
|
10
10
|
module Gem
|
11
|
-
VERSION = '2.0.
|
11
|
+
VERSION = '2.0.2'
|
12
12
|
end
|
13
13
|
|
14
14
|
# Must be first since it unloads the prelude from 1.9.2
|
@@ -375,20 +375,28 @@ module Gem
|
|
375
375
|
end
|
376
376
|
|
377
377
|
##
|
378
|
-
# Quietly ensure the
|
378
|
+
# Quietly ensure the Gem directory +dir+ contains all the proper
|
379
379
|
# subdirectories. If we can't create a directory due to a permission
|
380
380
|
# problem, then we will silently continue.
|
381
|
+
#
|
382
|
+
# If +mode+ is given, missing directories are created with this mode.
|
383
|
+
#
|
384
|
+
# World-writable directories will never be created.
|
381
385
|
|
382
|
-
def self.ensure_gem_subdirectories dir = Gem.dir
|
386
|
+
def self.ensure_gem_subdirectories dir = Gem.dir, mode = nil
|
383
387
|
old_umask = File.umask
|
384
388
|
File.umask old_umask | 002
|
385
389
|
|
386
390
|
require 'fileutils'
|
387
391
|
|
392
|
+
options = {}
|
393
|
+
|
394
|
+
options[:mode] = mode if mode
|
395
|
+
|
388
396
|
REPOSITORY_SUBDIRECTORIES.each do |name|
|
389
397
|
subdir = File.join dir, name
|
390
398
|
next if File.exist? subdir
|
391
|
-
FileUtils.mkdir_p subdir rescue nil
|
399
|
+
FileUtils.mkdir_p subdir, options rescue nil
|
392
400
|
end
|
393
401
|
ensure
|
394
402
|
File.umask old_umask
|
@@ -895,7 +903,8 @@ module Gem
|
|
895
903
|
|
896
904
|
def self.win_platform?
|
897
905
|
if @@win_platform.nil? then
|
898
|
-
|
906
|
+
ruby_platform = RbConfig::CONFIG['host_os']
|
907
|
+
@@win_platform = !!WIN_PATTERNS.find { |r| ruby_platform =~ r }
|
899
908
|
end
|
900
909
|
|
901
910
|
@@win_platform
|
@@ -1,95 +1,93 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Tuple = Struct.new(:spec, :source)
|
1
|
+
class Gem::AvailableSet
|
2
|
+
Tuple = Struct.new(:spec, :source)
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
def initialize
|
5
|
+
@set = []
|
6
|
+
@sorted = nil
|
7
|
+
end
|
9
8
|
|
10
|
-
|
9
|
+
attr_reader :set
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
def add(spec, source)
|
12
|
+
@set << Tuple.new(spec, source)
|
13
|
+
@sorted = nil
|
14
|
+
self
|
15
|
+
end
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|
27
|
-
|
28
|
-
Tuple.new(sp,so)
|
17
|
+
def <<(o)
|
18
|
+
case o
|
19
|
+
when Gem::AvailableSet
|
20
|
+
s = o.set
|
21
|
+
when Array
|
22
|
+
s = o.map do |sp,so|
|
23
|
+
if !sp.kind_of?(Gem::Specification) or !so.kind_of?(Gem::Source)
|
24
|
+
raise TypeError, "Array must be in [[spec, source], ...] form"
|
29
25
|
end
|
30
|
-
|
31
|
-
|
26
|
+
|
27
|
+
Tuple.new(sp,so)
|
32
28
|
end
|
29
|
+
else
|
30
|
+
raise TypeError, "must be a Gem::AvailableSet"
|
31
|
+
end
|
33
32
|
|
34
|
-
|
35
|
-
|
33
|
+
@set += s
|
34
|
+
@sorted = nil
|
36
35
|
|
37
|
-
|
38
|
-
|
36
|
+
self
|
37
|
+
end
|
39
38
|
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
def empty?
|
40
|
+
@set.empty?
|
41
|
+
end
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
def all_specs
|
44
|
+
@set.map { |t| t.spec }
|
45
|
+
end
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
def match_platform!
|
48
|
+
@set.reject! { |t| !Gem::Platform.match(t.spec.platform) }
|
49
|
+
@sorted = nil
|
50
|
+
self
|
51
|
+
end
|
53
52
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
end
|
53
|
+
def sorted
|
54
|
+
@sorted ||= @set.sort do |a,b|
|
55
|
+
i = b.spec <=> a.spec
|
56
|
+
i != 0 ? i : (a.source <=> b.source)
|
59
57
|
end
|
58
|
+
end
|
60
59
|
|
61
|
-
|
62
|
-
|
63
|
-
|
60
|
+
def size
|
61
|
+
@set.size
|
62
|
+
end
|
64
63
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
64
|
+
def source_for(spec)
|
65
|
+
f = @set.find { |t| t.spec == spec }
|
66
|
+
f.source
|
67
|
+
end
|
69
68
|
|
70
|
-
|
71
|
-
|
69
|
+
def pick_best!
|
70
|
+
return self if empty?
|
72
71
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
72
|
+
@set = [sorted.first]
|
73
|
+
@sorted = nil
|
74
|
+
self
|
75
|
+
end
|
77
76
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
end
|
77
|
+
def remove_installed!(dep)
|
78
|
+
@set.reject! do |t|
|
79
|
+
# already locally installed
|
80
|
+
Gem::Specification.any? do |installed_spec|
|
81
|
+
dep.name == installed_spec.name and
|
82
|
+
dep.requirement.satisfied_by? installed_spec.version
|
85
83
|
end
|
86
|
-
|
87
|
-
@sorted = nil
|
88
|
-
self
|
89
84
|
end
|
90
85
|
|
91
|
-
|
92
|
-
|
93
|
-
|
86
|
+
@sorted = nil
|
87
|
+
self
|
88
|
+
end
|
89
|
+
|
90
|
+
def inject_into_list(dep_list)
|
91
|
+
@set.each { |t| dep_list.add t.spec }
|
94
92
|
end
|
95
93
|
end
|
@@ -192,9 +192,13 @@ class Gem::Commands::QueryCommand < Gem::Command
|
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
|
-
def entry_details entry,
|
195
|
+
def entry_details entry, detail_tuple, specs, platforms
|
196
196
|
return unless options[:details]
|
197
197
|
|
198
|
+
name_tuple, spec = detail_tuple
|
199
|
+
|
200
|
+
spec = spec.fetch_spec name_tuple unless Gem::Specification === spec
|
201
|
+
|
198
202
|
entry << "\n"
|
199
203
|
|
200
204
|
spec_platforms entry, platforms
|
@@ -228,19 +232,15 @@ class Gem::Commands::QueryCommand < Gem::Command
|
|
228
232
|
|
229
233
|
def make_entry entry_tuples, platforms
|
230
234
|
detail_tuple = entry_tuples.first
|
231
|
-
name_tuple, latest_spec = detail_tuple
|
232
|
-
|
233
|
-
latest_spec = latest_spec.fetch_spec name_tuple unless
|
234
|
-
Gem::Specification === latest_spec
|
235
235
|
|
236
236
|
name_tuples, specs = entry_tuples.flatten.partition do |item|
|
237
237
|
Gem::NameTuple === item
|
238
238
|
end
|
239
239
|
|
240
|
-
entry = [
|
240
|
+
entry = [name_tuples.first.name]
|
241
241
|
|
242
242
|
entry_versions entry, name_tuples, platforms
|
243
|
-
entry_details entry,
|
243
|
+
entry_details entry, detail_tuple, specs, platforms
|
244
244
|
|
245
245
|
entry.join
|
246
246
|
end
|
@@ -77,6 +77,8 @@ class Gem::Commands::SetupCommand < Gem::Command
|
|
77
77
|
|
78
78
|
options[:document].uniq!
|
79
79
|
end
|
80
|
+
|
81
|
+
@verbose = nil
|
80
82
|
end
|
81
83
|
|
82
84
|
def check_ruby_version
|
@@ -279,18 +281,27 @@ TEXT
|
|
279
281
|
end
|
280
282
|
end
|
281
283
|
|
284
|
+
def install_file file, dest_dir
|
285
|
+
dest_file = File.join dest_dir, file
|
286
|
+
dest_dir = File.dirname dest_file
|
287
|
+
mkdir_p dest_dir unless File.directory? dest_dir
|
288
|
+
|
289
|
+
install file, dest_file, :mode => 0644
|
290
|
+
end
|
291
|
+
|
282
292
|
def install_lib(lib_dir)
|
283
293
|
say "Installing RubyGems" if @verbose
|
284
294
|
|
285
295
|
lib_files = rb_files_in 'lib'
|
296
|
+
pem_files = pem_files_in 'lib'
|
286
297
|
|
287
298
|
Dir.chdir 'lib' do
|
288
299
|
lib_files.each do |lib_file|
|
289
|
-
|
290
|
-
|
291
|
-
mkdir_p dest_dir unless File.directory? dest_dir
|
300
|
+
install_file lib_file, lib_dir
|
301
|
+
end
|
292
302
|
|
293
|
-
|
303
|
+
pem_files.each do |pem_file|
|
304
|
+
install_file pem_file, lib_dir
|
294
305
|
end
|
295
306
|
end
|
296
307
|
end
|
@@ -381,6 +392,12 @@ TEXT
|
|
381
392
|
[lib_dir, bin_dir]
|
382
393
|
end
|
383
394
|
|
395
|
+
def pem_files_in dir
|
396
|
+
Dir.chdir dir do
|
397
|
+
Dir[File.join('**', '*pem')]
|
398
|
+
end
|
399
|
+
end
|
400
|
+
|
384
401
|
def rb_files_in dir
|
385
402
|
Dir.chdir dir do
|
386
403
|
Dir[File.join('**', '*rb')]
|
@@ -65,6 +65,19 @@ class Gem::Commands::SourcesCommand < Gem::Command
|
|
65
65
|
end
|
66
66
|
|
67
67
|
if source_uri = options[:add] then
|
68
|
+
uri = URI source_uri
|
69
|
+
|
70
|
+
if uri.scheme and uri.scheme.downcase == 'http' and
|
71
|
+
uri.host.downcase == 'rubygems.org' then
|
72
|
+
question = <<-QUESTION.chomp
|
73
|
+
https://rubygems.org is recommended for security over #{uri}
|
74
|
+
|
75
|
+
Do you want to add this insecure source?
|
76
|
+
QUESTION
|
77
|
+
|
78
|
+
terminate_interaction 1 unless ask_yes_no question
|
79
|
+
end
|
80
|
+
|
68
81
|
source = Gem::Source.new source_uri
|
69
82
|
|
70
83
|
begin
|
data/lib/rubygems/config_file.rb
CHANGED
@@ -126,16 +126,6 @@ class Gem::ConfigFile
|
|
126
126
|
|
127
127
|
attr_accessor :update_sources
|
128
128
|
|
129
|
-
##
|
130
|
-
# API key for RubyGems.org
|
131
|
-
|
132
|
-
attr_reader :rubygems_api_key
|
133
|
-
|
134
|
-
##
|
135
|
-
# Hash of RubyGems.org and alternate API keys
|
136
|
-
|
137
|
-
attr_reader :api_keys
|
138
|
-
|
139
129
|
##
|
140
130
|
# True if we want to force specification of gem server when pushing a gem
|
141
131
|
|
@@ -221,12 +211,22 @@ class Gem::ConfigFile
|
|
221
211
|
@ssl_verify_mode = @hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode
|
222
212
|
@ssl_ca_cert = @hash[:ssl_ca_cert] if @hash.key? :ssl_ca_cert
|
223
213
|
|
224
|
-
|
214
|
+
@api_keys = nil
|
215
|
+
@rubygems_api_key = nil
|
225
216
|
|
226
217
|
Gem.sources = @hash[:sources] if @hash.key? :sources
|
227
218
|
handle_arguments arg_list
|
228
219
|
end
|
229
220
|
|
221
|
+
##
|
222
|
+
# Hash of RubyGems.org and alternate API keys
|
223
|
+
|
224
|
+
def api_keys
|
225
|
+
load_api_keys unless @api_keys
|
226
|
+
|
227
|
+
@api_keys
|
228
|
+
end
|
229
|
+
|
230
230
|
##
|
231
231
|
# Checks the permissions of the credentials file. If they are not 0600 an
|
232
232
|
# error message is displayed and RubyGems aborts.
|
@@ -273,11 +273,24 @@ if you believe they were disclosed to a third party.
|
|
273
273
|
end
|
274
274
|
|
275
275
|
if @api_keys.key? :rubygems_api_key then
|
276
|
-
@rubygems_api_key
|
277
|
-
@api_keys[:rubygems] = @api_keys.delete :rubygems_api_key unless
|
276
|
+
@rubygems_api_key = @api_keys[:rubygems_api_key]
|
277
|
+
@api_keys[:rubygems] = @api_keys.delete :rubygems_api_key unless
|
278
|
+
@api_keys.key? :rubygems
|
278
279
|
end
|
279
280
|
end
|
280
281
|
|
282
|
+
##
|
283
|
+
# Returns the RubyGems.org API key
|
284
|
+
|
285
|
+
def rubygems_api_key
|
286
|
+
load_api_keys unless @rubygems_api_key
|
287
|
+
|
288
|
+
@rubygems_api_key
|
289
|
+
end
|
290
|
+
|
291
|
+
##
|
292
|
+
# Sets the RubyGems.org API key to +api_key+
|
293
|
+
|
281
294
|
def rubygems_api_key= api_key
|
282
295
|
check_credentials_permissions
|
283
296
|
|
@@ -304,14 +317,14 @@ if you believe they were disclosed to a third party.
|
|
304
317
|
begin
|
305
318
|
content = YAML.load(File.read(filename))
|
306
319
|
unless content.kind_of? Hash
|
307
|
-
warn "Failed to load #{
|
320
|
+
warn "Failed to load #{filename} because it doesn't contain valid YAML hash"
|
308
321
|
return {}
|
309
322
|
end
|
310
323
|
return content
|
311
324
|
rescue ArgumentError
|
312
|
-
warn "Failed to load #{
|
325
|
+
warn "Failed to load #{filename}"
|
313
326
|
rescue Errno::EACCES
|
314
|
-
warn "Failed to load #{
|
327
|
+
warn "Failed to load #{filename} due to permissions problem."
|
315
328
|
end
|
316
329
|
|
317
330
|
{}
|