Sha256: e3a86443e8e84325af2ff0fa18ae905ee3dde67096ad21ffd082f7ca75ea6f88

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

require 'ratchetio'
require 'rails'

module Ratchetio
  class Railtie < ::Rails::Railtie
    rake_tasks do
    end

    config.after_initialize do
      Ratchetio.configure do |config|
        config.logger ||= ::Rails.logger
        config.environment ||= ::Rails.env
        config.root ||= ::Rails.root
        config.framework = "Rails: #{::Rails::VERSION::STRING}"
      end

      ActiveSupport.on_load(:action_controller) do
        # lazily load action_controller methods
        require 'ratchetio/rails/controller_methods'
        include Ratchetio::Rails::ControllerMethods
      end

      if defined?(::ActionDispatch::DebugExceptions)
        # rails 3.2.x
        require 'ratchetio/rails/middleware/exception_catcher'
        ::ActionDispatch::DebugExceptions.send(:include, Ratchetio::Rails::Middleware::ExceptionCatcher)
      elsif defined?(::ActionDispatch::ShowExceptions)
        # rails 3.0.x and 3.1.x
        require 'ratchetio/rails/middleware/exception_catcher'
        ::ActionDispatch::ShowExceptions.send(:include, Ratchetio::Rails::Middleware::ExceptionCatcher)
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ratchetio-0.0.5 lib/ratchetio/railtie.rb
ratchetio-0.0.4 lib/ratchetio/railtie.rb
ratchetio-0.0.3 lib/ratchetio/railtie.rb
ratchetio-0.0.2 lib/ratchetio/railtie.rb
ratchetio-0.0.1 lib/ratchetio/railtie.rb