Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/mark_facets/ruby/file.rb

Class Method Summary collapse

Class Method Details

.update(file_path) {|file| ... } ⇒ Object

Yields:

  • (file)


5
6
7
8
9
# File 'lib/mark_facets/ruby/file.rb', line 5

def update(file_path)
  file = File.read(file_path)
  yield file
  File.open(file_path, 'w') {|f| f.write(file)}
end