Sha256: 2b6f71f0b470b74c53bc72a5c9232ead9c165aa914c3d4c8096ba65972cec7df

Contents?: true

Size: 963 Bytes

Versions: 11

Compression:

Stored size: 963 Bytes

Contents

module Authlogic
  module ControllerAdapters
    # = Merb Adapter
    # Adapts authlogic to work with merb. The point is to close the gap between what authlogic expects and what the merb controller object
    # provides. Similar to how ActiveRecord has an adapter for MySQL, PostgreSQL, SQLite, etc.
    class MerbAdapter < AbstractAdapter
      # = Merb Implementation
      # Lets Authlogic know about the controller object, AKA "activates" authlogic.
      module MerbImplementation
        def self.included(klass) # :nodoc:
          klass.before :activate_authlogic
        end

        private
          def activate_authlogic
            Authlogic::Session::Base.controller = MerbAdapter.new(self)
          end
      end
    end
  end
end
 
# make sure we're running inside Merb
if defined?(Merb::Plugins)
  Merb::BootLoader.before_app_loads do
    Merb::Controller.send(:include, Authlogic::ControllerAdapters::MerbAdapter::MerbImplementation)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
authlogic-1.1.0 lib/authlogic/controller_adapters/merb_adapter.rb
authlogic-1.1.1 lib/authlogic/controller_adapters/merb_adapter.rb
authlogic-1.1.2 lib/authlogic/controller_adapters/merb_adapter.rb
authlogic-1.2.0 lib/authlogic/controller_adapters/merb_adapter.rb
authlogic-1.2.1 lib/authlogic/controller_adapters/merb_adapter.rb
authlogic-1.2.2 lib/authlogic/controller_adapters/merb_adapter.rb
authlogic-1.3.0 lib/authlogic/controller_adapters/merb_adapter.rb
authlogic-1.3.1 lib/authlogic/controller_adapters/merb_adapter.rb
authlogic-1.3.2 lib/authlogic/controller_adapters/merb_adapter.rb
authlogic-1.3.3 lib/authlogic/controller_adapters/merb_adapter.rb
authlogic-1.3.4 lib/authlogic/controller_adapters/merb_adapter.rb