Class: Rack::Lint

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/lint.rb

Overview

Rack::Lint validates your application and the requests and responses according to the Rack spec.

Defined Under Namespace

Classes: LintError, Wrapper

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Lint

Returns a new instance of Lint.



13
14
15
# File 'lib/rack/lint.rb', line 13

def initialize(app)
  @app = app
end

Instance Method Details

#call(env = nil) ⇒ Object

AUTHORS: n.b. The trailing whitespace between paragraphs is important and should not be removed. The whitespace creates paragraphs in the RDoc output.

This specification aims to formalize the Rack protocol. You can (and should) use Rack::Lint to enforce it.

When you develop middleware, be sure to add a Lint before and after to catch all mistakes.

Rack applications

A Rack application is a Ruby object (not a class) that responds to call.



34
35
36
# File 'lib/rack/lint.rb', line 34

def call(env = nil)
  Wrapper.new(@app, env).response
end