Class: Pechkin::Command::Check

Inherits:
Base
  • Object
show all
Defined in:
lib/pechkin/command/check.rb

Overview

Check configuration consistency and exit.

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#configuration, #handler, #initialize, #puts, #warn

Constructor Details

This class inherits a constructor from Pechkin::Command::Base

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/pechkin/command/check.rb', line 11

def execute
  cfg = configuration # load configuration from disk

  # If list option is also provided, print the channels
  return unless options.list?

  puts "Working dir: #{cfg.working_dir}"
  print_bots(cfg.bots)
  print_channels(cfg.channels)
end

#matches?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/pechkin/command/check.rb', line 7

def matches?
  options.check?
end