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