Class: Perus::Pinger::Value
- Defined in:
- lib/perus/pinger/metrics/value.rb
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
Methods inherited from Command
abstract!, abstract?, #cleanup, #darwin?, description, human_name, inherited, #initialize, metric!, metric?, option, options, #shell, subclasses
Constructor Details
This class inherits a constructor from Perus::Pinger::Command
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 |
# File 'lib/perus/pinger/metrics/value.rb', line 12 def run grep = .grep.gsub('"', '\\"') line = shell(%Q[cat #{.path} | egrep "#{grep}"]) value = line.match(Regexp.compile(.grep))[1] {.name => value} end |