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
@@ -71,14 +71,9 @@ class Gem::Commands::DependencyCommand < Gem::Command
|
|
71
71
|
if remote? and not options[:reverse_dependencies] then
|
72
72
|
fetcher = Gem::SpecFetcher.fetcher
|
73
73
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
dependency.prerelease?)
|
78
|
-
|
79
|
-
specs.concat specs_and_sources.map { |spec_tuple, source_uri|
|
80
|
-
fetcher.fetch_spec spec_tuple, URI.parse(source_uri)
|
81
|
-
}
|
74
|
+
ss, _ = fetcher.spec_for_dependency dependency
|
75
|
+
|
76
|
+
ss.each { |s,o| specs << s }
|
82
77
|
end
|
83
78
|
|
84
79
|
if specs.empty? then
|
@@ -24,33 +24,38 @@ class Gem::Commands::EnvironmentCommand < Gem::Command
|
|
24
24
|
The RubyGems environment can be controlled through command line arguments,
|
25
25
|
gemrc files, environment variables and built-in defaults.
|
26
26
|
|
27
|
-
Command line argument defaults and some RubyGems defaults can be set in
|
28
|
-
~/.gemrc file for individual users and a /etc/gemrc for all users.
|
29
|
-
|
27
|
+
Command line argument defaults and some RubyGems defaults can be set in a
|
28
|
+
~/.gemrc file for individual users and a /etc/gemrc for all users. These
|
29
|
+
files are YAML files with the following YAML keys:
|
30
30
|
|
31
31
|
:sources: A YAML array of remote gem repositories to install gems from
|
32
|
-
:verbose: Verbosity of the gem command.
|
32
|
+
:verbose: Verbosity of the gem command. false, true, and :really are the
|
33
33
|
levels
|
34
34
|
:update_sources: Enable/disable automatic updating of repository metadata
|
35
35
|
:backtrace: Print backtrace when RubyGems encounters an error
|
36
36
|
:gempath: The paths in which to look for gems
|
37
|
-
|
37
|
+
:disable_default_gem_server: Force specification of gem server host on push
|
38
|
+
<gem_command>: A string containing arguments for the specified gem command
|
38
39
|
|
39
40
|
Example:
|
40
41
|
|
41
42
|
:verbose: false
|
42
43
|
install: --no-wrappers
|
43
44
|
update: --no-wrappers
|
45
|
+
:disable_default_gem_server: true
|
44
46
|
|
45
47
|
RubyGems' default local repository can be overridden with the GEM_PATH and
|
46
|
-
GEM_HOME environment variables.
|
47
|
-
install into.
|
48
|
+
GEM_HOME environment variables. GEM_HOME sets the default repository to
|
49
|
+
install into. GEM_PATH allows multiple local repositories to be searched for
|
48
50
|
gems.
|
49
51
|
|
50
52
|
If you are behind a proxy server, RubyGems uses the HTTP_PROXY,
|
51
53
|
HTTP_PROXY_USER and HTTP_PROXY_PASS environment variables to discover the
|
52
54
|
proxy server.
|
53
55
|
|
56
|
+
If you would like to push gems to a private gem server the RUBYGEMS_HOST
|
57
|
+
environment variable can be set to the URI for that server.
|
58
|
+
|
54
59
|
If you are packaging RubyGems all of RubyGems' defaults are in
|
55
60
|
lib/rubygems/defaults.rb. You may override these in
|
56
61
|
lib/rubygems/defaults/operating_system.rb
|
@@ -74,7 +79,7 @@ lib/rubygems/defaults/operating_system.rb
|
|
74
79
|
when /^gempath/, /^path/, /^GEM_PATH/ then
|
75
80
|
out << Gem.path.join(File::PATH_SEPARATOR)
|
76
81
|
when /^remotesources/ then
|
77
|
-
out << Gem.sources.join("\n")
|
82
|
+
out << Gem.sources.to_a.join("\n")
|
78
83
|
when /^platform/ then
|
79
84
|
out << Gem.platforms.join(File::PATH_SEPARATOR)
|
80
85
|
when nil then
|
@@ -34,7 +34,6 @@ class Gem::Commands::FetchCommand < Gem::Command
|
|
34
34
|
|
35
35
|
def execute
|
36
36
|
version = options[:version] || Gem::Requirement.default
|
37
|
-
all = Gem::Requirement.default != version
|
38
37
|
|
39
38
|
platform = Gem.platforms.last
|
40
39
|
gem_names = get_all_gem_names
|
@@ -43,32 +42,20 @@ class Gem::Commands::FetchCommand < Gem::Command
|
|
43
42
|
dep = Gem::Dependency.new gem_name, version
|
44
43
|
dep.prerelease = options[:prerelease]
|
45
44
|
|
46
|
-
specs_and_sources, errors =
|
47
|
-
Gem::SpecFetcher.fetcher.fetch_with_errors(dep, all, true,
|
48
|
-
dep.prerelease?)
|
49
|
-
|
45
|
+
specs_and_sources, errors = Gem::SpecFetcher.fetcher.spec_for_dependency dep
|
50
46
|
if platform then
|
51
47
|
filtered = specs_and_sources.select { |s,| s.platform == platform }
|
52
48
|
specs_and_sources = filtered unless filtered.empty?
|
53
49
|
end
|
54
50
|
|
55
|
-
spec,
|
51
|
+
spec, source = specs_and_sources.sort_by { |s,| s.version }.first
|
56
52
|
|
57
53
|
if spec.nil? then
|
58
54
|
show_lookup_failure gem_name, version, errors, options[:domain]
|
59
55
|
next
|
60
56
|
end
|
61
57
|
|
62
|
-
|
63
|
-
remote_path = URI.parse(source_uri) + "gems/#{file}"
|
64
|
-
|
65
|
-
fetch = Gem::RemoteFetcher.fetcher
|
66
|
-
|
67
|
-
gem = fetch.fetch_path remote_path.to_s
|
68
|
-
|
69
|
-
File.open file, "wb" do |f|
|
70
|
-
f.write gem
|
71
|
-
end
|
58
|
+
source.download spec
|
72
59
|
|
73
60
|
say "Downloaded #{spec.full_name}"
|
74
61
|
end
|
@@ -11,29 +11,16 @@ class Gem::Commands::GenerateIndexCommand < Gem::Command
|
|
11
11
|
def initialize
|
12
12
|
super 'generate_index',
|
13
13
|
'Generates the index files for a gem server directory',
|
14
|
-
:directory => '.', :
|
14
|
+
:directory => '.', :build_modern => true
|
15
15
|
|
16
16
|
add_option '-d', '--directory=DIRNAME',
|
17
17
|
'repository base dir containing gems subdir' do |dir, options|
|
18
18
|
options[:directory] = File.expand_path dir
|
19
19
|
end
|
20
20
|
|
21
|
-
add_option '--[no-]legacy',
|
22
|
-
'Generate Marshal.4.8' do |value, options|
|
23
|
-
unless options[:build_modern] or value then
|
24
|
-
raise OptionParser::InvalidOption, 'no indicies will be built'
|
25
|
-
end
|
26
|
-
|
27
|
-
options[:build_legacy] = value
|
28
|
-
end
|
29
|
-
|
30
21
|
add_option '--[no-]modern',
|
31
|
-
'Generate indexes for RubyGems
|
32
|
-
'
|
33
|
-
unless options[:build_legacy] or value then
|
34
|
-
raise OptionParser::InvalidOption, 'no indicies will be built'
|
35
|
-
end
|
36
|
-
|
22
|
+
'Generate indexes for RubyGems',
|
23
|
+
'(always true)' do |value, options|
|
37
24
|
options[:build_modern] = value
|
38
25
|
end
|
39
26
|
|
@@ -42,27 +29,10 @@ class Gem::Commands::GenerateIndexCommand < Gem::Command
|
|
42
29
|
'since the last update' do |value, options|
|
43
30
|
options[:update] = value
|
44
31
|
end
|
45
|
-
|
46
|
-
add_option :RSS, '--rss-gems-host=GEM_HOST',
|
47
|
-
'Host name where gems are served from,',
|
48
|
-
'used for GUID and enclosure values' do |value, options|
|
49
|
-
options[:rss_gems_host] = value
|
50
|
-
end
|
51
|
-
|
52
|
-
add_option :RSS, '--rss-host=HOST',
|
53
|
-
'Host name for more gems information,',
|
54
|
-
'used for RSS feed link' do |value, options|
|
55
|
-
options[:rss_host] = value
|
56
|
-
end
|
57
|
-
|
58
|
-
add_option :RSS, '--rss-title=TITLE',
|
59
|
-
'Set title for RSS feed' do |value, options|
|
60
|
-
options[:rss_title] = value
|
61
|
-
end
|
62
32
|
end
|
63
33
|
|
64
34
|
def defaults_str # :nodoc:
|
65
|
-
"--directory . --
|
35
|
+
"--directory . --modern"
|
66
36
|
end
|
67
37
|
|
68
38
|
def description # :nodoc:
|
@@ -85,25 +55,15 @@ When done, it will generate a set of files like this:
|
|
85
55
|
prerelease_specs.<version>.gz # prerelease specs index
|
86
56
|
quick/Marshal.<version>/<gemname>.gemspec.rz # Marshal quick index file
|
87
57
|
|
88
|
-
|
89
|
-
Marshal.<version>
|
90
|
-
Marshal.<version>.Z # Marshal full index
|
91
|
-
|
92
|
-
The .Z and .rz extension files are compressed with the inflate algorithm.
|
58
|
+
The .rz extension files are compressed with the inflate algorithm.
|
93
59
|
The Marshal version number comes from ruby's Marshal::MAJOR_VERSION and
|
94
60
|
Marshal::MINOR_VERSION constants. It is used to ensure compatibility.
|
95
|
-
|
96
|
-
If --rss-host and --rss-gem-host are given an RSS feed will be generated at
|
97
|
-
index.rss containing gems released in the last two days.
|
98
61
|
EOF
|
99
62
|
end
|
100
63
|
|
101
64
|
def execute
|
102
|
-
|
103
|
-
|
104
|
-
alert_error '--update not compatible with RSS generation'
|
105
|
-
terminate_interaction 1
|
106
|
-
end
|
65
|
+
# This is always true becasue it's the only way now.
|
66
|
+
options[:build_modern] = true
|
107
67
|
|
108
68
|
if not File.exist?(options[:directory]) or
|
109
69
|
not File.directory?(options[:directory]) then
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require 'rubygems/command'
|
2
|
-
require 'rubygems/doc_manager'
|
3
2
|
require 'rubygems/install_update_options'
|
4
3
|
require 'rubygems/dependency_installer'
|
5
4
|
require 'rubygems/local_remote_options'
|
6
5
|
require 'rubygems/validator'
|
7
6
|
require 'rubygems/version_option'
|
7
|
+
require 'rubygems/install_message' # must come before rdoc for messaging
|
8
|
+
require 'rubygems/rdoc'
|
8
9
|
|
9
10
|
##
|
10
11
|
# Gem installer command line tool
|
@@ -13,14 +14,14 @@ require 'rubygems/version_option'
|
|
13
14
|
|
14
15
|
class Gem::Commands::InstallCommand < Gem::Command
|
15
16
|
|
17
|
+
attr_reader :installed_specs # :nodoc:
|
18
|
+
|
16
19
|
include Gem::VersionOption
|
17
20
|
include Gem::LocalRemoteOptions
|
18
21
|
include Gem::InstallUpdateOptions
|
19
22
|
|
20
23
|
def initialize
|
21
24
|
defaults = Gem::DependencyInstaller::DEFAULT_OPTIONS.merge({
|
22
|
-
:generate_rdoc => true,
|
23
|
-
:generate_ri => true,
|
24
25
|
:format_executable => false,
|
25
26
|
:version => Gem::Requirement.default,
|
26
27
|
})
|
@@ -32,6 +33,14 @@ class Gem::Commands::InstallCommand < Gem::Command
|
|
32
33
|
add_platform_option
|
33
34
|
add_version_option
|
34
35
|
add_prerelease_option "to be installed. (Only for listed gems)"
|
36
|
+
|
37
|
+
add_option(:"Install/Update", '-g', '--file FILE',
|
38
|
+
'Read from a gem dependencies API file and',
|
39
|
+
'install the listed gems') do |v,o|
|
40
|
+
o[:gemdeps] = v
|
41
|
+
end
|
42
|
+
|
43
|
+
@installed_specs = nil
|
35
44
|
end
|
36
45
|
|
37
46
|
def arguments # :nodoc:
|
@@ -39,7 +48,7 @@ class Gem::Commands::InstallCommand < Gem::Command
|
|
39
48
|
end
|
40
49
|
|
41
50
|
def defaults_str # :nodoc:
|
42
|
-
"--both --version '#{Gem::Requirement.default}' --
|
51
|
+
"--both --version '#{Gem::Requirement.default}' --document --no-force\n" \
|
43
52
|
"--install-dir #{Gem.dir}"
|
44
53
|
end
|
45
54
|
|
@@ -100,31 +109,73 @@ to write the specification by hand. For example:
|
|
100
109
|
"#{program_name} GEMNAME [GEMNAME ...] [options] -- --build-flags"
|
101
110
|
end
|
102
111
|
|
112
|
+
def install_from_gemdeps(gf)
|
113
|
+
require 'rubygems/request_set'
|
114
|
+
rs = Gem::RequestSet.new
|
115
|
+
rs.load_gemdeps gf
|
116
|
+
|
117
|
+
rs.resolve
|
118
|
+
|
119
|
+
specs = rs.install options do |req, inst|
|
120
|
+
s = req.full_spec
|
121
|
+
|
122
|
+
if inst
|
123
|
+
say "Installing #{s.name} (#{s.version})"
|
124
|
+
else
|
125
|
+
say "Using #{s.name} (#{s.version})"
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
@installed_specs = specs
|
130
|
+
|
131
|
+
raise Gem::SystemExitException, 0
|
132
|
+
end
|
133
|
+
|
103
134
|
def execute
|
104
|
-
if options[:
|
105
|
-
|
106
|
-
|
135
|
+
if gf = options[:gemdeps] then
|
136
|
+
install_from_gemdeps gf
|
137
|
+
return
|
107
138
|
end
|
108
139
|
|
109
|
-
|
140
|
+
@installed_specs = []
|
110
141
|
|
111
142
|
ENV.delete 'GEM_PATH' if options[:install_dir].nil? and RUBY_VERSION > '1.9'
|
112
143
|
|
144
|
+
if options[:install_dir] and options[:user_install]
|
145
|
+
alert_error "Use --install-dir or --user-install but not both"
|
146
|
+
terminate_interaction 1
|
147
|
+
end
|
148
|
+
|
113
149
|
exit_code = 0
|
114
150
|
|
115
|
-
|
151
|
+
if options[:version] != Gem::Requirement.default &&
|
152
|
+
get_all_gem_names.size > 1 then
|
153
|
+
alert_error "Can't use --version w/ multiple gems. Use name:ver instead."
|
154
|
+
terminate_interaction 1
|
155
|
+
end
|
156
|
+
|
157
|
+
|
158
|
+
get_all_gem_names_and_versions.each do |gem_name, gem_version|
|
159
|
+
gem_version ||= options[:version]
|
160
|
+
|
116
161
|
begin
|
117
162
|
next if options[:conservative] and
|
118
|
-
not Gem::Dependency.new(gem_name,
|
163
|
+
not Gem::Dependency.new(gem_name, gem_version).matching_specs.empty?
|
119
164
|
|
120
165
|
inst = Gem::DependencyInstaller.new options
|
121
|
-
inst.install gem_name,
|
166
|
+
inst.install gem_name, Gem::Requirement.create(gem_version)
|
122
167
|
|
123
|
-
inst.installed_gems
|
124
|
-
say "Successfully installed #{spec.full_name}"
|
125
|
-
end
|
168
|
+
@installed_specs.push(*inst.installed_gems)
|
126
169
|
|
127
|
-
|
170
|
+
next unless errs = inst.errors
|
171
|
+
|
172
|
+
errs.each do |x|
|
173
|
+
next unless Gem::SourceFetchProblem === x
|
174
|
+
|
175
|
+
msg = "Unable to pull data from '#{x.source.uri}': #{x.error.message}"
|
176
|
+
|
177
|
+
alert_warning msg
|
178
|
+
end
|
128
179
|
rescue Gem::InstallError => e
|
129
180
|
alert_error "Error installing #{gem_name}:\n\t#{e.message}"
|
130
181
|
exit_code |= 1
|
@@ -135,27 +186,9 @@ to write the specification by hand. For example:
|
|
135
186
|
end
|
136
187
|
end
|
137
188
|
|
138
|
-
unless
|
139
|
-
gems =
|
140
|
-
say "#{
|
141
|
-
|
142
|
-
# NOTE: *All* of the RI documents must be generated first. For some
|
143
|
-
# reason, RI docs cannot be generated after any RDoc documents are
|
144
|
-
# generated.
|
145
|
-
|
146
|
-
if options[:generate_ri] then
|
147
|
-
installed_gems.each do |gem|
|
148
|
-
Gem::DocManager.new(gem, options[:rdoc_args]).generate_ri
|
149
|
-
end
|
150
|
-
|
151
|
-
Gem::DocManager.update_ri_cache
|
152
|
-
end
|
153
|
-
|
154
|
-
if options[:generate_rdoc] then
|
155
|
-
installed_gems.each do |gem|
|
156
|
-
Gem::DocManager.new(gem, options[:rdoc_args]).generate_rdoc
|
157
|
-
end
|
158
|
-
end
|
189
|
+
unless @installed_specs.empty? then
|
190
|
+
gems = @installed_specs.length == 1 ? 'gem' : 'gems'
|
191
|
+
say "#{@installed_specs.length} #{gems} installed"
|
159
192
|
end
|
160
193
|
|
161
194
|
raise Gem::SystemExitException, exit_code
|
@@ -7,8 +7,9 @@ require 'rubygems/commands/query_command'
|
|
7
7
|
|
8
8
|
class Gem::Commands::ListCommand < Gem::Commands::QueryCommand
|
9
9
|
|
10
|
-
def initialize
|
11
|
-
|
10
|
+
def initialize(name = 'list',
|
11
|
+
summary = 'Display gems whose name starts with STRING')
|
12
|
+
super name, summary
|
12
13
|
|
13
14
|
remove_option('--name-matches')
|
14
15
|
end
|
@@ -26,8 +27,9 @@ class Gem::Commands::ListCommand < Gem::Commands::QueryCommand
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def execute
|
29
|
-
|
30
|
-
options[:name] = /^#{
|
30
|
+
name = get_one_optional_argument || ''
|
31
|
+
options[:name] = /^#{name}/i
|
32
|
+
|
31
33
|
super
|
32
34
|
end
|
33
35
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rubygems/command'
|
2
|
+
|
3
|
+
class Gem::Commands::MirrorCommand < Gem::Command
|
4
|
+
def initialize
|
5
|
+
super('mirror', 'Mirror all gem files (requires rubygems-mirror)')
|
6
|
+
begin
|
7
|
+
Gem::Specification.find_by_name('rubygems-mirror').activate
|
8
|
+
rescue Gem::LoadError
|
9
|
+
# no-op
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def execute
|
14
|
+
alert_error "Install the rubygems-mirror gem for the mirror command"
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -19,12 +19,15 @@ class Gem::Commands::OutdatedCommand < Gem::Command
|
|
19
19
|
Gem::Specification.outdated.sort.each do |name|
|
20
20
|
local = Gem::Specification.find_all_by_name(name).max
|
21
21
|
dep = Gem::Dependency.new local.name, ">= #{local.version}"
|
22
|
-
remotes = Gem::SpecFetcher.fetcher.
|
22
|
+
remotes, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dep
|
23
23
|
|
24
24
|
next if remotes.empty?
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
remotes.sort! { |a,b| a[0].version <=> b[0].version }
|
27
|
+
|
28
|
+
highest = remotes.last.first
|
29
|
+
|
30
|
+
say "#{local.name} (#{local.version} < #{highest.version})"
|
28
31
|
end
|
29
32
|
end
|
30
33
|
end
|