From 88d558c417fc72305560daa4f0e9148fe20aa968 Mon Sep 17 00:00:00 2001 From: Yvan Volochine Date: Thu, 7 Nov 2013 13:39:33 +0100 Subject: [PATCH 1/2] spy2: fix colors Use more ocntrasted colors so it's readable with light themes Signed-off-by: Yvan Volochine --- lib/apt/spy2.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/apt/spy2.rb b/lib/apt/spy2.rb index 0981c46..775feb2 100755 --- a/lib/apt/spy2.rb +++ b/lib/apt/spy2.rb @@ -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 @@ -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 From f18a740be6d91df3a39ee00b5b3c27643677952a Mon Sep 17 00:00:00 2001 From: Yvan Volochine Date: Thu, 7 Nov 2013 13:43:21 +0100 Subject: [PATCH 2/2] spy2: remove unused variables Signed-off-by: Yvan Volochine --- lib/apt/spy2.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/apt/spy2.rb b/lib/apt/spy2.rb index 775feb2..25a4d8d 100755 --- a/lib/apt/spy2.rb +++ b/lib/apt/spy2.rb @@ -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" @@ -150,4 +150,4 @@ def use_launchpad?(options) return true end -end +end \ No newline at end of file