Method: Enumerable#append_to_file
- Defined in:
- lib/pleasant_path/enumerable.rb
#append_to_file(file, eol: $/) ⇒ self
Appends each object in the Enumerable as a string plus eol
(end-of-line) characters to the specified file
. Creates the file if it does not exist, including any necessary parent directories. Returns the Enumerable.
38 39 40 41 |
# File 'lib/pleasant_path/enumerable.rb', line 38 def append_to_file(file, eol: $/) file.to_pathname.append_lines(self, eol: eol) self end |