lib/helper.rb in narou-3.4.8 vs lib/helper.rb in narou-3.5.0
- old
+ new
@@ -462,11 +462,11 @@
def load(path, options = DEFAULT_OPTIONS)
@@mutex.synchronize do
fullpath = File.expand_path(path)
cache_data = @@caches[fullpath]
if Helper.file_latest?(fullpath) || !cache_data
- body = File.read(fullpath, options)
+ body = File.read(fullpath, **options)
@@caches[fullpath] = body
return body
else
return cache_data
end
@@ -491,10 +491,10 @@
fail ArgumentError, "need a block" unless block
fullpath = File.expand_path(path)
key = generate_key(fullpath, block)
cache = @@result_caches[key]
if Helper.file_latest?(fullpath) || !cache
- data = File.read(fullpath, options)
+ data = File.read(fullpath, **options)
@@result_caches[key] = result = block.call(data)
return result
else
return cache
end