Class: ServerStatus::Commands::Run
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- ServerStatus::Commands::Run
- Defined in:
- lib/server-status/commands/run.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
Instance Method Summary collapse
-
#initialize(config, options) ⇒ Run
constructor
A new instance of Run.
- #perform ⇒ Object
Methods inherited from BaseCommand
Constructor Details
#initialize(config, options) ⇒ Run
Returns a new instance of Run.
4 5 6 7 8 |
# File 'lib/server-status/commands/run.rb', line 4 def initialize(config, ) super(config) @options = end |
Instance Method Details
#perform ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/server-status/commands/run.rb', line 10 def perform unless settings['hosts'] puts "No hosts tracked. To add hosts: server-status add <host> [name]" exit(1) end host_set = ServerStatus::HostSet.new(config, @options, settings['hosts']) host_set.fetch_statuses report = ServerStatus::Report.new(config, @options, host_set) puts report.generate_table end |