Sha256: 9fabe877a1489f969673e6fa895acf4f12803aa578ec6eb89ce293ca4a6370fc
Contents?: true
Size: 516 Bytes
Versions: 17
Compression:
Stored size: 516 Bytes
Contents
require 'fileutils' module Evva class FileReader def open_file(file_name, method, should_exist) unless File.file?(File.expand_path(file_name)) if should_exist Logger.error("File #{file_name} not found!") return nil else FileUtils.mkdir_p(File.dirname(file_name)) end end File.open(File.expand_path(file_name), method) end def write_to_file(file, data) file.write(data) file.flush file.close end end end
Version data entries
17 entries across 17 versions & 1 rubygems