Sha256: 1f3faae06aca1fb469844c4d5448ce8ef2a67ce12de719994c4de4f3478a2950

Contents?: true

Size: 732 Bytes

Versions: 1

Compression:

Stored size: 732 Bytes

Contents

module Crawlable
  class Engine < Rails::Engine
    
    initializer "authlogic_connect.authentication_hook" do |app|
      app.middleware.use Crawlable::Rack
      add_helpers Crawlable::Sitemap, Crawlable::Feed
    end
    
    def add_helpers(*clazzes)
      clazzes.each do |clazz|
        clazz.class_eval do
          include ApplicationHelper

          if defined?(::Rails)
            if ActionPack::VERSION::MAJOR == 3
              include ::Rails.application.routes.url_helpers
            else
              require 'action_controller'
              include ActionController::UrlWriter
            end
            default_url_options[:host] = 'localhost:3000'
          end
        end
      end
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crawlable-0.0.1.8 lib/engine.rb