Skip to content

Commit

Permalink
Update to RubyGems 1.1.1 r1701.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
drbrain committed Apr 11, 2008
1 parent 0ae6c7f commit e72b71d
Show file tree
Hide file tree
Showing 31 changed files with 272 additions and 888 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Sat Apr 12 05:55:57 2008 Eric Hodel <[email protected]>

* lib/rubygems*, test/rubygems*: Update to RubyGems 1.1.1 r1701.

Sat Apr 12 03:13:38 2008 Nobuyoshi Nakada <[email protected]>

* file.c (file_expand_path): set external encoding.
Expand Down
34 changes: 29 additions & 5 deletions lib/rubygems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module Gem

@configuration = nil
@loaded_specs = {}
@platforms = nil
@platforms = []
@ruby = nil
@sources = []

Expand Down Expand Up @@ -215,7 +215,7 @@ def self.binary_mode

def self.bindir(install_dir=Gem.dir)
return File.join(install_dir, 'bin') unless
install_dir.to_s == Gem.default_dir
install_dir.to_s == Gem.default_dir
Gem.default_bindir
end

Expand Down Expand Up @@ -451,10 +451,21 @@ def self.path
end

##
# Array of platforms this RubyGems supports.
# Set array of platforms this RubyGems supports (primarily for testing).

def self.platforms=(platforms)
@platforms = platforms
end

##
# Array of platforms this RubyGems supports.

def self.platforms
@platforms ||= [Gem::Platform::RUBY, Gem::Platform.local]
@platforms ||= []
if @platforms.empty?
@platforms = [Gem::Platform::RUBY, Gem::Platform.local]
end
@platforms
end

##
Expand All @@ -463,13 +474,26 @@ def self.platforms
def self.prefix
prefix = File.dirname File.expand_path(__FILE__)

if prefix == File.expand_path(ConfigMap[:sitelibdir]) then
if File.dirname(prefix) == File.expand_path(ConfigMap[:sitelibdir]) or
File.dirname(prefix) == File.expand_path(ConfigMap[:libdir]) or
'lib' != File.basename(prefix) then
nil
else
File.dirname prefix
end
end

##
# Refresh source_index from disk and clear searcher.

def self.refresh
source_index.refresh!

MUTEX.synchronize do
@searcher = nil
end
end

##
# Safely read a file in binary mode on all platforms.

Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/command_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def process_args(args)
say Gem::Command::HELP
terminate_interaction(0)
when '-v', '--version'
say Gem::RubyGemsPackageVersion
say Gem::RubyGemsVersion
terminate_interaction(0)
when /^-/
alert_error "Invalid option: #{args[0]}. See 'gem --help'."
Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/commands/environment_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def execute
when nil then
out = "RubyGems Environment:\n"

out << " - RUBYGEMS VERSION: #{Gem::RubyGemsVersion} (#{Gem::RubyGemsPackageVersion})\n"
out << " - RUBYGEMS VERSION: #{Gem::RubyGemsVersion}\n"

out << " - RUBY VERSION: #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}"
out << " patchlevel #{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
Expand Down
1 change: 1 addition & 0 deletions lib/rubygems/commands/pristine_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def execute
end

installer.generate_bin
installer.build_extensions
end
end

Expand Down
6 changes: 4 additions & 2 deletions lib/rubygems/commands/query_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ def execute
say "*** REMOTE GEMS ***"
say

all = options[:all]

begin
Gem::SourceInfoCache.cache.refresh options[:all]
Gem::SourceInfoCache.cache all
rescue Gem::RemoteFetcher::FetchError
# no network
end

output_query_results Gem::SourceInfoCache.search(name, false, true)
output_query_results Gem::SourceInfoCache.search(name, false, all)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/commands/sources_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def execute
end

if options[:update] then
Gem::SourceInfoCache.cache.refresh true
Gem::SourceInfoCache.cache true
Gem::SourceInfoCache.cache.flush

say "source cache successfully updated"
Expand Down
11 changes: 7 additions & 4 deletions lib/rubygems/commands/update_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def execute
say "Updating installed gems"
end

hig = {}
hig = {} # highest installed gems

Gem::SourceIndex.from_installed_gems.each do |name, spec|
if hig[spec.name].nil? or hig[spec.name].version < spec.version then
Expand All @@ -67,7 +67,7 @@ def execute
end

pattern = if options[:args].empty? then
//
//
else
Regexp.union(*options[:args])
end
Expand All @@ -78,12 +78,14 @@ def execute

updated = []

# HACK use the real API
installer = Gem::DependencyInstaller.new options

gems_to_update.uniq.sort.each do |name|
next if updated.any? { |spec| spec.name == name }

say "Updating #{name}"
installer = Gem::DependencyInstaller.new options
installer.install name

installer.installed_gems.each do |spec|
updated << spec
say "Successfully installed #{spec.full_name}"
Expand Down Expand Up @@ -115,6 +117,7 @@ def do_rubygems_update(version)
args.push '--prefix', Gem.prefix unless Gem.prefix.nil?
args << '--no-rdoc' unless options[:generate_rdoc]
args << '--no-ri' unless options[:generate_ri]
args << '--no-format-executable' if options[:no_format_executable]

update_dir = File.join Gem.dir, 'gems', "rubygems-update-#{version}"

Expand Down
10 changes: 8 additions & 2 deletions lib/rubygems/dependency_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def find_gems_with_sources(dep)
end

all = requirements.length > 1 ||
requirements.first != ">=" || requirements.first != ">"
(requirements.first != ">=" and requirements.first != ">")

found = Gem::SourceInfoCache.search_with_source dep, true, all

Expand Down Expand Up @@ -189,7 +189,13 @@ def install dep_or_name, version = Gem::Requirement.default
say "Installing gem #{spec.full_name}" if Gem.configuration.really_verbose

_, source_uri = @specs_and_sources.assoc spec
local_gem_path = Gem::RemoteFetcher.fetcher.download spec, source_uri
begin
local_gem_path = Gem::RemoteFetcher.fetcher.download spec, source_uri,
@install_dir
rescue Gem::RemoteFetcher::FetchError
next if @force
raise
end

inst = Gem::Installer.new local_gem_path,
:env_shebang => @env_shebang,
Expand Down
6 changes: 6 additions & 0 deletions lib/rubygems/doc_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ def load_rdoc

FileUtils.mkdir_p @doc_dir unless File.exist?(@doc_dir)

begin
gem 'rdoc'
rescue Gem::LoadError
# use built-in RDoc
end

begin
require 'rdoc/rdoc'
rescue LoadError => e
Expand Down
7 changes: 0 additions & 7 deletions lib/rubygems/gem_open_uri.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/rubygems/indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def build_index
progress.updated spec.original_name

rescue SignalException => e
alert_error "Recieved signal, exiting"
alert_error "Received signal, exiting"
raise
rescue Exception => e
alert_error "Unable to process #{gemfile}\n#{e.message} (#{e.class})\n\t#{e.backtrace.join "\n\t"}"
Expand Down
Loading

0 comments on commit e72b71d

Please sign in to comment.