mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Import rubygems 1.5.0 (release candidate)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d26fb035ca
commit
e798ccbacf
173 changed files with 2721 additions and 2455 deletions
|
@ -1,4 +1,9 @@
|
|||
require 'fileutils'
|
||||
######################################################################
|
||||
# This file is imported from the rubygems project.
|
||||
# DO NOT make modifications in this repo. They _will_ be reverted!
|
||||
# File a patch instead and assign it to Ryan Davis or Eric Hodel.
|
||||
######################################################################
|
||||
|
||||
require 'rubygems/command'
|
||||
require 'rubygems/remote_fetcher'
|
||||
require 'rubygems/source_info_cache'
|
||||
|
@ -10,6 +15,8 @@ class Gem::Commands::SourcesCommand < Gem::Command
|
|||
include Gem::LocalRemoteOptions
|
||||
|
||||
def initialize
|
||||
require 'fileutils'
|
||||
|
||||
super 'sources',
|
||||
'Manage the sources and cache file RubyGems uses to search for gems'
|
||||
|
||||
|
@ -79,23 +86,7 @@ class Gem::Commands::SourcesCommand < Gem::Command
|
|||
rescue URI::Error, ArgumentError
|
||||
say "#{source_uri} is not a URI"
|
||||
rescue Gem::RemoteFetcher::FetchError => e
|
||||
yaml_uri = uri + 'yaml'
|
||||
gem_repo = Gem::RemoteFetcher.fetcher.fetch_size yaml_uri rescue false
|
||||
|
||||
if e.uri =~ /specs\.#{Regexp.escape Gem.marshal_version}\.gz$/ and
|
||||
gem_repo then
|
||||
|
||||
alert_warning <<-EOF
|
||||
RubyGems 1.2+ index not found for:
|
||||
\t#{source_uri}
|
||||
|
||||
Will cause RubyGems to revert to legacy indexes, degrading performance.
|
||||
EOF
|
||||
|
||||
say "#{source_uri} added to sources"
|
||||
else
|
||||
say "Error fetching #{source_uri}:\n\t#{e.message}"
|
||||
end
|
||||
say "Error fetching #{source_uri}:\n\t#{e.message}"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -115,15 +106,10 @@ Will cause RubyGems to revert to legacy indexes, degrading performance.
|
|||
if options[:update] then
|
||||
fetcher = Gem::SpecFetcher.fetcher
|
||||
|
||||
if fetcher.legacy_repos.empty? then
|
||||
Gem.sources.each do |update_uri|
|
||||
update_uri = URI.parse update_uri
|
||||
fetcher.load_specs update_uri, 'specs'
|
||||
fetcher.load_specs update_uri, 'latest_specs'
|
||||
end
|
||||
else
|
||||
Gem::SourceInfoCache.cache true
|
||||
Gem::SourceInfoCache.cache.flush
|
||||
Gem.sources.each do |update_uri|
|
||||
update_uri = URI.parse update_uri
|
||||
fetcher.load_specs update_uri, 'specs'
|
||||
fetcher.load_specs update_uri, 'latest_specs'
|
||||
end
|
||||
|
||||
say "source cache successfully updated"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue