class

Analyzer::Specification::Hurl

Inherits Analyzer::Specification::SpecificationEngine < Analyzer < FileHelper < Reference < Object

Parses Hurl (.hurl) request files.

An entry starts with a METHOD url line, followed by header lines, [Section] blocks of key: value lines ([QueryStringParams], [FormParams], [MultipartFormData], [Cookies], [BasicAuth], …) and an optional body. An HTTP <status> line opens the response half (captures and asserts), which carries no request surface. {{var}} placeholders come from the Hurl command line, so an unresolved one in the path becomes a :var path parameter.

Constants

BODY_START = /^(?:[{\[<`]|(?:file|base64|hex),)/

JSON, XML, a oneline `string` or a file, / base64, / hex, body. Anything else before the body is a key: value line.

REQUEST_LINE = /^(#{ALLOWED_HTTP_METHODS.join('|')})[ \t]+(\S+)/
RESPONSE_LINE = /^HTTP(?:\/[\d.]+)?[ \t]+(?:\d{3}|\*)/
SECTION_LINE = /^\[([A-Za-z]+)\]$/

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