Sha256: 18128428ac55a13e506efd5374f2f57c7508a49ff0d2984989fc3ed04ab732ed
Contents?: true
Size: 1.37 KB
Versions: 310
Compression:
Stored size: 1.37 KB
Contents
require 'rbbt/association/database' module Association def self.version_file(file, namespace) old_file, file = file, file.sub('NAMESPACE', namespace) if namespace and String === file old_file.annotate file if Path === old_file file end def self.open(file, options = nil, persist_options = nil) options = options.nil? ? {} : options.dup persist_options = persist_options.nil? ? Misc.pull_keys(options, :persist) : persist_options.dup options = Misc.add_defaults options, :zipped => true, :merge => true, :monitor => {:desc => "Opening database #{Misc.fingerprint file}"} options[:zipped] = false unless options[:merge] persist_options = Misc.add_defaults persist_options.dup, :persist => true, :dir => Rbbt.var.associations persist = persist_options[:persist] file = version_file(file, options[:namespace]) if options[:namespace] and String === file data = Persist.persist_tsv(file, nil, options, persist_options.merge(:prefix => "Association Database")) do |data| file = file.call if Proc === file options = options.dup data.serializer = :double if data.respond_to? :serializer tsv = Association.database(file, options.merge(:persist => true, :unnamed => true, :data => data, :type => :double)) data end data.entity_options = options[:entity_options] if options[:entity_options] data end end
Version data entries
310 entries across 310 versions & 1 rubygems