Method: Pathname#write_text
- Defined in:
- lib/pleasant_path/pathname.rb
#write_text(text) ⇒ self
Writes text 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.
945 946 947 948 |
# File 'lib/pleasant_path/pathname.rb', line 945 def write_text(text) self.make_dirname.open("w"){|f| f.write(text) } self end |