Analyzer::Ruby::Hanami
Inherits Analyzer::Ruby::RubyEngine < Analyzer < FileHelper < Reference < Object
Constants
HANAMI_HTTP_VERBS = HTTP_VERBS + ["trace"]
HANAMI_VERB_PATTERNS = HANAMI_HTTP_VERBS.map do |verb|
{verb, /^#{verb}\s*\(?\s*['"]([^'"]*)['"](.*)$/}
end
Crystal recompiles an interpolated regex literal on every evaluation (a full PCRE2 JIT compile). The verb set is fixed, so precompile the per-verb route matchers once at load time.
Class methods
tech_name
SourceInstance methods
analyze
Sourcetech
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.