Class: Textus::Doctor::Check

Inherits:
Object
  • Object
show all
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) }

Defined Under Namespace

Classes: AuditLog, Hooks, IllegalKeys, ManifestFiles, SchemaViolations, Schemas, Sentinels, Templates, UnownedSchemaFields

Class Method Summary collapse

Instance Method Summary collapse

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_keyObject

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

#callObject

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/textus/doctor/check.rb', line 21

def call
  raise NotImplementedError.new("#{self.class.name}#call not implemented")
end