AmebaConfig::Catalog
The collection of ameba rules discovered by running the installed
ameba binary. The catalog is lazily populated: rule details (settings,
detailed description) are fetched on demand via ameba -d <rule> and
memoised in each Rule instance.
Constants
Matches a single line in the ameba -r rule listing, e.g.:
" ✓ [W] Style/VerboseBlock Identifies..."
Constructors
Constructor for tests: bypass ameba CLI and inject a pre-built rule set. Every rule passed in is considered already-hydrated, so detail lookups are no-ops.
Class methods
True when the ameba binary is reachable on $PATH. Used by specs to
skip integration tests when the tool isn't installed.
Resolve the ameba binary by searching $PATH. Raises with a clear
message if it isn't installed — we don't fall back to any hardcoded
location, since that just produced confusing errors when ameba got
moved between homebrew prefixes.
Instance methods
Resolve a case-insensitive rule name to its canonical form. Returns nil when no rule matches. Exact-case matches are honoured first so the happy path stays O(1).
Resolve a case-insensitive rule name, raising CLIError when unknown.
The error message uses the user's spelling so they recognise their input.
Hydrate one rule with details from ameba -d <name> if not already done.
Force-load detailed descriptions and defaults for every rule. Useful for
create/update which iterate over the full catalog.