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