Class: Serverkit::Resources::Line
- Defined in:
- lib/serverkit/resources/line.rb
Overview
Ensure a particular line is in a file, or replace an existing line using regexp.
Defined Under Namespace
Classes: Content
Constant Summary collapse
- DEFAULT_STATE =
"present"
Instance Attribute Summary
Attributes inherited from Base
#attributes, #backend, #check_result, #recheck_result, #recipe
Instance Method Summary collapse
Methods inherited from Base
abstract_class?, #all_errors, attribute, #handlers, #id, #initialize, #notifiable?, #run_apply, #run_check, #successful?, #successful_on_check?, #successful_on_recheck?, #to_a
Constructor Details
This class inherits a constructor from Serverkit::Resources::Base
Instance Method Details
#apply ⇒ Object
Note:
Override
21 22 23 24 25 26 27 28 |
# File 'lib/serverkit/resources/line.rb', line 21 def apply if has_correct_file? update_remote_file_content( content: applied_remote_file_content, path: path, ) end end |
#check ⇒ Object
Note:
Override
31 32 33 |
# File 'lib/serverkit/resources/line.rb', line 31 def check has_correct_file? && has_correct_line? end |