Created
November 19, 2009 23:10
-
-
Save ku1ik/239134 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
run Sinatra::Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment