Class: Textus::Doctor::Check
- Inherits:
-
Object
- Object
- Textus::Doctor::Check
- Defined in:
- lib/textus/doctor/check.rb,
lib/textus/doctor/check/hooks.rb,
lib/textus/doctor/check/schemas.rb,
lib/textus/doctor/check/audit_log.rb,
lib/textus/doctor/check/sentinels.rb,
lib/textus/doctor/check/templates.rb,
lib/textus/doctor/check/illegal_keys.rb,
lib/textus/doctor/check/manifest_files.rb,
lib/textus/doctor/check/schema_violations.rb,
lib/textus/doctor/check/unowned_schema_fields.rb
Overview
Abstract base for a single doctor check. Each concrete check inspects one slice of store health and returns an array of issue hashes:
{ "code" => String, "level" => "error"|"warning"|"info",
"subject" => String, "message" => String, "fix" => String (optional) }
Direct Known Subclasses
AuditLog, Hooks, IllegalKeys, ManifestFiles, SchemaViolations, Schemas, Sentinels, Templates, UnownedSchemaFields
Defined Under Namespace
Classes: AuditLog, Hooks, IllegalKeys, ManifestFiles, SchemaViolations, Schemas, Sentinels, Templates, UnownedSchemaFields
Class Method Summary collapse
-
.name_key ⇒ Object
Snake-case name used in –checks flag and ALL_CHECKS list.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(store) ⇒ Check
constructor
A new instance of Check.
Constructor Details
#initialize(store) ⇒ Check
Returns a new instance of Check.
17 18 19 |
# File 'lib/textus/doctor/check.rb', line 17 def initialize(store) @store = store end |
Class Method Details
.name_key ⇒ Object
Snake-case name used in –checks flag and ALL_CHECKS list. Default derives from the class name; override if the SPEC name diverges.
10 11 12 13 14 15 |
# File 'lib/textus/doctor/check.rb', line 10 def self.name_key @name_key ||= name.split("::").last .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2') .downcase end |
Instance Method Details
#call ⇒ Object
21 22 23 |
# File 'lib/textus/doctor/check.rb', line 21 def call raise NotImplementedError.new("#{self.class.name}#call not implemented") end |