Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
git-svn-id: http://rubygems.rubyforge.org/svn/trunk@1688 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information
drbrain committed Apr 3, 2008
1 parent 5461a73 commit dcb636c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 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

0 comments on commit dcb636c

Please sign in to comment.