Class: Perus::Pinger::Replace
- Defined in:
- lib/perus/pinger/commands/replace.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
11 12 13 14 15 16 |
# File 'lib/perus/pinger/commands/replace.rb', line 11 def run text = IO.read(.path) text.gsub!(/#{.grep}/, .replacement) IO.write(.path, text) true end |