Sha256: ac44590ddb91417a87c3faa377d9748e89eb5fe144e01597664360ff44744b04

Contents?: true

Size: 862 Bytes

Versions: 2

Compression:

Stored size: 862 Bytes

Contents

require "shamu/rack"

module Shamu
  module Rails

    # Integrate Shamu with rails.
    class Railtie < ::Rails::Railtie

      rake_tasks do
        rake_path = File.expand_path( "../../tasks/*.rake" )
        Dir[ rake_path ].each { |f| load f }
      end

      initializer "shamu.configure" do
        if defined? ::ActionController
          ::ActionController::Base.send :include, Shamu::Rails::Controller
          ::ActionController::Base.send :include, Shamu::Rails::Entity
          ::ActionController::Base.send :include, Shamu::Rails::Features
        end
      end

      initializer "shamu.insert_middleware" do |app|
        app.config.middleware.use "Scorpion::Rack::Middleware"
        app.config.middleware.use "Shamu::Rack::CookiesMiddleware"
        app.config.middleware.use "Shamu::Rack::QueryParamsMiddleware"
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shamu-0.0.3 lib/shamu/rails/railtie.rb
shamu-0.0.2 lib/shamu/rails/railtie.rb