Sha256: 42dd0ba03e56838c4edb6b82859768a7b949c496a56525c874de47337a5e230a

Contents?: true

Size: 1.21 KB

Versions: 9

Compression:

Stored size: 1.21 KB

Contents

require 'rails'
require 'ratchetio'

module Ratchetio
  class Railtie < ::Rails::Railtie
    rake_tasks do
      require 'ratchetio/rake_tasks'
    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}"
        config.filepath ||= ::Rails.application.class.parent_name + '.ratchet'
      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

9 entries across 9 versions & 1 rubygems

Version Path
ratchetio-0.5.5 lib/ratchetio/railtie.rb
ratchetio-0.5.3 lib/ratchetio/railtie.rb
ratchetio-0.5.2 lib/ratchetio/railtie.rb
ratchetio-0.5.1 lib/ratchetio/railtie.rb
ratchetio-0.5.0 lib/ratchetio/railtie.rb
ratchetio-0.4.11 lib/ratchetio/railtie.rb
ratchetio-0.4.10 lib/ratchetio/railtie.rb
ratchetio-0.4.9 lib/ratchetio/railtie.rb
ratchetio-0.4.8 lib/ratchetio/railtie.rb