Class: Kafo::SystemChecker
- Inherits:
-
Object
- Object
- Kafo::SystemChecker
- Defined in:
- lib/kafo/system_checker.rb
Instance Attribute Summary collapse
-
#checkers ⇒ Object
readonly
Returns the value of attribute checkers.
Class Method Summary collapse
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(path) ⇒ SystemChecker
constructor
A new instance of SystemChecker.
- #logger ⇒ Object
Constructor Details
#initialize(path) ⇒ SystemChecker
Returns a new instance of SystemChecker.
13 14 15 |
# File 'lib/kafo/system_checker.rb', line 13 def initialize(path) @checkers = Dir.glob(path).sort end |
Instance Attribute Details
#checkers ⇒ Object (readonly)
Returns the value of attribute checkers.
5 6 7 |
# File 'lib/kafo/system_checker.rb', line 5 def checkers @checkers end |
Class Method Details
.check ⇒ Object
7 8 9 10 11 |
# File 'lib/kafo/system_checker.rb', line 7 def self.check KafoConfigure.check_dirs.all? do |dir| new(File.join(dir, '*')).check end end |
Instance Method Details
#check ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/kafo/system_checker.rb', line 21 def check @checkers.map! do |checker| logger.debug "Executing checker: #{checker}" stdout = `#{checker}` logger.error stdout unless stdout.empty? $?.exitstatus == 0 end @checkers.all? end |
#logger ⇒ Object
17 18 19 |
# File 'lib/kafo/system_checker.rb', line 17 def logger Logging::logger['checks'] end |