Sha256: fff2ca967e8581602ea233baac37cd689a8e0e3909a56bb8b83fc056d9508ef4
Contents?: true
Size: 1.12 KB
Versions: 39
Compression:
Stored size: 1.12 KB
Contents
# typed: ignore # Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html module Sqreen module Dependency module Rack module_function def find_handler(&block) Sqreen::Graft::Hook.add('Rack::Server#server') do after do |call| callback = call.callback server = call.returned block.call(server) callback.disable # do this once, :server is a lazy init accessor end end Sqreen::Graft::Hook['Rack::Server#server'].install end def on_run(handler, &block) Sqreen.log.debug "[#{Process.pid}] #{handler.inspect}" hookpoint_name = "#{handler.name}.run" Sqreen::Graft::Hook.add(hookpoint_name) do before { block.call(handler) } end Sqreen::Graft::Hook[hookpoint_name].install end def rackup? return false if Sqreen::Dependency::Rails.server? Sqreen::Dependency.const_exist?('Rack::Server') && ObjectSpace.each_object(::Rack::Server).count > 0 end end end end
Version data entries
39 entries across 39 versions & 1 rubygems