class Rackup::Lobster

Paste has a Pony, Rack has a Lobster!

def call(env)

def call(env)
  req = Request.new(env)
  if req.GET["flip"] == "left"
    lobster = LobsterString.split("\n").map do |line|
      line.ljust(42).reverse.
        gsub('\\', 'TEMP').
        gsub('/', '\\').
        gsub('TEMP', '/').
        gsub('{', '}').
        gsub('(', ')')
    end.join("\n")
    href = "?flip=right"
  elsif req.GET["flip"] == "crash"
    raise "Lobster crashed"
  else
    lobster = LobsterString
    href = "?flip=left"
  end
  res = Response.new
  res.write "<title>Lobstericious!</title>"
  res.write "<pre>"
  res.write lobster
  res.write "</pre>"
  res.write "<p><a href='#{href}'>flip!</a></p>"
  res.write "<p><a href='?flip=crash'>crash!</a></p>"
  res.finish
end