Method: Hanami::Utils::Files.unshift
- Defined in:
- lib/hanami/utils/files.rb
.unshift(path, line) ⇒ Object
Adds a new line at the top of the file
130 131 132 133 134 135 |
# File 'lib/hanami/utils/files.rb', line 130 def self.unshift(path, line) content = ::File.readlines(path) content.unshift("#{line}\n") write(path, content) end |