Class: Checkson::Check::Shell
- Defined in:
- lib/checkson/checks/shell.rb,
lib/checkson/checks/packages.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(opts = {}) ⇒ Shell
constructor
A new instance of Shell.
Methods inherited from Base
Constructor Details
#initialize(opts = {}) ⇒ Shell
Returns a new instance of Shell.
6 7 8 9 |
# File 'lib/checkson/checks/shell.rb', line 6 def initialize(opts = {}) @opts = (@opts || {}).merge(opts) super() end |
Instance Method Details
#check ⇒ Object
11 12 13 14 15 16 |
# File 'lib/checkson/checks/shell.rb', line 11 def check raise ArgumentError, 'No code given' unless @opts[:code] execute(@opts[:code]) failed! unless $?.exitstatus.zero? end |