Class: ServerStatus::Commands::List
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- ServerStatus::Commands::List
- Defined in:
- lib/server-status/commands/list.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
Instance Method Summary collapse
Methods inherited from BaseCommand
Constructor Details
This class inherits a constructor from ServerStatus::Commands::BaseCommand
Instance Method Details
#perform ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/server-status/commands/list.rb', line 4 def perform if settings['hosts'].any? longest_name = settings['hosts'].map { |n, h| n.size }.max settings['hosts'].each do |name, host| puts "#{name.ljust(longest_name)} #{host}" end end end |