class

Analyzer::Clojure::Compojure

Inherits Analyzer < FileHelper < Reference < Object

Constants

CLOJURE_EXTENSIONS = {".clj", ".cljc", ".cljs"}
COMPOJURE_SOURCE_RE = Regex.union("compojure.core", "compojure.api", "defroutes", "(context")

Whole-file detection gate, evaluated once per candidate file. String#matches? (PCRE2 JIT) replaces four naive String#includes? char scans with a single pass; Regex.union auto-escapes each literal, so it is provably equivalent to the OR-of-substrings it replaces.

RESOURCE_METHODS = {":get" => "GET", ":post" => "POST", ":put" => "PUT", ":delete" => "DELETE", ":patch" => "PATCH", ":head" => "HEAD", ":options" => "OPTIONS", ":any" => "ANY"}

compojure.api.resource method keys (keyword form inside the resource map).

RESTRUCTURING_PARAMS = {":query-params" => "query", ":body-params" => "json", ":path-params" => "path", ":form-params" => "form", ":header-params" => "header"}

compojure-api restructuring directives that name request params with a [name :- Schema ...] binding vector in the route body.

ROUTE_METHODS = {"GET" => "GET", "POST" => "POST", "PUT" => "PUT", "DELETE" => "DELETE", "PATCH" => "PATCH", "HEAD" => "HEAD", "OPTIONS" => "OPTIONS", "ANY" => "ANY"}

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