class

Analyzer::R::Plumber

Inherits Analyzer < FileHelper < Reference < Object

Constants

FUNCTION_DECLARATION = /\bfunction\s*\(([^)]*)\)/

Matches R function declaration: function(...)

HTTP_METHODS = Set {"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"}
PARAM_ANNOTATION = /@param\s+([A-Za-z0-9_.-]+)(?:\s+(.*))?/i

Matches lines like: #* @param name Description

PROGRAMMATIC_DOLLAR = /\$([a-z]+)\s*\(\s*["']([^"']+)["']/i

r$get("/path", handler)

PROGRAMMATIC_DOLLAR_HANDLE = /\$handle\s*\(\s*["'](GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)["']\s*,\s*["']([^"']+)["']/i

r$handle("GET", "/path", handler)

PROGRAMMATIC_HANDLE = /\bpr_handle\s*\(\s*[^,]+,\s*["'](GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)["']\s*,\s*["']([^"']+)["']/i

pr_handle(pr, "GET", "/path", handler)

PROGRAMMATIC_PIPELINE = /\bpr_(get|post|put|delete|patch|head|options)\s*\(\s*["']([^"']+)["']/i

Programmatic routes: pr_get("/path", handler)

ROUTE_ANNOTATION = /@(get|post|put|delete|patch|head|options)\s+(\S+)/i

Matches lines like: #* @get /path or #* @post /path

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