Skip to content

Instantly share code, notes, and snippets.

@johnl
Forked from damien/config.ru
Last active June 17, 2016 10:20
Show Gist options
  • Save johnl/7efffc8429f4c0ad0803f087a85b5f68 to your computer and use it in GitHub Desktop.
Save johnl/7efffc8429f4c0ad0803f087a85b5f68 to your computer and use it in GitHub Desktop.
A simple rack middleware to debug the request pipeline
# Usage example
require "inspect_env"
use InspectEnv
run GenericSinatraApp
class InspectEnv
require "yaml"
def initialize(app)
@app = app
end
def call(env)
print_env_class = lambda do |klass|
puts env.inspect
end
print_env_class.call(@app)
@app.call(env)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment