Method: Pathname#edit_text
- Defined in:
- lib/pleasant_path/pathname.rb
#edit_text {|text| ... } ⇒ self
Reads the file indicated by the Pathname, and yields the entire contents as a String to the given block for editing. Writes the return value of the block back to the file, overwriting previous contents. Returns the Pathname.
1059 1060 1061 1062 |
# File 'lib/pleasant_path/pathname.rb', line 1059 def edit_text(&block) File.edit_text(self, &block) self end |