Parent

Methods

Files

Shotgun::Static

Serves static files out of the specified directory.

Public Class Methods

new(app, public_dir='./public') click to toggle source
   # File lib/shotgun/static.rb, line 6
6:     def initialize(app, public_dir='./public')
7:       @file = Rack::File.new(public_dir)
8:       @app = app
9:     end

Public Instance Methods

call(env) click to toggle source
    # File lib/shotgun/static.rb, line 11
11:     def call(env)
12:       status, headers, body = @file.call(env)
13:       if status > 400
14:         @app.call(env)
15:       else
16:         [status, headers, body]
17:       end
18:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.