Skip to content

Instantly share code, notes, and snippets.

@jseifer
Created April 8, 2009 02:43
Show Gist options
  • Select an option

  • Save jseifer/91599 to your computer and use it in GitHub Desktop.

Select an option

Save jseifer/91599 to your computer and use it in GitHub Desktop.
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class Test
def self.call(env)
if env["PATH_INFO"] =~ /^\/test/
[200, {"Content-Type" => "text/html"}, ["Hello, World!"]]
else
[404, {"Content-Type" => "text/html"}, ["Not Found"]]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment