Class: AptSpy2
- Inherits:
-
Thor
- Object
- Thor
- AptSpy2
- Defined in:
- lib/apt/spy2.rb
Instance Method Summary collapse
Instance Method Details
#check ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/apt/spy2.rb', line 35 def check @writer = Apt::Spy2::Writer.new([:format]) mirrors = retrieve([:country], use_launchpad?()) filter(mirrors, [:output]) puts @writer.to_json if @writer.json? end |
#fix ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/apt/spy2.rb', line 18 def fix working = filter(retrieve([:country], use_launchpad?()), false) print "The closest mirror is: " puts "#{working[0]}".bold.magenta if ![:commit] puts "Run with --commit to adjust /etc/apt/sources.list".yellow else puts "Updating /etc/apt/sources.list".yellow update(working[0]) end end |