def update_file(file)
      log "file: #{file}"
      text = File.read(file)
      text = yield text
      File.open(file, 'w') { |f| f.write(text) }
    end
def update_file(file)
      log "file: #{file}"
      text = File.read(file)
      text = yield text
      File.open(file, 'w') { |f| f.write(text) }
    end
Allow editing file text in a block
 Example: update_file('some.txt'){|text| text.gsub(/bla/,'ble')}