class

Analyzer::Ruby::Roda

Inherits Analyzer::Ruby::RubyEngine < Analyzer < FileHelper < Reference < Object

Constants

HTTP_METHOD_MATCHERS = ["get", "post", "put", "delete", "patch", "head", "options"]
RODA_EVIDENCE_RE = Regex.union("Roda", "route do")

analyze_file's per-file evidence gate OR-ed two String#includes? scans as a standalone boolean gate. Folded into one precompiled union so it costs a single PCRE2 match instead of up to two naive substring scans per file.

RODA_VERB_BARE = HTTP_METHOD_MATCHERS.to_h do |verb| {verb, /\br\.#{verb}\b\s*(?:do\b|\{|\/|$)/} end
RODA_VERB_BLOCK = HTTP_METHOD_MATCHERS.to_h do |verb| {verb, /\br\.#{verb}\s+(.+?)\s*(?:do\b\s*(?:\|([^|]*)\|)?|\{\s*(?:\|([^|]*)\|)?)/} end

Precompile the per-verb routing-tree regexes once at load time. Crystal recompiles an interpolated regex literal on every match, so the r.<verb> matchers used to rebuild 21 regexes for every line of every route block. _BLOCK = r.get "x" do |..|/{, _STRING = r.get "path", _BARE = r.get (do/brace/slash/eol).

RODA_VERB_STRING = HTTP_METHOD_MATCHERS.to_h do |verb| {verb, /\br\.#{verb}\s+['"]([^'"]+)['"]/} end

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

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.

Source

Nested types