Class: AptSpy2
- Inherits:
-
Thor
- Object
- Thor
- AptSpy2
- Defined in:
- lib/apt/spy2.rb
Overview
apt-spy2 command interface
Instance Method Summary collapse
Instance Method Details
#check ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/apt/spy2.rb', line 41 def check @writer = Apt::Spy2::Writer.new([:format]) mirrors = retrieve([:country], use_launchpad?()) filter(mirrors, [:strict], [:output]) puts @writer.to_json if @writer.json? end |
#fix ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/apt/spy2.rb', line 23 def fix mirrors = retrieve([:country], use_launchpad?()) working = filter(mirrors, [:strict], false) print 'The closest mirror is: ' puts (working[0]).to_s.bold.magenta unless [:commit] puts 'Run with --commit to adjust /etc/apt/sources.list'.yellow return end puts 'Updating /etc/apt/sources.list'.yellow update(working[0]) end |