class Madness::Static

The Madness::Static middleware delegates requests to Rack::Static middleware unless the request URI ends with .md

Public Class Methods

new(app, options) click to toggle source
# File lib/madness/static.rb, line 6
def initialize(app, options)
  @app = app
  @static = Rack::Static.new app, options
end

Public Instance Methods

call(env) click to toggle source
# File lib/madness/static.rb, line 11
def call(env)
  if env['PATH_INFO'].end_with? ".md"
    @app.call env
  else
    @static.call env
  end
end