Method: Staticky::Files#inject_line_before

Defined in:
lib/staticky/files.rb

#inject_line_before(path, target, contents) ⇒ Object

Inject contents in path before target.

Parameters:

  • path (String, Pathname)

    the path to file

  • target (String, Regexp)

    the target to replace

  • contents (String)

    the contents to inject

Raises:

See Also:

Since:

  • 0.1.0



384
385
386
# File 'lib/staticky/files.rb', line 384

def inject_line_before(path, target, contents)
  _inject_line_before(path, target, contents, method(:index))
end