Class: PrLog::Injector

Inherits:
Object
  • Object
show all
Defined in:
lib/pr_log/injector.rb

Overview

Injects text into a file

Instance Method Summary collapse

Instance Method Details

#insert_after(line, text) ⇒ Object



6
7
8
9
10
11
# File 'lib/pr_log/injector.rb', line 6

def insert_after(line, text)
  unless replace!(/#{line}/, '\0' + text)
    raise(InsertPointNotFound,
          "Insert point not found in #{destination_file}.")
  end
end