Sha256: 08528f7ac9fa7e7b6b1b266f3397474a03175986a9edfff806c5a76b1cf0febe

Contents?: true

Size: 607 Bytes

Versions: 1

Compression:

Stored size: 607 Bytes

Contents

module Rambulance
  class Railtie < Rails::Railtie
    initializer 'rambulance' do |app|
      require "rambulance/exceptions_app"

      app.config.exceptions_app =
        begin
          ActiveSupport::Dependencies.load_missing_constant(Object, :ExceptionsApp)
          ->(env){ ::ExceptionsApp.call(env) }
        rescue NameError
          ::Rambulance::ExceptionsApp
        end

      ActiveSupport.on_load(:after_initialize) do
        Rails.application.routes.append do
          mount app.config.exceptions_app, at: '/rambulance'
        end if Rails.env.development?
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rambulance-0.3.1 lib/rambulance/railtie.rb