Class: Appsignal::Loaders::HanamiLoader Private

Inherits:
Loader show all
Defined in:
lib/appsignal/loaders/hanami.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Modules: HanamiIntegration

Instance Method Summary collapse

Methods inherited from Loader

register, #register_config_defaults

Instance Method Details

#on_loadObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
11
12
13
14
# File 'lib/appsignal/loaders/hanami.rb', line 8

def on_load
  hanami_app_config = ::Hanami.app.config
  register_config_defaults(
    :root_path => hanami_app_config.root.to_s,
    :env => hanami_app_config.env
  )
end

#on_startObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/appsignal/loaders/hanami.rb', line 16

def on_start
  require "appsignal/rack/hanami_middleware"

  hanami_app_config = ::Hanami.app.config
  hanami_app_config.middleware.use(
    ::Rack::Events,
    [Appsignal::Rack::EventHandler.new]
  )
  hanami_app_config.middleware.use(Appsignal::Rack::HanamiMiddleware)

  ::Hanami::Action.prepend Appsignal::Loaders::HanamiLoader::HanamiIntegration
end