Class: ModifyFile
- Inherits:
-
EdrGenBase
- Object
- EdrGenBase
- ModifyFile
- Defined in:
- lib/edr_gen/modify_file.rb
Constant Summary collapse
- ACTIVITY =
"file_changes"
Constants included from YamlLogger
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args) ⇒ ModifyFile
constructor
A new instance of ModifyFile.
Methods included from YamlLogger
Constructor Details
#initialize(args) ⇒ ModifyFile
Returns a new instance of ModifyFile.
6 7 8 9 10 11 12 13 14 |
# File 'lib/edr_gen/modify_file.rb', line 6 def initialize(args) @filepath = args[0] @content = args[1..-1].join(" ") command = ["echo #{new_content} >> #{filepath}"] validate_args super(command) end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 |
# File 'lib/edr_gen/modify_file.rb', line 16 def call puts " Attempting to modify file..." execute_process puts " File modified: #{filepath}" end |