Class: Guac::Commands::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/guac/commands/status.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Status

Returns a new instance of Status.



7
8
9
10
# File 'lib/guac/commands/status.rb', line 7

def initialize(options)
  @options = options
  @repos = Guac::Repo.build_from_config
end

Instance Method Details

#execute(_input: $stdin, output: $stdout) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/guac/commands/status.rb', line 12

def execute(_input: $stdin, output: $stdout)
  threads = @repos.map do |repo|
    Thread.new do
      response = [repo.status]
      response = Colors.paint(response)
      response.unshift(repo.name.bold.colorize(:blue))

      response.join("\n")
    end
  end

  output.puts threads.map(&:value)
end