Class: Textus::Domain::Staleness

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

Defined Under Namespace

Classes: GeneratorCheck

Instance Method Summary collapse

Constructor Details

#initialize(manifest:, file_stat:, clock: nil) ⇒ Staleness

ADR 0079: intake (age-based) staleness moved to the unified lifecycle path (Domain::Lifecycle / freshness); only generator/build drift —dependency-based, surfaced by the doctor ‘generator_drift` check —remains here.



8
9
10
11
# File 'lib/textus/domain/staleness.rb', line 8

def initialize(manifest:, file_stat:, clock: nil) # rubocop:disable Lint/UnusedMethodArgument
  @manifest = manifest
  @generator_check = GeneratorCheck.new(manifest: manifest, file_stat: file_stat)
end

Instance Method Details

#call(prefix: nil, zone: nil) ⇒ Object



13
14
15
16
17
# File 'lib/textus/domain/staleness.rb', line 13

def call(prefix: nil, zone: nil)
  @manifest.data.entries
           .select { |m| entry_matches?(m, prefix: prefix, zone: zone) }
           .flat_map { |m| @generator_check.rows_for(m) }
end