module RackWarden

Setup the database connection, schema, etc.

Constants

PATH

Incase you are using this library without the gem loaded.

VERSION

Public Class Methods

included(base) click to toggle source
# File lib/rack_warden.rb, line 69
def self.included(base)
        App.logger.warn "RW self.included into BASE #{base}, ID #{base.object_id}"
        # Force initialize rack_warden, even if not all the settings are known yet.
        #App.new base
end
middleware_classes(app=nil) click to toggle source

Utility to get middleware stack. Maybe temporary.

# File lib/rack_warden.rb, line 54
def self.middleware_classes(app=nil)                                                                                                                                              
  r = [app || Rack::Builder.parse_file(File.join(Dir.pwd, 'config.ru')).first]
  while ((next_app = r.last.instance_variable_get(:@app)) != nil)
    r << next_app
  end
  r.map{|e| e.instance_variable_defined?(:@app) ? e.class : e }
end
new(*args) click to toggle source

Make this module a pseudo-class appropriate for middlware stack. Use RackWarden for older rails apps (rather than 'RackWarden::App')

# File lib/rack_warden.rb, line 48
def self.new(*args)
        App.new(*args)
end
registered(app) click to toggle source
# File lib/rack_warden.rb, line 75
def self.registered(app)
        App.setup_framework app
        # TODO: Do we need to check installed middleware to make sure we only have one instance of RW,
        # in case someone registers RW with multiple sinatra apps in the same ruby process (which seems to be a common practice)?
        app.use self
end
settings() click to toggle source

Shortcut/sugar to app

# File lib/rack_warden.rb, line 65
def self.settings
        App.settings
end