Class: PrLog::Injector
- Inherits:
-
Struct
- Object
- Struct
- PrLog::Injector
- Defined in:
- lib/pr_log/injector.rb
Overview
Injects text into a file
Instance Attribute Summary collapse
-
#destination_file ⇒ Object
Returns the value of attribute destination_file.
Instance Method Summary collapse
Instance Attribute Details
#destination_file ⇒ Object
Returns the value of attribute destination_file
3 4 5 |
# File 'lib/pr_log/injector.rb', line 3 def destination_file @destination_file end |
Instance Method Details
#insert_after(line, text) ⇒ Object
4 5 6 7 8 |
# File 'lib/pr_log/injector.rb', line 4 def insert_after(line, text) unless replace!(/#{line}/, '\0' + text) fail(InsertPointNotFound, "Insert point not found in #{destination_file}.") end end |