lib/eco/api/common/session/file_manager.rb in eco-helpers-2.0.55 vs lib/eco/api/common/session/file_manager.rb in eco-helpers-2.0.56
- old
+ new
@@ -36,17 +36,17 @@
def newest(filename)
dir.newest_file(file: filename)
end
- def file_content(filename)
+ def file_content(filename, mode: nil)
file = dir.file(filename, should_exist: true)
if !file
logger.error("Can't read from file '#{filename}' because it does not exist.")
return nil
end
logger.debug("Reading from file '#{file}'")
- File.read(file)
+ mode ? File.read(file, mode: mode) : File.read(file)
end
def load_json(filename)
content = file_content(filename)
begin