Sha256: 6408be21ddc8be476b2730d0ec6de135fb905a8b2be48c1a6e5fee5061ac0f24

Contents?: true

Size: 747 Bytes

Versions: 1

Compression:

Stored size: 747 Bytes

Contents

class Flail
  class Railtie < ::Rails::Railtie
    initializer "flail.use_rack_middleware" do |app|
      app.config.middleware.insert 0, "Flail::Rack"
    end

    config.after_initialize do
      Flail.configure do
        environment ::Rails.env
        host Socket.gethostname
      end

      if defined?(::ActionDispatch::DebugExceptions)
        # Rails 3.2.x
        require 'flail/rails/action_dispatch'
        ::ActionDispatch::DebugExceptions.send(:include, Flail::Rails::ActionDispatch)

      elsif defined?(::ActionDispatch::ShowExceptions)
        # Rails 3.0.x || 3.1.x
        require 'flail/rails/action_dispatch'
        ::ActionDispatch::ShowExceptions.send(:include, Flail::Rails::ActionDispatch)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flail-0.0.1 lib/flail/railtie.rb