Sha256: 0a0bf3feeabe53c799f5bdafc97ec73703c223acf55eb536fa334b8f77f79a5f

Contents?: true

Size: 904 Bytes

Versions: 11

Compression:

Stored size: 904 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

      ActiveSupport.on_load(:action_controller) do
        require 'flail/rails/controller_methods'
        include Flail::Rails::ControllerMethods
      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

11 entries across 11 versions & 1 rubygems

Version Path
flail-0.1.6 lib/flail/railtie.rb
flail-0.1.5 lib/flail/railtie.rb
flail-0.1.4 lib/flail/railtie.rb
flail-0.1.3 lib/flail/railtie.rb
flail-0.1.2 lib/flail/railtie.rb
flail-0.1.1 lib/flail/railtie.rb
flail-0.1.0 lib/flail/railtie.rb
flail-0.0.7 lib/flail/railtie.rb
flail-0.0.6 lib/flail/railtie.rb
flail-0.0.5 lib/flail/railtie.rb
flail-0.0.4 lib/flail/railtie.rb