lib/ruote/storage/fs_storage.rb in ruote-2.1.10 vs lib/ruote/storage/fs_storage.rb in ruote-2.1.11
- old
+ new
@@ -33,11 +33,13 @@
Rufus::Json.detect_backend
require 'rufus/cloche'
# gem install rufus-cloche
+require 'ruote/storage/base'
+
module Ruote
#
# A basic FS-bound ruote storage. Leverages rufus-cloche
# (http://github.com/jmettraux/rufus-cloche).
@@ -82,17 +84,25 @@
@cloche.delete(doc)
end
def get_many (type, key=nil, opts={})
+ if key
+ key = Array(key)
+ key = key.map { |k| "!#{k}" } if key.first.is_a?(String)
+ end
+ # assuming /!#{wfid}$/...
+
@cloche.get_many(type, key, opts)
end
def ids (type)
@cloche.ids(type)
end
+ # Purges the storage completely.
+ #
def purge!
FileUtils.rm_rf(@cloche.dir)
end