public
Created

  • Download Gist
config.ru
Ruby
1 2 3 4
require 'rubygems'
require 'sinatra'
 
run Sinatra::Application
gistfile2.rb
Ruby
1 2 3 4 5 6 7 8 9
kill@lenny workspace/tmp/sinatra-example % racksh
Rack::Shell v0.9.4 started in development environment.
>> $rack.get "/"
=> #<Rack::MockResponse:0xb7285dcc @body="<!DOCTYPE html>\n<html>\n<head>\n <style type=\"text/css\">\n body { text-align:center;font-family:helvetica,arial;font-size:22px;\n color:#888;margin:20px}\n #c {margin:0 auto;width:500px;text-align:left}\n </style>\n</head>\n<body>\n <h2>Sinatra doesn't know this ditty.</h2>\n <img src='/__sinatra__/404.png'>\n <div id=\"c\">\n Try this:\n <pre>get '/' do\n \"Hello World\"\nend</pre>\n </div>\n</body>\n</html>\n", @original_headers={"Content-Type"=>"text/html", "Content-Length"=>"409"}, @errors="127.0.0.1 - - [19/Nov/2009 23:58:53] \"GET / \" 404 409 0.0003\n", @headers={"Content-Type"=>"text/html", "Content-Length"=>"409"}, @status=404>
>> get("/") { "Showtime!" }
=> [/^\/$/, [], [], #<Proc:0xb7358290@/home/kill/.gem/ruby/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:779>]
>> $rack.get "/"
=> #<Rack::MockResponse:0xb727eb80 @body="Showtime!", @original_headers={"Content-Type"=>"text/html", "Content-Length"=>"9"}, @errors="127.0.0.1 - - [20/Nov/2009 00:00:41] \"GET / \" 200 9 0.0002\n", @headers={"Content-Type"=>"text/html", "Content-Length"=>"9"}, @status=200>
>>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.