Method: Staticky::Files#append
- Defined in:
- lib/staticky/files.rb
#append(path, contents) ⇒ Object
Adds a new line at the bottom of the file
317 318 319 320 321 322 323 324 325 326 |
# File 'lib/staticky/files.rb', line 317 def append(path, contents) mkdir_p(path) touch(path) content = adapter.readlines(path) content << newline unless newline?(content.last) content << newline(contents) write(path, content) end |