Class: Gpr::Commands::List
Constant Summary
Constants included from Gpr
Instance Method Summary collapse
-
#initialize(thor) ⇒ List
constructor
A new instance of List.
Methods inherited from Base
Constructor Details
#initialize(thor) ⇒ List
Returns a new instance of List.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/gpr/commands/list.rb', line 8 def initialize(thor) thor.class_eval do desc 'list', 'Show all registered repositories' option :paths, type: :boolean, desc: 'Show the paths of all registered repositories' def list repositories = repository_list if [:paths] repositories.each do |repository| puts repository end else repositories.each do |repository| repo_info = parse_repository(repository) puts "#{repo_info[:host].color(:yellow)} - #{repo_info[:repository].color(:blue)}" end end end end end |