Method: Pathname#append_lines
- Defined in:
- lib/pleasant_path/pathname.rb
#append_lines(lines, eol: $/) ⇒ self
Appends each object in lines
as a string plus eol
(end-of-line) characters to the file indicated by the Pathname. Creates the file if it does not exist, including any necessary parent directories. Returns the Pathname.
1008 1009 1010 1011 |
# File 'lib/pleasant_path/pathname.rb', line 1008 def append_lines(lines, eol: $/) self.make_dirname.open("a"){|f| f.write_lines(lines, eol: eol) } self end |