class Leafy::Rack::ThreadDump

Constants

WRITER

Public Class Methods

new(app, path = '/threads') click to toggle source
# File leafy-rack/lib/leafy/rack/thread_dump.rb, line 42
def initialize(app, path = '/threads')
  @app = app
  @path = path
end
response() click to toggle source
# File leafy-rack/lib/leafy/rack/thread_dump.rb, line 32
def self.response
  dump = WRITER.to_text
  [  
   200, 
   { 'Content-Type' => 'text/plain',
     'Cache-Control' => 'must-revalidate,no-cache,no-store' }, 
   [ dump ? dump : 'Sorry your runtime environment does not allow to dump threads.' ]
  ]
end

Public Instance Methods

call(env) click to toggle source
# File leafy-rack/lib/leafy/rack/thread_dump.rb, line 47
def call(env)
  if env['PATH_INFO'] == @path
    ThreadDump.response
  else
    @app.call( env )
  end
end