Skip to content

Instantly share code, notes, and snippets.

@octosteve
Created April 20, 2016 17:46
Show Gist options
  • Save octosteve/d95a7fd78b74b1b1ff58e83160f33188 to your computer and use it in GitHub Desktop.
Save octosteve/d95a7fd78b74b1b1ff58e83160f33188 to your computer and use it in GitHub Desktop.
# call run on a object that has
# a #call method
# takes one argument
# and returns an array with [status_code, headers, body]
require 'pry'
class App
def call(env)
binding.pry
request = Rack::Request.new(env)
[404, {"Content-Type" => "text/html"}, ["<h1>Not Big</h1>"]]
end
end
my_app = App.new
run my_app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment