# File lib/rack/lobster.rb, line 32 32: def call(env) 33: req = Request.new(env) 34: if req.GET["flip"] == "left" 35: lobster = LobsterString.split("\n"). 36: map { |line| line.ljust(42).reverse }. 37: join("\n") 38: href = "?flip=right" 39: elsif req.GET["flip"] == "crash" 40: raise "Lobster crashed" 41: else 42: lobster = LobsterString 43: href = "?flip=left" 44: end 45: 46: res = Response.new 47: res.write "<title>Lobstericious!</title>" 48: res.write "<pre>" 49: res.write lobster 50: res.write "</pre>" 51: res.write "<p><a href='#{href}'>flip!</a></p>" 52: res.write "<p><a href='?flip=crash'>crash!</a></p>" 53: res.finish 54: end