class Rack::Jasmine::Runner

Public Instance Methods

call(env) click to toggle source
# File lib/rack/jasmine/runner.rb, line 9
def call(env)
  @path = env["PATH_INFO"]
  return not_found if @path != "/"
  [
    200,
    { 'Content-Type' => 'text/html'},
    [@page.render]
  ]
end
not_found() click to toggle source
# File lib/rack/jasmine/runner.rb, line 19
def not_found
  [404, {"Content-Type" => "text/plain",
         "X-Cascade" => "pass"},
         ["File not found: #{@path}\n"]]
end

Public Class Methods

new(page) click to toggle source
# File lib/rack/jasmine/runner.rb, line 5
def initialize(page)
  @page = page
end