lib/rbbt/persist/tsv/sharder.rb in rbbt-util-5.13.37 vs lib/rbbt/persist/tsv/sharder.rb in rbbt-util-5.14.0

- old
+ new

@@ -203,11 +203,13 @@ def []=(key, value, clean = false) database(key).send(:[]=, key, value) end def [](key, clean=false) - v = database(key).send(:[], key) + database = database(key) + return nil if database.nil? + v = database.send(:[], key) end def <<(p) return if p.nil? self[p.first] = p.last @@ -238,12 +240,18 @@ FileUtils.mkdir_p File.dirname(path) unless File.exists?(File.dirname(path)) database = Persist::SharderAdapter.open(path, write, type, options, &shard_function) - unless serializer == :clean #or type.to_s == 'fwt' + if type.to_s == 'pki' TSV.setup database - database.serializer = serializer if serializer + database.type = :list + database.serializer = :clean + else + if serializer != :clean + TSV.setup database + database.serializer = serializer if serializer + end end database end end