class Rack::Printout

prints the environment and request for simple debugging

Public Instance Methods

call(env) click to toggle source
# File lib/rack/contrib/printout.rb, line 8
def call(env)
  # See http://rack.rubyforge.org/doc/SPEC.html for details
  puts "**********\n Environment\n **************"
  puts env.inspect
  
  puts "**********\n Response\n **************"
  response = @app.call(env)
  puts response.inspect

  puts "**********\n Response contents\n **************"
  response[2].each do |chunk|
    puts chunk
  end
  puts "\n \n"
  return response
end

Public Class Methods

new(app) click to toggle source
# File lib/rack/contrib/printout.rb, line 4
def initialize(app)
  @app = app
end