class
Analyzer::Crystal::Grip
Defined in:
analyzer/analyzers/crystal/grip.crConstant Summary
-
GRIP_ROUTE_RE =
/(?:^|[^.\w])(get|post|put|patch|delete|options|head)\s+['"](.+?)['"]/ -
One combined PCRE2 scan replaces the previous 7 sequential per-verb matchers. Grip requires whitespace after the verb (
get "/x", notget("/x")) — the\s+keeps that shape, soinput "/x"still cannot be read asput "/x". -
SCOPE_END_RE =
/^(\s*)end\b/ -
SCOPE_OPEN_RE =
/^(\s*)scope\s+['"](.+?)['"].*\bdo\b/ -
WS_ROUTE_RE =
/(?:^|[^.\w])ws\s+['"](.+?)['"]/
Instance Method Summary
- #analyze_file(path : String) : Array(Endpoint)
- #line_to_endpoint(content : String, scopes : Array(String)) : Endpoint
- #line_to_param(content : String) : Param
- #line_to_websocket(content : String, scopes : Array(String)) : Endpoint