Module: FlightConfig::Indexable::ClassMethods

Includes:
Reader::ClassMethods
Defined in:
lib/flight_config/indexable.rb

Instance Method Summary collapse

Methods included from Reader::ClassMethods

#new!, #read, #read_or_new

Methods included from Core::ClassMethods

#_path, #allow_missing_read, #data_core

Instance Method Details

#create_or_update(*a) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/flight_config/indexable.rb', line 51

def create_or_update(*a)
  new!(*a, read_mode: true) do |index|
    Core.log(index, "Generating index")
    FileUtils.mkdir_p File.dirname(index.path)
    FileUtils.touch index.path
  end
end

#glob_read(*a) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/flight_config/indexable.rb', line 43

def glob_read(*a)
  super.reject do |index|
    next if index.valid?
    FileUtils.rm_f path
    true
  end
end