Sha256: 7b811c52cd55d4dbbb04bc47163322736451e3fbfeed9ef39169c4d905efe96c
Contents?: true
Size: 702 Bytes
Versions: 2
Compression:
Stored size: 702 Bytes
Contents
require 'pathname' require 'yaml' module CouchMigrate class FilePersistedList < BasePersistedList def initialize(meta_file_directory="db/migrate") super() path = Pathname.new(meta_file_directory) path.mkpath @path = path+"meta.yml" read self end protected def read @data = YAML.load(File.read(@path)) rescue {} @data[:complete] ||= [] @list = @data[:complete] end def write @data[:complete] = @list File.open(@path,"w"){|f| f<< YAML.dump(@data) } end def cleanup File.delete(@path.to_s) rescue nil # @path.delete rescue nil # fakefs does not handle this correctly end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
couch-migrate-2.0.2 | lib/couch_migrate/file_persisted_list.rb |
couch-migrate-1.1.3 | lib/couch_migrate/file_persisted_list.rb |