lib/rbbt/persist.rb in rbbt-util-5.21.0 vs lib/rbbt/persist.rb in rbbt-util-5.21.1

- old
+ new

@@ -337,11 +337,13 @@ def self.persist(name, type = nil, persist_options = {}, &block) type ||= :marshal persist_options ||= {} - return (persist_options[:repo] || Persist::MEMORY)[persist_options[:file]] ||= yield if type ==:memory and persist_options[:file] and persist_options[:persist] and persist_options[:persist] != :update + if type ==:memory and persist_options[:file] and persist_options[:persist] and persist_options[:persist] != :update and not persist_options[:update] + return (persist_options[:repo] || Persist::MEMORY)[persist_options[:file]] ||= yield + end if FalseClass === persist_options[:persist] yield else persist_options[:update] ||= true if persist_options[:persist].to_s == "update" @@ -356,10 +358,11 @@ end case when type.to_sym == :memory repo = persist_options[:repo] || Persist::MEMORY - repo[path.find] ||= yield + path = path.find if Path === path + repo[path] = yield when (type.to_sym == :annotations and persist_options.include? :annotation_repo) repo = persist_options[:annotation_repo]