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) |
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
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
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 Lockdown | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
request = Rack::Request.new(env) | |
if ["GET", "HEAD"].include?(request.request_method) |
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 EtyRack | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
sleep 86400 | |
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-gsub | |
http://github.com/techiferous/rack-gsub |
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
require 'nokogiri' | |
module Rack | |
class Steamroller | |
def initialize(app, options = {}) | |
@app = app | |
@options = options | |
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
# If you'd like this packaged up as a gem, send me a note. You can get | |
# in touch with me at http://www.techiferous.com/about | |
require 'nokogiri' | |
require 'ispell' | |
module Rack | |
class SpellCheck | |
def initialize(app, options = {}) |
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-linkify | |
http://github.com/techiferous/rack-linkify |
OlderNewer