Class: Textus::Domain::Staleness::GeneratorCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/domain/staleness/generator_check.rb

Overview

Reports staleness for generator-zone entries — derived files whose generator’s listed sources have been modified more recently than the entry’s ‘_meta.generated.at` timestamp. Returns an Array of row hashes (possibly empty) per entry.

Instance Method Summary collapse

Constructor Details

#initialize(manifest:, file_stat:) ⇒ GeneratorCheck

Returns a new instance of GeneratorCheck.



11
12
13
14
# File 'lib/textus/domain/staleness/generator_check.rb', line 11

def initialize(manifest:, file_stat:)
  @manifest  = manifest
  @file_stat = file_stat
end

Instance Method Details

#rows_for(mentry) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/textus/domain/staleness/generator_check.rb', line 16

def rows_for(mentry)
  return [] unless applicable?(mentry)

  path = Textus::Key::Path.resolve(@manifest.data, mentry)
  reason = stale_reason(mentry, path)
  reason ? [stale_row(mentry, path, reason)] : []
end