Class: Guac::Commands::Status
- Inherits:
-
Object
- Object
- Guac::Commands::Status
- Defined in:
- lib/guac/commands/status.rb
Instance Method Summary collapse
- #execute(_input: $stdin, output: $stdout) ⇒ Object
-
#initialize(options) ⇒ Status
constructor
A new instance of Status.
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 = @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 |