Skip to content

Commit

Permalink
Cleaned output
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/gauntlet/dev/": change = 4665]
  • Loading branch information
zenspider committed Mar 2, 2009
1 parent 6f89a8b commit 9451897
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bin/gauntlet
Expand Up @@ -20,9 +20,9 @@ when "help" then
puts " list - list known gauntlet data for reports"
puts " report <name> - show a report on <name>, requires specific data format"
puts " <name> - run the gauntlet for named plugin"
Gem.find_files('gauntlet_*.rb').each do |path|
Gem.find_files('gauntlet_*.rb').each do |path|
name = File.basename(path, ".rb").sub(/gauntlet_/, '')
puts " #{name} - a known plugin"
puts " %-13s - a known plugin" % name
end
when "update" then
require 'gauntlet'
Expand Down
12 changes: 7 additions & 5 deletions lib/gauntlet.rb
Expand Up @@ -52,13 +52,15 @@ def initialize_dir
def source_index
@index ||= in_gem_dir do
dump = if ($u and not $F) or not File.exist? '.source_index' then
warn "fetching and caching gem index"
url = GEMURL + "Marshal.#{Gem.marshal_version}.Z"
dump = Gem::RemoteFetcher.fetcher.fetch_path url
require 'zlib'
require 'zlib' # HACK for rubygems :(
dump = Gem.inflate dump
open '.source_index', 'wb' do |io| io.write dump end
dump
else
warn "using cached gem index"
open '.source_index', 'rb' do |io| io.read end
end

Expand Down Expand Up @@ -116,15 +118,15 @@ def update_gem_tarballs

latest = self.latest_gems

puts "updating mirror"
warn "updating mirror"

in_gem_dir do
gems = Dir["*.gem"]
tgzs = Dir["*.tgz"]

old = tgzs - latest.map { |spec| "#{spec.full_name}.tgz" }
unless old.empty? then
puts "deleting #{old.size} tgzs"
warn "deleting #{old.size} tgzs"
old.each do |tgz|
File.unlink tgz
end
Expand All @@ -135,7 +137,7 @@ def update_gem_tarballs
latest.reject! { |spec| tgzs.include? "#{spec.full_name}.tgz" }
tasks.push(latest.shift) until latest.empty? # LAME

puts "fetching #{tasks.size} gems"
warn "fetching #{tasks.size} gems"

threads = []
10.times do
Expand All @@ -149,7 +151,7 @@ def update_gem_tarballs

unless gems.include? gem_name then
begin
warn "downloading #{full_name}"
warn "downloading #{full_name}"
fetcher.download(spec, GEMURL, Dir.pwd)
rescue Gem::RemoteFetcher::FetchError => e
warn " failed #{full_name}: #{e.message}"
Expand Down

0 comments on commit 9451897

Please sign in to comment.