Skip to content

Commit

Permalink
Merge pull request #4 from gusano/topic/fix_colors
Browse files Browse the repository at this point in the history
Topic/fix colors
  • Loading branch information
till committed Oct 25, 2015
2 parents 25600ee + f18a740 commit 1f41c9a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/apt/spy2.rb
Expand Up @@ -18,7 +18,7 @@ class AptSpy2 < Thor
def fix
working = filter(retrieve(options[:country], use_launchpad?(options)), false)
print "The closest mirror is: "
puts "#{working[0]}".white_on_green
puts "#{working[0]}".bold.magenta
if !options[:commit]
puts "Run with --commit to adjust /etc/apt/sources.list".yellow
else
Expand Down Expand Up @@ -94,10 +94,10 @@ def filter(mirrors, output = true)
mirrors.each do |mirror|
data = {"mirror" => mirror }
begin
mirror_status = open(mirror)
open(mirror)
data["status"] = "up"
working_mirrors << mirror
rescue OpenURI::HTTPError => the_error
rescue OpenURI::HTTPError
data["status"] = "broken"
rescue Errno::ECONNREFUSED
data["status"] = "down"
Expand Down Expand Up @@ -135,7 +135,7 @@ def update(mirror)
end

puts "Updated '#{apt_sources}' with #{mirror}".green
puts "Run `apt-get update` to update".red_on_yellow
puts "Run `apt-get update` to update".black_on_yellow
end

private
Expand All @@ -150,4 +150,4 @@ def use_launchpad?(options)

return true
end
end
end

0 comments on commit 1f41c9a

Please sign in to comment.