rubygems-update 1.8.30 → 2.0.0.preview2
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 +6 -6
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +3 -0
- data/.autotest +6 -3
- data/History.txt +137 -63
- data/LICENSE.txt +1 -5
- data/Manifest.txt +69 -32
- data/README.rdoc +11 -9
- data/Rakefile +24 -38
- data/bin/gem +0 -9
- data/bin/update_rubygems +1 -0
- data/lib/rubygems.rb +193 -405
- data/lib/rubygems/available_set.rb +95 -0
- data/lib/rubygems/command.rb +88 -45
- data/lib/rubygems/command_manager.rb +67 -40
- data/lib/rubygems/commands/build_command.rb +5 -23
- data/lib/rubygems/commands/cert_command.rb +199 -57
- data/lib/rubygems/commands/check_command.rb +14 -39
- data/lib/rubygems/commands/cleanup_command.rb +9 -1
- data/lib/rubygems/commands/contents_command.rb +30 -12
- data/lib/rubygems/commands/dependency_command.rb +3 -8
- data/lib/rubygems/commands/environment_command.rb +13 -8
- data/lib/rubygems/commands/fetch_command.rb +3 -16
- data/lib/rubygems/commands/generate_index_command.rb +7 -47
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/install_command.rb +69 -36
- data/lib/rubygems/commands/list_command.rb +6 -4
- data/lib/rubygems/commands/lock_command.rb +1 -1
- data/lib/rubygems/commands/mirror_command.rb +17 -0
- data/lib/rubygems/commands/outdated_command.rb +6 -3
- data/lib/rubygems/commands/owner_command.rb +13 -5
- data/lib/rubygems/commands/pristine_command.rb +19 -4
- data/lib/rubygems/commands/push_command.rb +12 -1
- data/lib/rubygems/commands/query_command.rb +43 -27
- data/lib/rubygems/commands/rdoc_command.rb +23 -28
- data/lib/rubygems/commands/search_command.rb +4 -18
- data/lib/rubygems/commands/server_command.rb +1 -1
- data/lib/rubygems/commands/setup_command.rb +124 -38
- data/lib/rubygems/commands/sources_command.rb +16 -16
- data/lib/rubygems/commands/specification_command.rb +11 -13
- data/lib/rubygems/commands/uninstall_command.rb +24 -7
- data/lib/rubygems/commands/unpack_command.rb +7 -3
- data/lib/rubygems/commands/update_command.rb +22 -36
- data/lib/rubygems/commands/yank_command.rb +98 -0
- data/lib/rubygems/compatibility.rb +51 -0
- data/lib/rubygems/config_file.rb +82 -54
- data/lib/rubygems/core_ext/kernel_gem.rb +53 -0
- data/lib/rubygems/core_ext/kernel_require.rb +119 -0
- data/lib/rubygems/defaults.rb +10 -21
- data/lib/rubygems/dependency.rb +61 -10
- data/lib/rubygems/dependency_installer.rb +157 -69
- data/lib/rubygems/dependency_list.rb +11 -19
- data/lib/rubygems/dependency_resolver.rb +562 -0
- data/lib/rubygems/deprecate.rb +40 -40
- data/lib/rubygems/errors.rb +77 -24
- data/lib/rubygems/exceptions.rb +25 -7
- data/lib/rubygems/ext/builder.rb +20 -23
- data/lib/rubygems/ext/configure_builder.rb +2 -2
- data/lib/rubygems/ext/ext_conf_builder.rb +5 -45
- data/lib/rubygems/ext/rake_builder.rb +2 -2
- data/lib/rubygems/gem_runner.rb +3 -16
- data/lib/rubygems/gemcutter_utilities.rb +22 -7
- data/lib/rubygems/indexer.rb +6 -159
- data/lib/rubygems/install_message.rb +12 -0
- data/lib/rubygems/install_update_options.rb +56 -18
- data/lib/rubygems/installer.rb +244 -134
- data/lib/rubygems/installer_test_case.rb +71 -19
- data/lib/rubygems/mock_gem_ui.rb +17 -0
- data/lib/rubygems/name_tuple.rb +110 -0
- data/lib/rubygems/package.rb +514 -43
- data/lib/rubygems/package/digest_io.rb +64 -0
- data/lib/rubygems/package/old.rb +147 -0
- data/lib/rubygems/package/tar_header.rb +18 -55
- data/lib/rubygems/package/tar_reader.rb +20 -3
- data/lib/rubygems/package/tar_writer.rb +63 -7
- data/lib/rubygems/package_task.rb +3 -4
- data/lib/rubygems/path_support.rb +14 -7
- data/lib/rubygems/platform.rb +19 -26
- data/lib/rubygems/rdoc.rb +316 -0
- data/lib/rubygems/remote_fetcher.rb +117 -54
- data/lib/rubygems/request_set.rb +182 -0
- data/lib/rubygems/requirement.rb +63 -26
- data/lib/rubygems/security.rb +295 -555
- data/lib/rubygems/security/policies.rb +115 -0
- data/lib/rubygems/security/policy.rb +227 -0
- data/lib/rubygems/security/signer.rb +136 -0
- data/lib/rubygems/security/trust_dir.rb +104 -0
- data/lib/rubygems/server.rb +45 -55
- data/lib/rubygems/source.rb +144 -0
- data/lib/rubygems/source_list.rb +87 -0
- data/lib/rubygems/source_local.rb +92 -0
- data/lib/rubygems/source_specific_file.rb +28 -0
- data/lib/rubygems/spec_fetcher.rb +116 -184
- data/lib/rubygems/specification.rb +731 -335
- data/lib/rubygems/ssl_certs/AddTrustExternalCARoot.pem +88 -30
- data/lib/rubygems/ssl_certs/Entrust_net-Secure-Server-Certification-Authority.pem +90 -0
- data/lib/rubygems/ssl_certs/VerisignClass3PublicPrimaryCertificationAuthority-G2.pem +57 -0
- data/lib/rubygems/syck_hack.rb +2 -0
- data/lib/rubygems/test_case.rb +199 -109
- data/lib/rubygems/test_utilities.rb +25 -5
- data/lib/rubygems/uninstaller.rb +62 -20
- data/lib/rubygems/user_interaction.rb +10 -0
- data/lib/rubygems/validator.rb +33 -40
- data/lib/rubygems/version.rb +19 -8
- data/setup.rb +8 -1
- data/test/rubygems/alternate_cert.pem +9 -0
- data/test/rubygems/alternate_cert_32.pem +9 -0
- data/test/rubygems/alternate_key.pem +9 -0
- data/test/rubygems/bad_rake.rb +1 -0
- data/test/rubygems/child_cert.pem +9 -0
- data/test/rubygems/child_cert_32.pem +9 -0
- data/test/rubygems/child_key.pem +9 -0
- data/test/rubygems/data/null-type.gemspec.rz +0 -0
- data/test/rubygems/expired_cert.pem +9 -0
- data/test/rubygems/future_cert.pem +9 -0
- data/test/rubygems/future_cert_32.pem +9 -0
- data/test/rubygems/good_rake.rb +1 -0
- data/test/rubygems/grandchild_cert.pem +9 -0
- data/test/rubygems/grandchild_cert_32.pem +9 -0
- data/test/rubygems/grandchild_key.pem +9 -0
- data/test/rubygems/invalid_issuer_cert.pem +9 -0
- data/test/rubygems/invalid_issuer_cert_32.pem +9 -0
- data/test/rubygems/invalid_key.pem +9 -0
- data/test/rubygems/invalid_signer_cert.pem +9 -0
- data/test/rubygems/invalid_signer_cert_32.pem +9 -0
- data/test/rubygems/invalidchild_cert.pem +9 -0
- data/test/rubygems/invalidchild_cert_32.pem +9 -0
- data/test/rubygems/invalidchild_key.pem +9 -0
- data/test/rubygems/plugin/exception/rubygems_plugin.rb +1 -1
- data/test/rubygems/plugin/standarderror/rubygems_plugin.rb +1 -1
- data/test/rubygems/private_key.pem +7 -25
- data/test/rubygems/public_cert.pem +8 -18
- data/test/rubygems/public_cert_32.pem +10 -0
- data/test/rubygems/public_key.pem +4 -0
- data/test/rubygems/rubygems/commands/crash_command.rb +1 -1
- data/test/rubygems/test_config.rb +4 -6
- data/test/rubygems/test_deprecate.rb +76 -0
- data/test/rubygems/test_gem.rb +318 -83
- data/test/rubygems/test_gem_available_set.rb +106 -0
- data/test/rubygems/test_gem_command.rb +10 -0
- data/test/rubygems/test_gem_command_manager.rb +55 -9
- data/test/rubygems/test_gem_commands_build_command.rb +11 -19
- data/test/rubygems/test_gem_commands_cert_command.rb +441 -42
- data/test/rubygems/test_gem_commands_cleanup_command.rb +29 -1
- data/test/rubygems/test_gem_commands_contents_command.rb +23 -0
- data/test/rubygems/test_gem_commands_dependency_command.rb +5 -0
- data/test/rubygems/test_gem_commands_fetch_command.rb +19 -20
- data/test/rubygems/test_gem_commands_generate_index_command.rb +2 -83
- data/test/rubygems/test_gem_commands_help_command.rb +2 -1
- data/test/rubygems/test_gem_commands_install_command.rb +647 -48
- data/test/rubygems/test_gem_commands_mirror.rb +32 -0
- data/test/rubygems/test_gem_commands_owner_command.rb +4 -8
- data/test/rubygems/test_gem_commands_pristine_command.rb +99 -4
- data/test/rubygems/test_gem_commands_push_command.rb +62 -8
- data/test/rubygems/test_gem_commands_query_command.rb +51 -0
- data/test/rubygems/test_gem_commands_search_command.rb +25 -0
- data/test/rubygems/test_gem_commands_setup_command.rb +45 -0
- data/test/rubygems/test_gem_commands_sources_command.rb +21 -6
- data/test/rubygems/test_gem_commands_specification_command.rb +33 -1
- data/test/rubygems/test_gem_commands_uninstall_command.rb +91 -31
- data/test/rubygems/test_gem_commands_unpack_command.rb +3 -3
- data/test/rubygems/test_gem_commands_update_command.rb +56 -38
- data/test/rubygems/test_gem_commands_which_command.rb +4 -4
- data/test/rubygems/test_gem_commands_yank_command.rb +97 -0
- data/test/rubygems/test_gem_config_file.rb +66 -21
- data/test/rubygems/test_gem_dependency.rb +46 -0
- data/test/rubygems/test_gem_dependency_installer.rb +228 -18
- data/test/rubygems/test_gem_dependency_list.rb +0 -9
- data/test/rubygems/test_gem_dependency_resolver.rb +327 -0
- data/test/rubygems/test_gem_ext_configure_builder.rb +4 -4
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +21 -49
- data/test/rubygems/test_gem_ext_rake_builder.rb +13 -13
- data/test/rubygems/test_gem_gem_runner.rb +27 -5
- data/test/rubygems/test_gem_gemcutter_utilities.rb +19 -0
- data/test/rubygems/test_gem_indexer.rb +14 -227
- data/test/rubygems/test_gem_install_update_options.rb +83 -3
- data/test/rubygems/test_gem_installer.rb +211 -236
- data/test/rubygems/test_gem_local_remote_options.rb +8 -2
- data/test/rubygems/test_gem_name_tuple.rb +15 -0
- data/test/rubygems/test_gem_package.rb +547 -0
- data/test/rubygems/test_gem_package_old.rb +37 -0
- data/test/rubygems/test_gem_package_tar_reader.rb +32 -0
- data/test/rubygems/test_gem_package_tar_writer.rb +84 -1
- data/test/rubygems/test_gem_path_support.rb +4 -30
- data/test/rubygems/test_gem_platform.rb +3 -6
- data/test/rubygems/test_gem_rdoc.rb +245 -0
- data/test/rubygems/test_gem_remote_fetcher.rb +51 -5
- data/test/rubygems/test_gem_request_set.rb +70 -0
- data/test/rubygems/test_gem_requirement.rb +53 -24
- data/test/rubygems/test_gem_security.rb +189 -43
- data/test/rubygems/test_gem_security_policy.rb +376 -0
- data/test/rubygems/test_gem_security_signer.rb +184 -0
- data/test/rubygems/test_gem_security_trust_dir.rb +94 -0
- data/test/rubygems/test_gem_server.rb +31 -36
- data/test/rubygems/test_gem_silent_ui.rb +2 -2
- data/test/rubygems/test_gem_source.rb +188 -0
- data/test/rubygems/test_gem_source_list.rb +87 -0
- data/test/rubygems/test_gem_source_local.rb +83 -0
- data/test/rubygems/test_gem_source_specific_file.rb +33 -0
- data/test/rubygems/test_gem_spec_fetcher.rb +91 -255
- data/test/rubygems/test_gem_specification.rb +293 -39
- data/test/rubygems/test_gem_uninstaller.rb +136 -13
- data/test/rubygems/test_gem_validator.rb +14 -41
- data/test/rubygems/test_gem_version.rb +15 -21
- data/test/rubygems/test_require.rb +193 -0
- data/test/rubygems/wrong_key_cert.pem +9 -0
- data/test/rubygems/wrong_key_cert_32.pem +9 -0
- metadata +171 -83
- metadata.gz.sig +1 -0
- data/CVE-2013-4287.txt +0 -36
- data/CVE-2013-4363.txt +0 -45
- data/ci_build.sh +0 -27
- data/cruise_config.rb +0 -32
- data/lib/rbconfig/datadir.rb +0 -13
- data/lib/rubygems/builder.rb +0 -99
- data/lib/rubygems/custom_require.rb +0 -69
- data/lib/rubygems/doc_manager.rb +0 -243
- data/lib/rubygems/format.rb +0 -82
- data/lib/rubygems/gem_openssl.rb +0 -90
- data/lib/rubygems/gem_path_searcher.rb +0 -172
- data/lib/rubygems/old_format.rb +0 -153
- data/lib/rubygems/package/f_sync_dir.rb +0 -23
- data/lib/rubygems/package/tar_input.rb +0 -234
- data/lib/rubygems/package/tar_output.rb +0 -146
- data/lib/rubygems/require_paths_builder.rb +0 -18
- data/lib/rubygems/source_index.rb +0 -406
- data/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem +0 -25
- data/lib/rubygems/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +0 -14
- data/lib/rubygems/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/rubygems/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +0 -28
- data/lib/rubygems/ssl_certs/GeoTrustGlobalCA.pem +0 -20
- data/test/rubygems/test_bundled_ca.rb +0 -59
- data/test/rubygems/test_gem_builder.rb +0 -44
- data/test/rubygems/test_gem_doc_manager.rb +0 -32
- data/test/rubygems/test_gem_ext_builder.rb +0 -58
- data/test/rubygems/test_gem_format.rb +0 -88
- data/test/rubygems/test_gem_gem_path_searcher.rb +0 -94
- data/test/rubygems/test_gem_package_tar_input.rb +0 -129
- data/test/rubygems/test_gem_package_tar_output.rb +0 -101
- data/test/rubygems/test_gem_source_index.rb +0 -250
- data/util/update_bundled_ca_certificates.rb +0 -103
@@ -24,18 +24,18 @@ class TestGemExtRakeBuilder < Gem::TestCase
|
|
24
24
|
output = []
|
25
25
|
realdir = nil # HACK /tmp vs. /private/tmp
|
26
26
|
|
27
|
-
build_rake_in do
|
27
|
+
build_rake_in do |rake|
|
28
28
|
Dir.chdir @ext do
|
29
29
|
realdir = Dir.pwd
|
30
30
|
Gem::Ext::RakeBuilder.build 'mkrf_conf.rb', nil, @dest_path, output
|
31
31
|
end
|
32
|
-
end
|
33
32
|
|
34
|
-
|
33
|
+
output = output.join "\n"
|
35
34
|
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
refute_match %r%^rake failed:%, output
|
36
|
+
assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output
|
37
|
+
assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR=#{Regexp.escape @dest_path} RUBYLIBDIR=#{Regexp.escape @dest_path}%, output
|
38
|
+
end
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_class_build_fail
|
@@ -44,22 +44,22 @@ class TestGemExtRakeBuilder < Gem::TestCase
|
|
44
44
|
File.open("Rakefile","w") do |f|
|
45
45
|
f.puts "task :default do abort 'fail' end"
|
46
46
|
end
|
47
|
-
|
47
|
+
EO_MKRF
|
48
48
|
end
|
49
49
|
|
50
50
|
output = []
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
build_rake_in(false) do |rake|
|
53
|
+
error = assert_raises Gem::InstallError do
|
54
54
|
Dir.chdir @ext do
|
55
55
|
Gem::Ext::RakeBuilder.build "mkrf_conf.rb", nil, @dest_path, output
|
56
56
|
end
|
57
57
|
end
|
58
|
-
end
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
|
59
|
+
assert_match %r%^rake failed:%, error.message
|
60
|
+
assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, error.message
|
61
|
+
assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR=#{Regexp.escape @dest_path} RUBYLIBDIR=#{Regexp.escape @dest_path}%, error.message
|
62
|
+
end
|
63
63
|
end
|
64
64
|
|
65
65
|
end
|
@@ -3,6 +3,18 @@ require 'rubygems/gem_runner'
|
|
3
3
|
|
4
4
|
class TestGemGemRunner < Gem::TestCase
|
5
5
|
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
|
9
|
+
@orig_args = Gem::Command.build_args
|
10
|
+
end
|
11
|
+
|
12
|
+
def teardown
|
13
|
+
super
|
14
|
+
|
15
|
+
Gem::Command.build_args = @orig_args
|
16
|
+
end
|
17
|
+
|
6
18
|
def test_do_configuration
|
7
19
|
Gem.clear_paths
|
8
20
|
|
@@ -25,17 +37,27 @@ class TestGemGemRunner < Gem::TestCase
|
|
25
37
|
gr = Gem::GemRunner.new
|
26
38
|
gr.send :do_configuration, %W[--config-file #{temp_conf}]
|
27
39
|
|
28
|
-
assert_equal [
|
40
|
+
assert_equal [other_gem_path, other_gem_home], Gem.path
|
29
41
|
assert_equal %w[--commands], Gem::Command.extra_args
|
30
|
-
assert_equal %w[--all], Gem::DocManager.configured_args
|
31
42
|
end
|
32
43
|
|
33
|
-
def
|
44
|
+
def test_build_args_are_handled
|
34
45
|
Gem.clear_paths
|
35
46
|
|
36
|
-
|
47
|
+
cls = Class.new(Gem::Command) do
|
48
|
+
def execute
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
test_obj = cls.new :ba_test
|
53
|
+
|
54
|
+
cmds = Gem::CommandManager.new
|
55
|
+
cmds.register_command :ba_test, test_obj
|
56
|
+
|
57
|
+
runner = Gem::GemRunner.new :command_manager => cmds
|
58
|
+
runner.run(%W[ba_test -- --build_arg1 --build_arg2])
|
37
59
|
|
38
|
-
assert_equal %w[--build_arg1 --build_arg2],
|
60
|
+
assert_equal %w[--build_arg1 --build_arg2], test_obj.options[:build_args]
|
39
61
|
end
|
40
62
|
|
41
63
|
end
|
@@ -15,6 +15,25 @@ class TestGemGemcutterUtilities < Gem::TestCase
|
|
15
15
|
@cmd.extend Gem::GemcutterUtilities
|
16
16
|
end
|
17
17
|
|
18
|
+
def test_alternate_key_alternate_host
|
19
|
+
keys = {
|
20
|
+
:rubygems_api_key => 'KEY',
|
21
|
+
"http://rubygems.engineyard.com" => "EYKEY"
|
22
|
+
}
|
23
|
+
|
24
|
+
FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
|
25
|
+
|
26
|
+
open Gem.configuration.credentials_path, 'w' do |f|
|
27
|
+
f.write keys.to_yaml
|
28
|
+
end
|
29
|
+
|
30
|
+
ENV["RUBYGEMS_HOST"] = "http://rubygems.engineyard.com"
|
31
|
+
|
32
|
+
Gem.configuration.load_api_keys
|
33
|
+
|
34
|
+
assert_equal 'EYKEY', @cmd.api_key
|
35
|
+
end
|
36
|
+
|
18
37
|
def test_api_key
|
19
38
|
keys = { :rubygems_api_key => 'KEY' }
|
20
39
|
FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path
|
@@ -30,10 +30,7 @@ class TestGemIndexer < Gem::TestCase
|
|
30
30
|
FileUtils.mkdir_p gems
|
31
31
|
FileUtils.mv Dir[File.join(@gemhome, "cache", '*.gem')], gems
|
32
32
|
|
33
|
-
@indexer = Gem::Indexer.new(@tempdir
|
34
|
-
:rss_title => 'ExampleForge gems',
|
35
|
-
:rss_host => 'example.com',
|
36
|
-
:rss_gems_host => 'gems.example.com')
|
33
|
+
@indexer = Gem::Indexer.new(@tempdir)
|
37
34
|
end
|
38
35
|
|
39
36
|
def test_initialize
|
@@ -42,18 +39,10 @@ class TestGemIndexer < Gem::TestCase
|
|
42
39
|
@indexer.directory
|
43
40
|
|
44
41
|
indexer = Gem::Indexer.new @tempdir
|
45
|
-
assert indexer.build_legacy
|
46
42
|
assert indexer.build_modern
|
47
43
|
|
48
|
-
indexer = Gem::Indexer.new @tempdir, :
|
49
|
-
:build_modern => true
|
50
|
-
refute indexer.build_legacy
|
44
|
+
indexer = Gem::Indexer.new @tempdir, :build_modern => true
|
51
45
|
assert indexer.build_modern
|
52
|
-
|
53
|
-
indexer = Gem::Indexer.new @tempdir, :build_legacy => true,
|
54
|
-
:build_modern => false
|
55
|
-
assert indexer.build_legacy
|
56
|
-
refute indexer.build_modern
|
57
46
|
end
|
58
47
|
|
59
48
|
def test_build_indicies
|
@@ -73,7 +62,9 @@ class TestGemIndexer < Gem::TestCase
|
|
73
62
|
["b", Gem::Version.new("2"), "ruby"],
|
74
63
|
["c", Gem::Version.new("1.2"), "ruby"],
|
75
64
|
["d", Gem::Version.new("2.0"), "ruby"],
|
76
|
-
["
|
65
|
+
["dep_x", Gem::Version.new("1"), "ruby"],
|
66
|
+
["pl", Gem::Version.new("1"), "i386-linux"],
|
67
|
+
["x", Gem::Version.new("1"), "ruby"]]
|
77
68
|
|
78
69
|
assert_equal expected, specs
|
79
70
|
|
@@ -87,7 +78,9 @@ class TestGemIndexer < Gem::TestCase
|
|
87
78
|
["b", Gem::Version.new("2"), "ruby"],
|
88
79
|
["c", Gem::Version.new("1.2"), "ruby"],
|
89
80
|
["d", Gem::Version.new("2.0"), "ruby"],
|
90
|
-
["
|
81
|
+
["dep_x", Gem::Version.new("1"), "ruby"],
|
82
|
+
["pl", Gem::Version.new("1"), "i386-linux"],
|
83
|
+
["x", Gem::Version.new("1"), "ruby"]]
|
91
84
|
|
92
85
|
assert_equal expected, latest_specs, 'latest_specs'
|
93
86
|
end
|
@@ -97,9 +90,6 @@ class TestGemIndexer < Gem::TestCase
|
|
97
90
|
@indexer.generate_index
|
98
91
|
end
|
99
92
|
|
100
|
-
assert_indexed @tempdir, "Marshal.#{@marshal_version}"
|
101
|
-
assert_indexed @tempdir, "Marshal.#{@marshal_version}.Z"
|
102
|
-
|
103
93
|
quickdir = File.join @tempdir, 'quick'
|
104
94
|
marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
|
105
95
|
|
@@ -116,210 +106,10 @@ class TestGemIndexer < Gem::TestCase
|
|
116
106
|
|
117
107
|
assert_indexed @tempdir, "latest_specs.#{@marshal_version}"
|
118
108
|
assert_indexed @tempdir, "latest_specs.#{@marshal_version}.gz"
|
119
|
-
|
120
|
-
single_quote = CGI.escapeHTML "'"
|
121
|
-
|
122
|
-
expected = <<-EOF
|
123
|
-
<?xml version=\"1.0\"?>
|
124
|
-
<rss version=\"2.0\">
|
125
|
-
<channel>
|
126
|
-
<title>ExampleForge gems</title>
|
127
|
-
<link>http://example.com</link>
|
128
|
-
<description>Recently released gems from http://example.com</description>
|
129
|
-
<generator>RubyGems v#{Gem::VERSION}</generator>
|
130
|
-
<docs>http://cyber.law.harvard.edu/rss/rss.html</docs>
|
131
|
-
<item>
|
132
|
-
<title>a-2</title>
|
133
|
-
<description>
|
134
|
-
<pre>This is a test description</pre>
|
135
|
-
</description>
|
136
|
-
<author>example@example.com (A User)</author>
|
137
|
-
<guid>a-2</guid>
|
138
|
-
<enclosure url=\"http://gems.example.com/gems/a-2.gem\"
|
139
|
-
length=\"3072\" type=\"application/octet-stream\" />
|
140
|
-
<pubDate>#{@a2.date.rfc2822}</pubDate>
|
141
|
-
<link>http://example.com</link>
|
142
|
-
</item>
|
143
|
-
<item>
|
144
|
-
<title>a-3.a</title>
|
145
|
-
<description>
|
146
|
-
<pre>This is a test description</pre>
|
147
|
-
</description>
|
148
|
-
<author>example@example.com (A User)</author>
|
149
|
-
<guid>a-3.a</guid>
|
150
|
-
<enclosure url=\"http://gems.example.com/gems/a-3.a.gem\"
|
151
|
-
length=\"3072\" type=\"application/octet-stream\" />
|
152
|
-
<pubDate>#{@a3a.date.rfc2822}</pubDate>
|
153
|
-
<link>http://example.com</link>
|
154
|
-
</item>
|
155
|
-
<item>
|
156
|
-
<title>a_evil-9</title>
|
157
|
-
<description>
|
158
|
-
<pre>This is a test description</pre>
|
159
|
-
</description>
|
160
|
-
<author>example@example.com (A User)</author>
|
161
|
-
<guid>a_evil-9</guid>
|
162
|
-
<enclosure url=\"http://gems.example.com/gems/a_evil-9.gem\"
|
163
|
-
length=\"3072\" type=\"application/octet-stream\" />
|
164
|
-
<pubDate>#{@a_evil9.date.rfc2822}</pubDate>
|
165
|
-
<link>http://example.com</link>
|
166
|
-
</item>
|
167
|
-
<item>
|
168
|
-
<title>b-2</title>
|
169
|
-
<description>
|
170
|
-
<pre>This is a test description</pre>
|
171
|
-
</description>
|
172
|
-
<author>example@example.com (A User)</author>
|
173
|
-
<guid>b-2</guid>
|
174
|
-
<enclosure url=\"http://gems.example.com/gems/b-2.gem\"
|
175
|
-
length=\"3072\" type=\"application/octet-stream\" />
|
176
|
-
<pubDate>#{@b2.date.rfc2822}</pubDate>
|
177
|
-
<link>http://example.com</link>
|
178
|
-
</item>
|
179
|
-
<item>
|
180
|
-
<title>c-1.2</title>
|
181
|
-
<description>
|
182
|
-
<pre>This is a test description</pre>
|
183
|
-
</description>
|
184
|
-
<author>example@example.com (A User)</author>
|
185
|
-
<guid>c-1.2</guid>
|
186
|
-
<enclosure url=\"http://gems.example.com/gems/c-1.2.gem\"
|
187
|
-
length=\"3072\" type=\"application/octet-stream\" />
|
188
|
-
<pubDate>#{@c1_2.date.rfc2822}</pubDate>
|
189
|
-
<link>http://example.com</link>
|
190
|
-
</item>
|
191
|
-
<item>
|
192
|
-
<title>d-2.0.a</title>
|
193
|
-
<description>
|
194
|
-
<pre>This is a test description</pre>
|
195
|
-
</description>
|
196
|
-
<author>example@example.com (A User)</author>
|
197
|
-
<guid>d-2.0.a</guid>
|
198
|
-
<enclosure url=\"http://gems.example.com/gems/d-2.0.a.gem\"
|
199
|
-
length=\"3072\" type=\"application/octet-stream\" />
|
200
|
-
<pubDate>#{@d2_0_a.date.rfc2822}</pubDate>
|
201
|
-
<link>http://example.com</link>
|
202
|
-
</item>
|
203
|
-
<item>
|
204
|
-
<title>d-2.0.b</title>
|
205
|
-
<description>
|
206
|
-
<pre>This is a test description</pre>
|
207
|
-
</description>
|
208
|
-
<author>example@example.com (A User)</author>
|
209
|
-
<guid>d-2.0.b</guid>
|
210
|
-
<enclosure url=\"http://gems.example.com/gems/d-2.0.b.gem\"
|
211
|
-
length=\"3072\" type=\"application/octet-stream\" />
|
212
|
-
<pubDate>#{@d2_0_b.date.rfc2822}</pubDate>
|
213
|
-
<link>http://example.com</link>
|
214
|
-
</item>
|
215
|
-
<item>
|
216
|
-
<title>pl-1-x86-linux</title>
|
217
|
-
<description>
|
218
|
-
<pre>This is a test description</pre>
|
219
|
-
</description>
|
220
|
-
<author>example@example.com (A User)</author>
|
221
|
-
<guid>pl-1-x86-linux</guid>
|
222
|
-
<enclosure url=\"http://gems.example.com/gems/pl-1-x86-linux.gem\"
|
223
|
-
length=\"3072\" type=\"application/octet-stream\" />
|
224
|
-
<pubDate>#{@pl1.date.rfc2822}</pubDate>
|
225
|
-
<link>http://example.com</link>
|
226
|
-
</item>
|
227
|
-
<item>
|
228
|
-
<title>a-1</title>
|
229
|
-
<description>
|
230
|
-
<pre>This line is really, really long. So long, in fact, that it is more than
|
231
|
-
eighty characters long! The purpose of this line is for testing wrapping
|
232
|
-
behavior because sometimes people don#{single_quote}t wrap their text to eighty characters.
|
233
|
-
Without the wrapping, the text might not look good in the RSS feed.
|
234
|
-
|
235
|
-
Also, a list:
|
236
|
-
* An entry that#{single_quote}s actually kind of sort
|
237
|
-
* an entry that#{single_quote}s really long, which will probably get wrapped funny.
|
238
|
-
That#{single_quote}s ok, somebody wasn#{single_quote}t thinking straight when they made it more than
|
239
|
-
eighty characters.</pre>
|
240
|
-
</description>
|
241
|
-
<author>example@example.com (Example), example2@example.com (Example2)</author>
|
242
|
-
<guid>a-1</guid>
|
243
|
-
<enclosure url=\"http://gems.example.com/gems/a-1.gem\"
|
244
|
-
length=\"3584\" type=\"application/octet-stream\" />
|
245
|
-
<pubDate>#{@a1.date.rfc2822}</pubDate>
|
246
|
-
<link>http://a.example.com</link>
|
247
|
-
</item>
|
248
|
-
</channel>
|
249
|
-
</rss>
|
250
|
-
EOF
|
251
|
-
|
252
|
-
gems_rss = File.read File.join(@tempdir, 'index.rss')
|
253
|
-
|
254
|
-
assert_equal expected, gems_rss
|
255
|
-
end
|
256
|
-
|
257
|
-
def test_generate_index_legacy
|
258
|
-
@indexer.build_modern = false
|
259
|
-
@indexer.build_legacy = true
|
260
|
-
|
261
|
-
use_ui @ui do
|
262
|
-
@indexer.generate_index
|
263
|
-
end
|
264
|
-
|
265
|
-
assert_indexed @tempdir, "Marshal.#{@marshal_version}"
|
266
|
-
assert_indexed @tempdir, "Marshal.#{@marshal_version}.Z"
|
267
|
-
|
268
|
-
quickdir = File.join @tempdir, 'quick'
|
269
|
-
marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
|
270
|
-
|
271
|
-
assert File.directory?(quickdir)
|
272
|
-
assert File.directory?(marshal_quickdir)
|
273
|
-
|
274
|
-
assert_indexed marshal_quickdir, "#{File.basename(@a1.spec_file)}.rz"
|
275
|
-
assert_indexed marshal_quickdir, "#{File.basename(@a2.spec_file)}.rz"
|
276
|
-
|
277
|
-
refute_indexed marshal_quickdir, "#{File.basename(@c1_2.spec_file)}"
|
278
|
-
|
279
|
-
refute_indexed @tempdir, "specs.#{@marshal_version}"
|
280
|
-
refute_indexed @tempdir, "specs.#{@marshal_version}.gz"
|
281
|
-
|
282
|
-
refute_indexed @tempdir, "latest_specs.#{@marshal_version}"
|
283
|
-
refute_indexed @tempdir, "latest_specs.#{@marshal_version}.gz"
|
284
|
-
end
|
285
|
-
|
286
|
-
def test_generate_index_legacy_back_to_back
|
287
|
-
@indexer.build_modern = true
|
288
|
-
@indexer.build_legacy = true
|
289
|
-
|
290
|
-
use_ui @ui do
|
291
|
-
@indexer.generate_index
|
292
|
-
end
|
293
|
-
|
294
|
-
@indexer = Gem::Indexer.new @tempdir
|
295
|
-
@indexer.build_modern = false
|
296
|
-
@indexer.build_legacy = true
|
297
|
-
|
298
|
-
use_ui @ui do
|
299
|
-
@indexer.generate_index
|
300
|
-
end
|
301
|
-
|
302
|
-
assert_indexed @tempdir, "Marshal.#{@marshal_version}"
|
303
|
-
assert_indexed @tempdir, "Marshal.#{@marshal_version}.Z"
|
304
|
-
|
305
|
-
quickdir = File.join @tempdir, 'quick'
|
306
|
-
marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
|
307
|
-
|
308
|
-
assert File.directory?(marshal_quickdir)
|
309
|
-
|
310
|
-
assert_indexed marshal_quickdir, "#{File.basename(@a1.spec_file)}.rz"
|
311
|
-
assert_indexed marshal_quickdir, "#{File.basename(@a2.spec_file)}.rz"
|
312
|
-
|
313
|
-
assert_indexed @tempdir, "specs.#{@marshal_version}"
|
314
|
-
assert_indexed @tempdir, "specs.#{@marshal_version}.gz"
|
315
|
-
|
316
|
-
assert_indexed @tempdir, "latest_specs.#{@marshal_version}"
|
317
|
-
assert_indexed @tempdir, "latest_specs.#{@marshal_version}.gz"
|
318
109
|
end
|
319
110
|
|
320
111
|
def test_generate_index_modern
|
321
112
|
@indexer.build_modern = true
|
322
|
-
@indexer.build_legacy = false
|
323
113
|
|
324
114
|
use_ui @ui do
|
325
115
|
@indexer.generate_index
|
@@ -365,7 +155,6 @@ eighty characters.</pre>
|
|
365
155
|
|
366
156
|
def test_generate_index_modern_back_to_back
|
367
157
|
@indexer.build_modern = true
|
368
|
-
@indexer.build_legacy = true
|
369
158
|
|
370
159
|
use_ui @ui do
|
371
160
|
@indexer.generate_index
|
@@ -373,15 +162,10 @@ eighty characters.</pre>
|
|
373
162
|
|
374
163
|
@indexer = Gem::Indexer.new @tempdir
|
375
164
|
@indexer.build_modern = true
|
376
|
-
@indexer.build_legacy = false
|
377
165
|
|
378
166
|
use_ui @ui do
|
379
167
|
@indexer.generate_index
|
380
168
|
end
|
381
|
-
|
382
|
-
assert_indexed @tempdir, "Marshal.#{@marshal_version}"
|
383
|
-
assert_indexed @tempdir, "Marshal.#{@marshal_version}.Z"
|
384
|
-
|
385
169
|
quickdir = File.join @tempdir, 'quick'
|
386
170
|
marshal_quickdir = File.join quickdir, "Marshal.#{@marshal_version}"
|
387
171
|
|
@@ -403,14 +187,13 @@ eighty characters.</pre>
|
|
403
187
|
@indexer.generate_index
|
404
188
|
end
|
405
189
|
|
406
|
-
assert_match %r
|
407
|
-
assert_match %r%^Generating Marshal quick index gemspecs for
|
190
|
+
assert_match %r%^\.\.\.\.\.\.\.\.\.\.\.\.$%, @ui.output
|
191
|
+
assert_match %r%^Generating Marshal quick index gemspecs for 12 gems$%,
|
408
192
|
@ui.output
|
409
193
|
assert_match %r%^Complete$%, @ui.output
|
410
194
|
assert_match %r%^Generating specs index$%, @ui.output
|
411
195
|
assert_match %r%^Generating latest specs index$%, @ui.output
|
412
196
|
assert_match %r%^Generating prerelease specs index$%, @ui.output
|
413
|
-
assert_match %r%^Generating Marshal master index$%, @ui.output
|
414
197
|
assert_match %r%^Complete$%, @ui.output
|
415
198
|
assert_match %r%^Compressing indicies$%, @ui.output
|
416
199
|
|
@@ -434,7 +217,9 @@ eighty characters.</pre>
|
|
434
217
|
['b', Gem::Version.new(2), 'ruby'],
|
435
218
|
['c', Gem::Version.new('1.2'), 'ruby'],
|
436
219
|
['d', Gem::Version.new('2.0'), 'ruby'],
|
220
|
+
['dep_x', Gem::Version.new(1), 'ruby'],
|
437
221
|
['pl', Gem::Version.new(1), 'i386-linux'],
|
222
|
+
['x', Gem::Version.new(1), 'ruby'],
|
438
223
|
]
|
439
224
|
|
440
225
|
assert_equal expected, specs
|
@@ -468,7 +253,9 @@ eighty characters.</pre>
|
|
468
253
|
['b', Gem::Version.new(2), 'ruby'],
|
469
254
|
['c', Gem::Version.new('1.2'), 'ruby'],
|
470
255
|
['d', Gem::Version.new('2.0'), 'ruby'],
|
256
|
+
['dep_x', Gem::Version.new(1), 'ruby'],
|
471
257
|
['pl', Gem::Version.new(1), 'i386-linux'],
|
258
|
+
['x', Gem::Version.new(1), 'ruby'],
|
472
259
|
]
|
473
260
|
|
474
261
|
assert_equal expected, latest_specs
|