Method: Hanami::Utils::Files.append
- Defined in:
- lib/hanami/utils/files.rb
permalink .append(path, contents) ⇒ Object
Adds a new line at the bottom of the file
146 147 148 149 150 151 152 153 154 |
# File 'lib/hanami/utils/files.rb', line 146 def self.append(path, contents) mkdir_p(path) content = ::File.readlines(path) content << "\n" if _append_newline?(content) content << "#{contents}\n" write(path, content) end |