Sha256: 7d5b0df3072ed7915692136a80a198f3d5795cc1f79c01e3ee0a3ff4ed691134

Contents?: true

Size: 983 Bytes

Versions: 7

Compression:

Stored size: 983 Bytes

Contents

require 'hoptoad_notifier'
require 'rails'

module HoptoadNotifier
  class Railtie < Rails::Railtie
    rake_tasks do
      require "hoptoad_notifier/rails3_tasks"
    end

    initializer "hoptoad.use_rack_middleware" do |app|
      app.config.middleware.use "HoptoadNotifier::Rack"
    end

    config.after_initialize do
      HoptoadNotifier.configure(true) do |config|
        config.logger           ||= Rails.logger
        config.environment_name ||= Rails.env
        config.project_root     ||= Rails.root
        config.framework        = "Rails: #{::Rails::VERSION::STRING}"
      end

      if defined?(::ActionController::Base)
        require 'hoptoad_notifier/rails/javascript_notifier'
        require 'hoptoad_notifier/rails/controller_methods'
        
        ::ActionController::Base.send(:include, HoptoadNotifier::Rails::ControllerMethods)
        ::ActionController::Base.send(:include, HoptoadNotifier::Rails::JavascriptNotifier)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hoptoad_notifier-2.4.2 lib/hoptoad_notifier/railtie.rb
hoptoad_notifier-2.4.1 lib/hoptoad_notifier/railtie.rb
hoptoad_notifier-2.4.0 lib/hoptoad_notifier/railtie.rb
hoptoad_notifier-2.3.12 lib/hoptoad_notifier/railtie.rb
hoptoad_notifier-2.3.11 lib/hoptoad_notifier/railtie.rb
hoptoad_notifier-2.3.10 lib/hoptoad_notifier/railtie.rb
hoptoad_notifier-2.3.9 lib/hoptoad_notifier/railtie.rb