Class: Textus::Doctor::Check::LegacyIntakeFields
- Inherits:
-
Textus::Doctor::Check
- Object
- Textus::Doctor::Check
- Textus::Doctor::Check::LegacyIntakeFields
- Defined in:
- lib/textus/doctor/check/legacy_intake_fields.rb
Overview
Scans the raw manifest YAML for entry-level intake.ttl / intake.on_stale / intake.sync_budget_ms keys. Manifest parsing already raises on these in 0.9.2 — this check exists for the case where doctor is run against a problem manifest separately (e.g. CI lint or an exploration session that loads the YAML directly).
Constant Summary collapse
- LEGACY_KEYS =
%w[ttl on_stale sync_budget_ms].freeze
Instance Method Summary collapse
Methods inherited from Textus::Doctor::Check
Constructor Details
This class inherits a constructor from Textus::Doctor::Check
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/textus/doctor/check/legacy_intake_fields.rb', line 14 def call out = [] path = File.join(store.root, "manifest.yaml") return out unless File.exist?(path) raw = safe_load(path) return out unless raw.is_a?(Hash) Array(raw["entries"]).each do |entry| next unless entry.is_a?(Hash) intake = entry["intake"] next unless intake.is_a?(Hash) offending = LEGACY_KEYS.select { |k| intake.key?(k) } next if offending.empty? out << issue_for(entry["key"], offending) end out end |