Created
March 27, 2009 22:39
-
-
Save rue/86947 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
#!/Users/ruerue/code/rubinius/master/vm/vm | |
require "rubygems" | |
require "rack" | |
require "rack/builder" | |
require "rack/lint" | |
require "rack/response" | |
require "rack/showexceptions" | |
require "rack/utils" | |
require "rack/handler/cgi" | |
class App | |
def call(env) | |
response = Rack::Response.new | |
response.write "<title>Rubick</title>" | |
response.write "<html><body>" | |
response.write "<p>Greetings! Your fancy Rubinius Rack environment:</p>" | |
response.write "<pre>" | |
response.write env.sort_by {|k,v| k }.map {|key, value| | |
Rack::Utils.escape_html "#{key}: #{value.inspect}" | |
}.join "\n" | |
response.write "</pre>" | |
response.write "</body></html>" | |
response.finish | |
end | |
end | |
app = Rack::Builder.new { | |
use Rack::ShowExceptions | |
use Rack::Lint | |
run App.new | |
} | |
Rack::Handler::CGI.run app |
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
http://0.0.0.0/cgi/rack.rb/moo/baa?foo=baz&bar=qu%20ux |
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
Greetings! Your fancy Rubinius Rack environment: | |
DOCUMENT_ROOT: "/opt/local/apache2/htdocs" | |
GATEWAY_INTERFACE: "CGI/1.1" | |
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" | |
HTTP_ACCEPT_CHARSET: "ISO-8859-1,utf-8;q=0.7,*;q=0.7" | |
HTTP_ACCEPT_ENCODING: "gzip,deflate" | |
HTTP_ACCEPT_LANGUAGE: "en-us,en;q=0.5" | |
HTTP_CONNECTION: "keep-alive" | |
HTTP_HOST: "0.0.0.0" | |
HTTP_KEEP_ALIVE: "300" | |
HTTP_USER_AGENT: "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.7) Gecko/2009021906 Firefox/3.0.7" | |
HTTP_VERSION: "HTTP/1.1" | |
PATH: "/opt/local/apache2/bin:/opt/local/soylatte16/bin:/opt/local/bin:/Users/ruerue/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/local/ruby191/bin:/usr/local/git/bin:/opt/local/jruby/bin" | |
PATH_INFO: "/moo/baa" | |
PATH_TRANSLATED: "/opt/local/apache2/htdocs/moo/baa" | |
QUERY_STRING: "foo=baz&bar=qu%20ux" | |
REMOTE_ADDR: "127.0.0.1" | |
REMOTE_PORT: "63997" | |
REQUEST_METHOD: "GET" | |
REQUEST_PATH: "/" | |
REQUEST_URI: "/cgi/rack.rb/moo/baa?foo=baz&bar=qu%20ux" | |
SCRIPT_FILENAME: "/opt/local/apache2/htdocs/cgi/rack.rb" | |
SCRIPT_NAME: "/cgi/rack.rb" | |
SERVER_ADDR: "127.0.0.1" | |
SERVER_ADMIN: "you@example.com" | |
SERVER_NAME: "0.0.0.0" | |
SERVER_PORT: "80" | |
SERVER_PROTOCOL: "HTTP/1.1" | |
SERVER_SIGNATURE: "" | |
SERVER_SOFTWARE: "Apache/2.2.10 (Unix) mod_ssl/2.2.10 OpenSSL/0.9.8i DAV/2" | |
UNIQUE_ID: "Sc1UzcCoAWMAAAo8Mc4AAACA" | |
rack.errors: #<Rack::Lint::ErrorWrapper:0x8c8 @error=#<IO:0x8c6>> | |
rack.input: #<Rack::Lint::InputWrapper:0x8ca @input=#<IO:0x8c2>> | |
rack.multiprocess: true | |
rack.multithread: false | |
rack.run_once: true | |
rack.url_scheme: "http" | |
rack.version: [0, 1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment