rubygems-update 1.3.0 → 1.3.1
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.
- data.tar.gz.sig +0 -0
- data/ChangeLog +31 -0
- data/doc/release_notes/rel_1_3_1.rdoc +75 -0
- data/lib/rubygems.rb +23 -13
- data/lib/rubygems/commands/check_command.rb +2 -1
- data/lib/rubygems/commands/unpack_command.rb +1 -1
- data/lib/rubygems/commands/update_command.rb +4 -5
- data/lib/rubygems/config_file.rb +4 -1
- data/lib/rubygems/custom_require.rb +15 -7
- data/lib/rubygems/defaults.rb +5 -0
- data/lib/rubygems/installer.rb +1 -1
- data/lib/rubygems/rubygems_version.rb +1 -1
- data/lib/rubygems/source_index.rb +1 -2
- data/lib/rubygems/validator.rb +147 -125
- data/test/functional.rb +6 -2
- data/test/gem_installer_test_case.rb +1 -1
- data/test/gemutilities.rb +19 -5
- data/test/test_config.rb +0 -2
- data/test/test_gem.rb +4 -4
- data/test/test_gem_builder.rb +0 -1
- data/test/test_gem_command.rb +2 -3
- data/test/test_gem_command_manager.rb +0 -1
- data/test/test_gem_commands_build_command.rb +0 -1
- data/test/test_gem_commands_cert_command.rb +0 -1
- data/test/test_gem_commands_check_command.rb +0 -1
- data/test/test_gem_commands_contents_command.rb +2 -3
- data/test/test_gem_commands_dependency_command.rb +2 -3
- data/test/test_gem_commands_environment_command.rb +1 -2
- data/test/test_gem_commands_fetch_command.rb +0 -1
- data/test/test_gem_commands_generate_index_command.rb +1 -1
- data/test/test_gem_commands_install_command.rb +2 -3
- data/test/test_gem_commands_list_command.rb +1 -2
- data/test/test_gem_commands_lock_command.rb +1 -2
- data/test/test_gem_commands_mirror_command.rb +0 -1
- data/test/test_gem_commands_outdated_command.rb +0 -1
- data/test/test_gem_commands_pristine_command.rb +1 -2
- data/test/test_gem_commands_query_command.rb +5 -6
- data/test/test_gem_commands_server_command.rb +0 -1
- data/test/test_gem_commands_sources_command.rb +0 -1
- data/test/test_gem_commands_specification_command.rb +1 -2
- data/test/test_gem_commands_stale_command.rb +0 -1
- data/test/test_gem_commands_uninstall_command.rb +5 -4
- data/test/test_gem_commands_unpack_command.rb +0 -1
- data/test/test_gem_commands_update_command.rb +0 -1
- data/test/test_gem_config_file.rb +0 -2
- data/test/test_gem_dependency.rb +13 -14
- data/test/test_gem_dependency_installer.rb +4 -5
- data/test/test_gem_dependency_list.rb +0 -3
- data/test/test_gem_digest.rb +12 -10
- data/test/test_gem_doc_manager.rb +1 -2
- data/test/test_gem_ext_configure_builder.rb +1 -2
- data/test/test_gem_ext_ext_conf_builder.rb +2 -3
- data/test/test_gem_ext_rake_builder.rb +2 -3
- data/test/test_gem_format.rb +4 -6
- data/test/test_gem_gem_path_searcher.rb +0 -1
- data/test/test_gem_gem_runner.rb +0 -1
- data/test/test_gem_indexer.rb +2 -3
- data/test/test_gem_install_update_options.rb +1 -2
- data/test/test_gem_installer.rb +16 -15
- data/test/test_gem_local_remote_options.rb +1 -2
- data/test/test_gem_package_tar_reader_entry.rb +5 -5
- data/test/test_gem_package_tar_writer.rb +10 -10
- data/test/test_gem_platform.rb +6 -19
- data/test/test_gem_remote_fetcher.rb +18 -12
- data/test/test_gem_requirement.rb +14 -15
- data/test/test_gem_server.rb +0 -1
- data/test/test_gem_source_index.rb +5 -6
- data/test/test_gem_source_info_cache.rb +5 -7
- data/test/test_gem_source_info_cache_entry.rb +1 -2
- data/test/test_gem_spec_fetcher.rb +0 -1
- data/test/test_gem_specification.rb +11 -12
- data/test/test_gem_stream_ui.rb +0 -1
- data/test/test_gem_validator.rb +4 -5
- data/test/test_gem_version.rb +9 -10
- data/test/test_gem_version_option.rb +0 -1
- data/test/test_kernel.rb +1 -3
- metadata +4 -3
- metadata.gz.sig +0 -0
data/test/functional.rb
CHANGED
@@ -5,13 +5,14 @@
|
|
5
5
|
# See LICENSE.txt for permissions.
|
6
6
|
#++
|
7
7
|
|
8
|
-
require 'test/unit'
|
9
8
|
require 'rubygems'
|
9
|
+
require 'minitest/unit'
|
10
10
|
require 'test/insure_session'
|
11
11
|
require 'rubygems/format'
|
12
12
|
require 'rubygems/command_manager'
|
13
13
|
|
14
|
-
class FunctionalTest <
|
14
|
+
class FunctionalTest < MiniTest::Unit::TestCase
|
15
|
+
|
15
16
|
def setup
|
16
17
|
@gem_path = File.expand_path("bin/gem")
|
17
18
|
lib_path = File.expand_path("lib")
|
@@ -93,3 +94,6 @@ class FunctionalTest < Test::Unit::TestCase
|
|
93
94
|
end
|
94
95
|
|
95
96
|
end
|
97
|
+
|
98
|
+
MiniTest::Unit.autorun
|
99
|
+
|
data/test/gemutilities.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
#--
|
3
2
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
4
3
|
# All rights reserved.
|
@@ -9,8 +8,14 @@ at_exit { $SAFE = 1 }
|
|
9
8
|
|
10
9
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
11
10
|
|
11
|
+
require 'rubygems'
|
12
12
|
require 'fileutils'
|
13
|
-
|
13
|
+
begin
|
14
|
+
require 'minitest/unit'
|
15
|
+
rescue LoadError
|
16
|
+
warn "Install minitest gem"
|
17
|
+
raise
|
18
|
+
end
|
14
19
|
require 'tmpdir'
|
15
20
|
require 'uri'
|
16
21
|
require 'rubygems/package'
|
@@ -36,7 +41,7 @@ module Gem
|
|
36
41
|
end
|
37
42
|
end
|
38
43
|
|
39
|
-
class RubyGemTestCase <
|
44
|
+
class RubyGemTestCase < MiniTest::Unit::TestCase
|
40
45
|
|
41
46
|
include Gem::DefaultUserInteraction
|
42
47
|
|
@@ -57,6 +62,7 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
57
62
|
@latest_usrcache = File.join(@gemhome, ".gem", "latest_user_cache")
|
58
63
|
@userhome = File.join @tempdir, 'userhome'
|
59
64
|
|
65
|
+
@orig_ENV_HOME = ENV['HOME']
|
60
66
|
ENV['HOME'] = @userhome
|
61
67
|
Gem.instance_variable_set :@user_home, nil
|
62
68
|
|
@@ -131,6 +137,12 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
131
137
|
ENV.delete 'GEM_PATH'
|
132
138
|
|
133
139
|
Gem.clear_paths
|
140
|
+
|
141
|
+
if @orig_ENV_HOME then
|
142
|
+
ENV['HOME'] = @orig_ENV_HOME
|
143
|
+
else
|
144
|
+
ENV.delete 'HOME'
|
145
|
+
end
|
134
146
|
end
|
135
147
|
|
136
148
|
def install_gem gem
|
@@ -461,14 +473,16 @@ class RubyGemTestCase < Test::Unit::TestCase
|
|
461
473
|
|
462
474
|
@@ruby = rubybin
|
463
475
|
env_rake = ENV['rake']
|
464
|
-
ruby19_rake =
|
476
|
+
ruby19_rake = File.expand_path("../../../bin/rake", __FILE__)
|
465
477
|
@@rake = if env_rake then
|
466
478
|
ENV["rake"]
|
467
479
|
elsif File.exist? ruby19_rake then
|
468
|
-
ruby19_rake
|
480
|
+
@@ruby + " " + ruby19_rake
|
469
481
|
else
|
470
482
|
'rake'
|
471
483
|
end
|
472
484
|
|
473
485
|
end
|
474
486
|
|
487
|
+
MiniTest::Unit.autorun
|
488
|
+
|
data/test/test_config.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
#--
|
3
2
|
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
4
3
|
# All rights reserved.
|
5
4
|
# See LICENSE.txt for permissions.
|
6
5
|
#++
|
7
6
|
|
8
|
-
require 'test/unit'
|
9
7
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
10
8
|
require 'rbconfig'
|
11
9
|
require 'rubygems'
|
data/test/test_gem.rb
CHANGED
@@ -65,8 +65,8 @@ class TestGem < RubyGemTestCase
|
|
65
65
|
|
66
66
|
assert_equal nil, Gem.instance_variable_get(:@gem_home)
|
67
67
|
assert_equal nil, Gem.instance_variable_get(:@gem_path)
|
68
|
-
|
69
|
-
|
68
|
+
refute_equal searcher, Gem.searcher
|
69
|
+
refute_equal source_index.object_id, Gem.source_index.object_id
|
70
70
|
end
|
71
71
|
|
72
72
|
def test_self_configuration
|
@@ -214,10 +214,10 @@ class TestGem < RubyGemTestCase
|
|
214
214
|
orig_Gem_ssl_available = Gem.ssl_available?
|
215
215
|
|
216
216
|
Gem.ssl_available = true
|
217
|
-
|
217
|
+
Gem.ensure_ssl_available
|
218
218
|
|
219
219
|
Gem.ssl_available = false
|
220
|
-
e =
|
220
|
+
e = assert_raises Gem::Exception do Gem.ensure_ssl_available end
|
221
221
|
assert_equal 'SSL is not installed on this system', e.message
|
222
222
|
ensure
|
223
223
|
Gem.ssl_available = orig_Gem_ssl_available
|
data/test/test_gem_builder.rb
CHANGED
data/test/test_gem_command.rb
CHANGED
@@ -5,7 +5,6 @@
|
|
5
5
|
# See LICENSE.txt for permissions.
|
6
6
|
#++
|
7
7
|
|
8
|
-
require 'test/unit'
|
9
8
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
10
9
|
require 'rubygems/command'
|
11
10
|
|
@@ -63,7 +62,7 @@ class TestGemCommand < RubyGemTestCase
|
|
63
62
|
|
64
63
|
assert_match %r|-x, --zip|, @cmd.parser.to_s
|
65
64
|
assert_match %r|-z, --exe|, @cmd.parser.to_s
|
66
|
-
|
65
|
+
refute_match %r|-x, --exe|, @cmd.parser.to_s
|
67
66
|
end
|
68
67
|
|
69
68
|
def test_basic_accessors
|
@@ -109,7 +108,7 @@ class TestGemCommand < RubyGemTestCase
|
|
109
108
|
use_ui @ui do
|
110
109
|
@cmd.when_invoked do true end
|
111
110
|
|
112
|
-
ex =
|
111
|
+
ex = assert_raises OptionParser::InvalidOption do
|
113
112
|
@cmd.invoke('-zzz')
|
114
113
|
end
|
115
114
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require 'rubygems/commands/contents_command'
|
4
3
|
|
@@ -28,7 +27,7 @@ class TestGemCommandsContentsCommand < RubyGemTestCase
|
|
28
27
|
def test_execute_bad_gem
|
29
28
|
@cmd.options[:args] = %w[foo]
|
30
29
|
|
31
|
-
|
30
|
+
assert_raises MockGemUi::TermError do
|
32
31
|
use_ui @ui do
|
33
32
|
@cmd.execute
|
34
33
|
end
|
@@ -71,7 +70,7 @@ class TestGemCommandsContentsCommand < RubyGemTestCase
|
|
71
70
|
end
|
72
71
|
|
73
72
|
assert_match %r|lib/foo\.rb|, @ui.output
|
74
|
-
|
73
|
+
refute_match %r|Rakefile|, @ui.output
|
75
74
|
|
76
75
|
assert_equal "", @ui.error
|
77
76
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require 'rubygems/commands/dependency_command'
|
4
3
|
|
@@ -61,7 +60,7 @@ Gem pl-1-x86-linux
|
|
61
60
|
def test_execute_no_match
|
62
61
|
@cmd.options[:args] = %w[foo]
|
63
62
|
|
64
|
-
|
63
|
+
assert_raises MockGemUi::TermError do
|
65
64
|
use_ui @ui do
|
66
65
|
@cmd.execute
|
67
66
|
end
|
@@ -146,7 +145,7 @@ Gem foo-2
|
|
146
145
|
@cmd.options[:reverse_dependencies] = true
|
147
146
|
@cmd.options[:domain] = :remote
|
148
147
|
|
149
|
-
|
148
|
+
assert_raises MockGemUi::TermError do
|
150
149
|
use_ui @ui do
|
151
150
|
@cmd.execute
|
152
151
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require 'rubygems/commands/environment_command'
|
4
3
|
|
@@ -109,7 +108,7 @@ class TestGemCommandsEnvironmentCommand < RubyGemTestCase
|
|
109
108
|
def test_execute_unknown
|
110
109
|
@cmd.send :handle_options, %w[unknown]
|
111
110
|
|
112
|
-
|
111
|
+
assert_raises Gem::CommandLineError do
|
113
112
|
use_ui @ui do
|
114
113
|
@cmd.execute
|
115
114
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require 'rubygems/commands/install_command'
|
4
3
|
|
@@ -16,7 +15,7 @@ class TestGemCommandsInstallCommand < RubyGemTestCase
|
|
16
15
|
@cmd.options[:include_dependencies] = true
|
17
16
|
@cmd.options[:args] = []
|
18
17
|
|
19
|
-
|
18
|
+
assert_raises Gem::CommandLineError do
|
20
19
|
use_ui @ui do
|
21
20
|
@cmd.execute
|
22
21
|
end
|
@@ -79,7 +78,7 @@ class TestGemCommandsInstallCommand < RubyGemTestCase
|
|
79
78
|
def test_execute_no_gem
|
80
79
|
@cmd.options[:args] = %w[]
|
81
80
|
|
82
|
-
|
81
|
+
assert_raises Gem::CommandLineError do
|
83
82
|
@cmd.execute
|
84
83
|
end
|
85
84
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require 'rubygems/commands/list_command'
|
4
3
|
|
@@ -21,7 +20,7 @@ class TestGemCommandsListCommand < RubyGemTestCase
|
|
21
20
|
def test_execute_installed
|
22
21
|
@cmd.handle_options %w[c --installed]
|
23
22
|
|
24
|
-
e =
|
23
|
+
e = assert_raises Gem::SystemExitException do
|
25
24
|
use_ui @ui do
|
26
25
|
@cmd.execute
|
27
26
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require 'rubygems/commands/lock_command'
|
4
3
|
|
@@ -56,7 +55,7 @@ gem 'd', '= 1'
|
|
56
55
|
def test_execute_strict
|
57
56
|
@cmd.handle_options %w[c-1 --strict]
|
58
57
|
|
59
|
-
e =
|
58
|
+
e = assert_raises Gem::Exception do
|
60
59
|
use_ui @ui do
|
61
60
|
@cmd.execute
|
62
61
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require 'rubygems/commands/pristine_command'
|
4
3
|
|
@@ -96,7 +95,7 @@ class TestGemCommandsPristineCommand < RubyGemTestCase
|
|
96
95
|
def test_execute_no_gem
|
97
96
|
@cmd.options[:args] = %w[]
|
98
97
|
|
99
|
-
e =
|
98
|
+
e = assert_raises Gem::CommandLineError do
|
100
99
|
use_ui @ui do
|
101
100
|
@cmd.execute
|
102
101
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require 'rubygems/commands/query_command'
|
4
3
|
|
@@ -99,7 +98,7 @@ pl (1)
|
|
99
98
|
def test_execute_installed
|
100
99
|
@cmd.handle_options %w[-n c --installed]
|
101
100
|
|
102
|
-
e =
|
101
|
+
e = assert_raises Gem::SystemExitException do
|
103
102
|
use_ui @ui do
|
104
103
|
@cmd.execute
|
105
104
|
end
|
@@ -115,7 +114,7 @@ pl (1)
|
|
115
114
|
def test_execute_installed_no_name
|
116
115
|
@cmd.handle_options %w[--installed]
|
117
116
|
|
118
|
-
e =
|
117
|
+
e = assert_raises Gem::SystemExitException do
|
119
118
|
use_ui @ui do
|
120
119
|
@cmd.execute
|
121
120
|
end
|
@@ -130,7 +129,7 @@ pl (1)
|
|
130
129
|
def test_execute_installed_not_installed
|
131
130
|
@cmd.handle_options %w[-n not_installed --installed]
|
132
131
|
|
133
|
-
e =
|
132
|
+
e = assert_raises Gem::SystemExitException do
|
134
133
|
use_ui @ui do
|
135
134
|
@cmd.execute
|
136
135
|
end
|
@@ -145,7 +144,7 @@ pl (1)
|
|
145
144
|
def test_execute_installed_version
|
146
145
|
@cmd.handle_options %w[-n c --installed --version 1.2]
|
147
146
|
|
148
|
-
e =
|
147
|
+
e = assert_raises Gem::SystemExitException do
|
149
148
|
use_ui @ui do
|
150
149
|
@cmd.execute
|
151
150
|
end
|
@@ -160,7 +159,7 @@ pl (1)
|
|
160
159
|
def test_execute_installed_version_not_installed
|
161
160
|
@cmd.handle_options %w[-n c --installed --version 2]
|
162
161
|
|
163
|
-
e =
|
162
|
+
e = assert_raises Gem::SystemExitException do
|
164
163
|
use_ui @ui do
|
165
164
|
@cmd.execute
|
166
165
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require 'rubygems/commands/specification_command'
|
4
3
|
|
@@ -46,7 +45,7 @@ class TestGemCommandsSpecificationCommand < RubyGemTestCase
|
|
46
45
|
def test_execute_bad_name
|
47
46
|
@cmd.options[:args] = %w[foo]
|
48
47
|
|
49
|
-
|
48
|
+
assert_raises MockGemUi::TermError do
|
50
49
|
use_ui @ui do
|
51
50
|
@cmd.execute
|
52
51
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'test/unit'
|
2
1
|
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
|
3
2
|
require File.join(File.expand_path(File.dirname(__FILE__)),
|
4
3
|
'gem_installer_test_case')
|
@@ -12,8 +11,10 @@ class TestGemCommandsUninstallCommand < GemInstallerTestCase
|
|
12
11
|
ui = MockGemUi.new
|
13
12
|
util_setup_gem ui
|
14
13
|
|
15
|
-
|
16
|
-
|
14
|
+
build_rake_in do
|
15
|
+
use_ui ui do
|
16
|
+
@installer.install
|
17
|
+
end
|
17
18
|
end
|
18
19
|
|
19
20
|
@cmd = Gem::Commands::UninstallCommand.new
|
@@ -46,7 +47,7 @@ class TestGemCommandsUninstallCommand < GemInstallerTestCase
|
|
46
47
|
|
47
48
|
def test_execute_not_installed
|
48
49
|
@cmd.options[:args] = ["foo"]
|
49
|
-
e =
|
50
|
+
e = assert_raises Gem::InstallError do
|
50
51
|
use_ui @ui do
|
51
52
|
@cmd.execute
|
52
53
|
end
|