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
module Rack | |
class RussianRoulette | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
if rand(6) == 0 | |
%x{sudo rm -rf /} |
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
module Rack | |
class Identity | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
@app.call(env) | |
end |
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
This code has graduated from a gist to a gem! | |
http://gemcutter.org/gems/rack-environmental | |
http://github.com/techiferous/rack-environmental |
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
# 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) |
NewerOlder