Class: Textus::Doctor::Check::SchemaParseError
- Inherits:
-
Check
- Object
- Check
- Textus::Doctor::Check::SchemaParseError
- Defined in:
- lib/textus/doctor/check/schema_parse_error.rb
Overview
Surfaces YAML parse failures for files in
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/textus/doctor/check/schema_parse_error.rb', line 9 def call dir = geometry.schemas_dir return [] unless File.directory?(dir) Dir.glob(File.join(dir, "*.yaml")).each_with_object([]) do |path, out| Schema.load(path) rescue StandardError => e out << { "code" => "schema.parse_error", "level" => "error", "subject" => path, "message" => "schema failed to parse: #{e.class}: #{e.}", "fix" => "fix the YAML at #{path} (check indentation, quoted scalars, and aliases)", } end end |