Sha256: b6dc111a4b416b36ac5c2ab7cc355e546034c27a6ac4a3ab6d23cb68cb39defc
Contents?: true
Size: 843 Bytes
Versions: 3
Compression:
Stored size: 843 Bytes
Contents
module MinceMigrator require_relative 'config' require_relative 'migration' class List attr_reader :status def initialize(status=:any) @status = status end def all @all ||= all_for_status end def number_of_migrations all.size end def filelist @filelist ||= Dir.glob(filelist_pattern) end def filelist_pattern File.join(Config.migration_dir, '*') end private def all_for_status filtered_by_status(all_for_any_status).sort_by(&:time_created) end def all_for_any_status filelist.map{|a| Migration.load_from_file(a) } end def filtered_by_status(migrations) migrations.select { |m| matches_status?(m) } end def matches_status?(migration) status == :any || migration.status == status end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mince_migrator-1.0.2 | lib/mince_migrator/list.rb |
mince_migrator-1.0.1 | lib/mince_migrator/list.rb |
mince_migrator-1.0.0 | lib/mince_migrator/list.rb |