lib/tori/backend/filesystem.rb in tori-0.6.3 vs lib/tori/backend/filesystem.rb in tori-0.6.4
- old
+ new
@@ -33,19 +33,23 @@
def exist?(filename)
::File.exist? path(filename)
end
alias exists? exist?
- def read(filename)
- ::File.read(path(filename), mode: 'rb')
+ def read(filename, **args)
+ ::File.read(path(filename), { mode: 'rb' }.merge(args))
end
def open(filename, *rest, &block)
::File.open(path(filename), *rest, &block)
end
def path(filename)
@root.join filename.to_s
+ end
+
+ def otherwise(backend)
+ Chain.new(self, backend)
end
end
end
end