rubygems-update 1.3.1 → 1.3.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.
- data.tar.gz.sig +0 -0
- data/.autotest +24 -0
- data/.document +4 -3
- data/ChangeLog +382 -1
- data/Manifest.txt +214 -0
- data/README +1 -49
- data/Rakefile +124 -191
- data/bin/gem +1 -4
- data/cruise_config.rb +22 -0
- data/doc/release_notes/rel_1_3_1.rdoc +3 -3
- data/doc/release_notes/rel_1_3_2.rdoc +119 -0
- data/lib/gauntlet_rubygems.rb +50 -0
- data/lib/rubygems.rb +250 -25
- data/lib/rubygems/builder.rb +62 -60
- data/lib/rubygems/command.rb +421 -319
- data/lib/rubygems/command_manager.rb +153 -125
- data/lib/rubygems/commands/check_command.rb +12 -7
- data/lib/rubygems/commands/cleanup_command.rb +11 -2
- data/lib/rubygems/commands/contents_command.rb +42 -18
- data/lib/rubygems/commands/generate_index_command.rb +91 -15
- data/lib/rubygems/commands/install_command.rb +33 -47
- data/lib/rubygems/commands/query_command.rb +36 -20
- data/lib/rubygems/commands/rdoc_command.rb +62 -68
- data/lib/rubygems/commands/search_command.rb +26 -32
- data/lib/rubygems/commands/setup_command.rb +353 -0
- data/lib/rubygems/commands/sources_command.rb +5 -0
- data/lib/rubygems/commands/specification_command.rb +23 -3
- data/lib/rubygems/commands/uninstall_command.rb +71 -61
- data/lib/rubygems/commands/unpack_command.rb +14 -12
- data/lib/rubygems/commands/update_command.rb +26 -5
- data/lib/rubygems/defaults.rb +16 -3
- data/lib/rubygems/dependency.rb +38 -7
- data/lib/rubygems/dependency_installer.rb +7 -4
- data/lib/rubygems/digest/digest_adapter.rb +42 -33
- data/lib/rubygems/digest/sha1.rb +6 -1
- data/lib/rubygems/digest/sha2.rb +5 -0
- data/lib/rubygems/doc_manager.rb +31 -11
- data/lib/rubygems/ext/ext_conf_builder.rb +2 -1
- data/lib/rubygems/ext/rake_builder.rb +6 -2
- data/lib/rubygems/format.rb +63 -63
- data/lib/rubygems/gem_openssl.rb +14 -2
- data/lib/rubygems/gem_path_searcher.rb +7 -3
- data/lib/rubygems/gem_runner.rb +59 -39
- data/lib/rubygems/indexer.rb +450 -109
- data/lib/rubygems/install_update_options.rb +13 -1
- data/lib/rubygems/installer.rb +25 -22
- data/lib/rubygems/local_remote_options.rb +5 -3
- data/lib/rubygems/old_format.rb +124 -120
- data/lib/rubygems/package/tar_header.rb +25 -3
- data/lib/rubygems/package/tar_input.rb +5 -5
- data/lib/rubygems/package/tar_output.rb +2 -0
- data/lib/rubygems/package/tar_reader.rb +19 -0
- data/lib/rubygems/package/tar_reader/entry.rb +43 -0
- data/lib/rubygems/package/tar_writer.rb +65 -3
- data/lib/rubygems/package_task.rb +117 -0
- data/lib/rubygems/platform.rb +12 -8
- data/lib/rubygems/remote_fetcher.rb +43 -24
- data/lib/rubygems/require_paths_builder.rb +14 -12
- data/lib/rubygems/requirement.rb +15 -6
- data/lib/rubygems/rubygems_version.rb +14 -1
- data/lib/rubygems/source_index.rb +38 -16
- data/lib/rubygems/source_info_cache_entry.rb +2 -2
- data/lib/rubygems/spec_fetcher.rb +43 -20
- data/lib/rubygems/specification.rb +1122 -947
- data/lib/rubygems/text.rb +30 -0
- data/lib/rubygems/timer.rb +14 -11
- data/lib/rubygems/uninstaller.rb +25 -5
- data/lib/rubygems/user_interaction.rb +294 -264
- data/lib/rubygems/validator.rb +70 -36
- data/lib/rubygems/version.rb +97 -33
- data/lib/rubygems/version_option.rb +1 -0
- data/setup.rb +11 -306
- data/test/foo/discover.rb +0 -0
- data/test/gem_installer_test_case.rb +22 -11
- data/test/gem_package_tar_test_case.rb +0 -14
- data/test/gemutilities.rb +89 -8
- data/test/mockgemui.rb +2 -1
- data/test/rubygems_plugin.rb +16 -0
- data/test/test_gem.rb +107 -36
- data/test/test_gem_command.rb +3 -13
- data/test/test_gem_command_manager.rb +1 -14
- data/test/test_gem_commands_cert_command.rb +1 -1
- data/test/test_gem_commands_contents_command.rb +63 -0
- data/test/test_gem_commands_environment_command.rb +1 -1
- data/test/test_gem_commands_generate_index_command.rb +104 -1
- data/test/test_gem_commands_install_command.rb +95 -0
- data/test/test_gem_commands_pristine_command.rb +3 -3
- data/test/test_gem_commands_query_command.rb +46 -0
- data/test/test_gem_commands_sources_command.rb +9 -5
- data/test/test_gem_commands_specification_command.rb +31 -0
- data/test/test_gem_commands_uninstall_command.rb +3 -2
- data/test/test_gem_commands_unpack_command.rb +3 -2
- data/test/test_gem_commands_update_command.rb +12 -7
- data/test/test_gem_dependency.rb +62 -11
- data/test/test_gem_dependency_installer.rb +18 -5
- data/test/test_gem_dependency_list.rb +6 -6
- data/test/test_gem_doc_manager.rb +7 -1
- data/test/test_gem_ext_configure_builder.rb +8 -10
- data/test/test_gem_ext_ext_conf_builder.rb +14 -8
- data/test/test_gem_gem_path_searcher.rb +1 -1
- data/test/test_gem_gem_runner.rb +11 -0
- data/test/test_gem_indexer.rb +398 -21
- data/test/test_gem_install_update_options.rb +20 -6
- data/test/test_gem_installer.rb +22 -14
- data/test/test_gem_local_remote_options.rb +2 -1
- data/test/test_gem_package_tar_header.rb +3 -3
- data/test/test_gem_package_tar_input.rb +3 -3
- data/test/test_gem_package_tar_output.rb +2 -2
- data/test/test_gem_package_task.rb +70 -0
- data/test/test_gem_platform.rb +12 -6
- data/test/test_gem_remote_fetcher.rb +23 -1
- data/test/test_gem_source_index.rb +32 -21
- data/test/test_gem_spec_fetcher.rb +77 -5
- data/test/test_gem_specification.rb +274 -1
- data/test/test_gem_uninstaller.rb +34 -4
- data/test/test_gem_version.rb +94 -4
- data/test/test_gem_version_option.rb +13 -0
- data/test/test_kernel.rb +4 -4
- data/util/CL2notes +56 -0
- data/util/gem_prelude.rb.template +251 -0
- metadata +30 -20
- metadata.gz.sig +3 -4
- data/TODO +0 -1
- data/scripts/buildtests.rb +0 -31
- data/scripts/gemdoc.rb +0 -67
- data/scripts/runtest.rb +0 -40
- data/scripts/specdoc.rb +0 -171
- data/scripts/upload_gemdoc.rb +0 -140
data/lib/rubygems/digest/sha1.rb
CHANGED
@@ -7,11 +7,16 @@
|
|
7
7
|
|
8
8
|
require 'digest/sha1'
|
9
9
|
|
10
|
+
# :stopdoc:
|
10
11
|
module Gem
|
12
|
+
|
11
13
|
if RUBY_VERSION >= '1.8.6'
|
12
14
|
SHA1 = Digest::SHA1
|
13
15
|
else
|
14
16
|
require 'rubygems/digest/digest_adapter'
|
15
17
|
SHA1 = DigestAdapter.new(Digest::SHA1)
|
16
18
|
end
|
17
|
-
|
19
|
+
|
20
|
+
end
|
21
|
+
# :startdoc:
|
22
|
+
|
data/lib/rubygems/digest/sha2.rb
CHANGED
@@ -7,11 +7,16 @@
|
|
7
7
|
|
8
8
|
require 'digest/sha2'
|
9
9
|
|
10
|
+
# :stopdoc:
|
10
11
|
module Gem
|
12
|
+
|
11
13
|
if RUBY_VERSION >= '1.8.6'
|
12
14
|
SHA256 = Digest::SHA256
|
13
15
|
else
|
14
16
|
require 'rubygems/digest/digest_adapter'
|
15
17
|
SHA256 = DigestAdapter.new(Digest::SHA256)
|
16
18
|
end
|
19
|
+
|
17
20
|
end
|
21
|
+
# :startdoc:
|
22
|
+
|
data/lib/rubygems/doc_manager.rb
CHANGED
@@ -41,12 +41,23 @@ class Gem::DocManager
|
|
41
41
|
|
42
42
|
begin
|
43
43
|
require 'rdoc/rdoc'
|
44
|
+
|
45
|
+
@rdoc_version = if defined? RDoc::VERSION then
|
46
|
+
Gem::Version.new RDoc::VERSION
|
47
|
+
else
|
48
|
+
Gem::Version.new '1.0.1' # HACK parsing is hard
|
49
|
+
end
|
50
|
+
|
44
51
|
rescue LoadError => e
|
45
52
|
raise Gem::DocumentError,
|
46
|
-
"ERROR: RDoc documentation generator not installed
|
53
|
+
"ERROR: RDoc documentation generator not installed: #{e}"
|
47
54
|
end
|
48
55
|
end
|
49
56
|
|
57
|
+
def self.rdoc_version
|
58
|
+
@rdoc_version
|
59
|
+
end
|
60
|
+
|
50
61
|
##
|
51
62
|
# Updates the RI cache for RDoc 2 if it is installed
|
52
63
|
|
@@ -151,8 +162,17 @@ class Gem::DocManager
|
|
151
162
|
args << '--quiet'
|
152
163
|
args << @spec.require_paths.clone
|
153
164
|
args << @spec.extra_rdoc_files
|
165
|
+
args << '--title' << "#{@spec.full_name} Documentation"
|
154
166
|
args = args.flatten.map do |arg| arg.to_s end
|
155
167
|
|
168
|
+
if self.class.rdoc_version >= Gem::Version.new('2.4.0') then
|
169
|
+
args.delete '--inline-source'
|
170
|
+
args.delete '--promiscuous'
|
171
|
+
args.delete '-p'
|
172
|
+
args.delete '--one-file'
|
173
|
+
# HACK more
|
174
|
+
end
|
175
|
+
|
156
176
|
r = RDoc::RDoc.new
|
157
177
|
|
158
178
|
old_pwd = Dir.pwd
|
@@ -194,20 +214,20 @@ class Gem::DocManager
|
|
194
214
|
original_name = [
|
195
215
|
@spec.name, @spec.version, @spec.original_platform].join '-'
|
196
216
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
217
|
+
doc_dir = File.join @spec.installation_path, 'doc', @spec.full_name
|
218
|
+
unless File.directory? doc_dir then
|
219
|
+
doc_dir = File.join @spec.installation_path, 'doc', original_name
|
220
|
+
end
|
201
221
|
|
202
|
-
|
222
|
+
FileUtils.rm_rf doc_dir
|
203
223
|
|
204
|
-
|
224
|
+
ri_dir = File.join @spec.installation_path, 'ri', @spec.full_name
|
205
225
|
|
206
|
-
|
207
|
-
|
208
|
-
|
226
|
+
unless File.directory? ri_dir then
|
227
|
+
ri_dir = File.join @spec.installation_path, 'ri', original_name
|
228
|
+
end
|
209
229
|
|
210
|
-
|
230
|
+
FileUtils.rm_rf ri_dir
|
211
231
|
end
|
212
232
|
|
213
233
|
end
|
@@ -5,12 +5,13 @@
|
|
5
5
|
#++
|
6
6
|
|
7
7
|
require 'rubygems/ext/builder'
|
8
|
+
require 'rubygems/command'
|
8
9
|
|
9
10
|
class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
10
11
|
|
11
12
|
def self.build(extension, directory, dest_path, results)
|
12
13
|
cmd = "#{Gem.ruby} #{File.basename extension}"
|
13
|
-
cmd << " #{
|
14
|
+
cmd << " #{Gem::Command.build_args.join ' '}" unless Gem::Command.build_args.empty?
|
14
15
|
|
15
16
|
run cmd, results
|
16
17
|
|
@@ -5,17 +5,21 @@
|
|
5
5
|
#++
|
6
6
|
|
7
7
|
require 'rubygems/ext/builder'
|
8
|
+
require 'rubygems/command'
|
8
9
|
|
9
10
|
class Gem::Ext::RakeBuilder < Gem::Ext::Builder
|
10
11
|
|
11
12
|
def self.build(extension, directory, dest_path, results)
|
12
13
|
if File.basename(extension) =~ /mkrf_conf/i then
|
13
14
|
cmd = "#{Gem.ruby} #{File.basename extension}"
|
14
|
-
cmd << " #{
|
15
|
+
cmd << " #{Gem::Command.build_args.join " "}" unless Gem::Command.build_args.empty?
|
15
16
|
run cmd, results
|
16
17
|
end
|
17
18
|
|
18
|
-
|
19
|
+
# Deal with possible spaces in the path, e.g. C:/Program Files
|
20
|
+
dest_path = '"' + dest_path + '"' if dest_path.include?(' ')
|
21
|
+
|
22
|
+
cmd = ENV['rake'] || Gem.bin_path('rake') rescue Gem.default_exec_format % 'rake'
|
19
23
|
cmd += " RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}" # ENV is frozen
|
20
24
|
|
21
25
|
run cmd, results
|
data/lib/rubygems/format.rb
CHANGED
@@ -8,80 +8,80 @@ require 'fileutils'
|
|
8
8
|
|
9
9
|
require 'rubygems/package'
|
10
10
|
|
11
|
-
|
11
|
+
##
|
12
|
+
# Gem::Format knows the guts of the RubyGem .gem file format and provides the
|
13
|
+
# capability to read gem files
|
14
|
+
|
15
|
+
class Gem::Format
|
16
|
+
|
17
|
+
attr_accessor :spec, :file_entries, :gem_path
|
18
|
+
|
19
|
+
extend Gem::UserInteraction
|
12
20
|
|
13
21
|
##
|
14
|
-
#
|
15
|
-
#
|
22
|
+
# Constructs an instance of a Format object, representing the gem's
|
23
|
+
# data structure.
|
16
24
|
#
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# Constructs an instance of a Format object, representing the gem's
|
23
|
-
# data structure.
|
24
|
-
#
|
25
|
-
# gem:: [String] The file name of the gem
|
26
|
-
#
|
27
|
-
def initialize(gem_path)
|
28
|
-
@gem_path = gem_path
|
29
|
-
end
|
30
|
-
|
31
|
-
##
|
32
|
-
# Reads the named gem file and returns a Format object, representing
|
33
|
-
# the data from the gem file
|
34
|
-
#
|
35
|
-
# file_path:: [String] Path to the gem file
|
36
|
-
#
|
37
|
-
def self.from_file_by_path(file_path, security_policy = nil)
|
38
|
-
format = nil
|
39
|
-
|
40
|
-
unless File.exist?(file_path)
|
41
|
-
raise Gem::Exception, "Cannot load gem at [#{file_path}] in #{Dir.pwd}"
|
42
|
-
end
|
25
|
+
# gem:: [String] The file name of the gem
|
26
|
+
#
|
27
|
+
def initialize(gem_path)
|
28
|
+
@gem_path = gem_path
|
29
|
+
end
|
43
30
|
|
44
|
-
|
45
|
-
|
46
|
-
|
31
|
+
##
|
32
|
+
# Reads the named gem file and returns a Format object, representing
|
33
|
+
# the data from the gem file
|
34
|
+
#
|
35
|
+
# file_path:: [String] Path to the gem file
|
47
36
|
|
48
|
-
|
49
|
-
|
50
|
-
open file_path, Gem.binary_mode do |io|
|
51
|
-
format = from_io io, file_path, security_policy
|
52
|
-
end
|
53
|
-
end
|
37
|
+
def self.from_file_by_path(file_path, security_policy = nil)
|
38
|
+
format = nil
|
54
39
|
|
55
|
-
|
40
|
+
unless File.exist?(file_path)
|
41
|
+
raise Gem::Exception, "Cannot load gem at [#{file_path}] in #{Dir.pwd}"
|
56
42
|
end
|
57
43
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
Package.open io, 'r', security_policy do |pkg|
|
68
|
-
format.spec = pkg.metadata
|
69
|
-
format.file_entries = []
|
70
|
-
|
71
|
-
pkg.each do |entry|
|
72
|
-
size = entry.header.size
|
73
|
-
mode = entry.header.mode
|
74
|
-
|
75
|
-
format.file_entries << [{
|
76
|
-
"size" => size, "mode" => mode, "path" => entry.full_name,
|
77
|
-
},
|
78
|
-
entry.read
|
79
|
-
]
|
80
|
-
end
|
44
|
+
# check for old version gem
|
45
|
+
if File.read(file_path, 20).include?("MD5SUM =")
|
46
|
+
require 'rubygems/old_format'
|
47
|
+
|
48
|
+
format = Gem::OldFormat.from_file_by_path(file_path)
|
49
|
+
else
|
50
|
+
open file_path, Gem.binary_mode do |io|
|
51
|
+
format = from_io io, file_path, security_policy
|
81
52
|
end
|
53
|
+
end
|
82
54
|
|
83
|
-
|
55
|
+
return format
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Reads a gem from an io stream and returns a Format object, representing
|
60
|
+
# the data from the gem file
|
61
|
+
#
|
62
|
+
# io:: [IO] Stream from which to read the gem
|
63
|
+
|
64
|
+
def self.from_io(io, gem_path="(io)", security_policy = nil)
|
65
|
+
format = new gem_path
|
66
|
+
|
67
|
+
Gem::Package.open io, 'r', security_policy do |pkg|
|
68
|
+
format.spec = pkg.metadata
|
69
|
+
format.file_entries = []
|
70
|
+
|
71
|
+
pkg.each do |entry|
|
72
|
+
size = entry.header.size
|
73
|
+
mode = entry.header.mode
|
74
|
+
|
75
|
+
format.file_entries << [{
|
76
|
+
"size" => size, "mode" => mode, "path" => entry.full_name,
|
77
|
+
},
|
78
|
+
entry.read
|
79
|
+
]
|
80
|
+
end
|
84
81
|
end
|
85
82
|
|
83
|
+
format
|
86
84
|
end
|
85
|
+
|
87
86
|
end
|
87
|
+
|
data/lib/rubygems/gem_openssl.rb
CHANGED
@@ -4,23 +4,31 @@
|
|
4
4
|
# See LICENSE.txt for permissions.
|
5
5
|
#++
|
6
6
|
|
7
|
+
#--
|
7
8
|
# Some system might not have OpenSSL installed, therefore the core
|
8
9
|
# library file openssl might not be available. We localize testing
|
9
10
|
# for the presence of OpenSSL in this file.
|
11
|
+
#++
|
10
12
|
|
11
13
|
module Gem
|
12
14
|
class << self
|
15
|
+
##
|
13
16
|
# Is SSL (used by the signing commands) available on this
|
14
17
|
# platform?
|
18
|
+
|
15
19
|
def ssl_available?
|
16
20
|
require 'rubygems/gem_openssl'
|
17
21
|
@ssl_available
|
18
22
|
end
|
19
23
|
|
20
|
-
|
24
|
+
##
|
25
|
+
# Is SSL available?
|
26
|
+
|
21
27
|
attr_writer :ssl_available
|
22
28
|
|
29
|
+
##
|
23
30
|
# Ensure that SSL is available. Throw an exception if it is not.
|
31
|
+
|
24
32
|
def ensure_ssl_available
|
25
33
|
unless ssl_available?
|
26
34
|
fail Gem::Exception, "SSL is not installed on this system"
|
@@ -61,6 +69,8 @@ rescue LoadError, StandardError
|
|
61
69
|
Gem.ssl_available = false
|
62
70
|
end
|
63
71
|
|
72
|
+
# :stopdoc:
|
73
|
+
|
64
74
|
module Gem::SSL
|
65
75
|
|
66
76
|
# We make our own versions of the constants here. This allows us
|
@@ -70,7 +80,7 @@ module Gem::SSL
|
|
70
80
|
# These constants are only used during load time. At runtime, any
|
71
81
|
# method that makes a direct reference to SSL software must be
|
72
82
|
# protected with a Gem.ensure_ssl_available call.
|
73
|
-
|
83
|
+
|
74
84
|
if Gem.ssl_available? then
|
75
85
|
PKEY_RSA = OpenSSL::PKey::RSA
|
76
86
|
DIGEST_SHA1 = OpenSSL::Digest::SHA1
|
@@ -81,3 +91,5 @@ module Gem::SSL
|
|
81
91
|
|
82
92
|
end
|
83
93
|
|
94
|
+
# :startdoc:
|
95
|
+
|
@@ -80,11 +80,15 @@ class Gem::GemPathSearcher
|
|
80
80
|
|
81
81
|
##
|
82
82
|
# Return a list of all installed gemspecs, sorted by alphabetical order and
|
83
|
-
# in reverse version order.
|
83
|
+
# in reverse version order. (bar-2, bar-1, foo-2)
|
84
84
|
|
85
85
|
def init_gemspecs
|
86
|
-
Gem.source_index.map { |_, spec| spec }
|
87
|
-
|
86
|
+
specs = Gem.source_index.map { |_, spec| spec }
|
87
|
+
|
88
|
+
specs.sort { |a, b|
|
89
|
+
names = a.name <=> b.name
|
90
|
+
next names if names.nonzero?
|
91
|
+
b.version <=> a.version
|
88
92
|
}
|
89
93
|
end
|
90
94
|
|
data/lib/rubygems/gem_runner.rb
CHANGED
@@ -8,51 +8,71 @@ require 'rubygems/command_manager'
|
|
8
8
|
require 'rubygems/config_file'
|
9
9
|
require 'rubygems/doc_manager'
|
10
10
|
|
11
|
-
|
11
|
+
##
|
12
|
+
# Run an instance of the gem program.
|
13
|
+
#
|
14
|
+
# Gem::GemRunner is only intended for internal use by RubyGems itself. It
|
15
|
+
# does not form any public API and may change at any time for any reason.
|
16
|
+
#
|
17
|
+
# If you would like to duplicate functionality of `gem` commands, use the
|
18
|
+
# classes they call directly.
|
12
19
|
|
13
|
-
|
14
|
-
# Run an instance of the gem program.
|
15
|
-
#
|
16
|
-
class GemRunner
|
20
|
+
class Gem::GemRunner
|
17
21
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
+
def initialize(options={})
|
23
|
+
@command_manager_class = options[:command_manager] || Gem::CommandManager
|
24
|
+
@config_file_class = options[:config_file] || Gem::ConfigFile
|
25
|
+
@doc_manager_class = options[:doc_manager] || Gem::DocManager
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Run the gem command with the following arguments.
|
30
|
+
|
31
|
+
def run(args)
|
32
|
+
start_time = Time.now
|
33
|
+
|
34
|
+
if args.include?('--')
|
35
|
+
# We need to preserve the original ARGV to use for passing gem options
|
36
|
+
# to source gems. If there is a -- in the line, strip all options after
|
37
|
+
# it...its for the source building process.
|
38
|
+
build_args = args[args.index("--") + 1...args.length]
|
39
|
+
args = args[0...args.index("--")]
|
22
40
|
end
|
23
41
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
39
|
-
cmd.run(Gem.configuration.args)
|
40
|
-
end_time = Time.now
|
41
|
-
if Gem.configuration.benchmark
|
42
|
-
printf "\nExecution time: %0.2f seconds.\n", end_time-start_time
|
43
|
-
puts "Press Enter to finish"
|
44
|
-
STDIN.gets
|
45
|
-
end
|
42
|
+
Gem::Command.build_args = build_args if build_args
|
43
|
+
|
44
|
+
do_configuration args
|
45
|
+
cmd = @command_manager_class.instance
|
46
|
+
|
47
|
+
cmd.command_names.each do |command_name|
|
48
|
+
config_args = Gem.configuration[command_name]
|
49
|
+
config_args = case config_args
|
50
|
+
when String
|
51
|
+
config_args.split ' '
|
52
|
+
else
|
53
|
+
Array(config_args)
|
54
|
+
end
|
55
|
+
Gem::Command.add_specific_extra_args command_name, config_args
|
46
56
|
end
|
47
57
|
|
48
|
-
|
58
|
+
cmd.run Gem.configuration.args
|
59
|
+
end_time = Time.now
|
49
60
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
@doc_manager_class.configured_args = Gem.configuration[:rdoc]
|
61
|
+
if Gem.configuration.benchmark then
|
62
|
+
printf "\nExecution time: %0.2f seconds.\n", end_time - start_time
|
63
|
+
puts "Press Enter to finish"
|
64
|
+
STDIN.gets
|
55
65
|
end
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
def do_configuration(args)
|
71
|
+
Gem.configuration = @config_file_class.new(args)
|
72
|
+
Gem.use_paths(Gem.configuration[:gemhome], Gem.configuration[:gempath])
|
73
|
+
Gem::Command.extra_args = Gem.configuration[:gem]
|
74
|
+
@doc_manager_class.configured_args = Gem.configuration[:rdoc]
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
56
78
|
|
57
|
-
end # class
|
58
|
-
end # module
|