Module: Sinatra::SimpleAuthentication
- Defined in:
- lib/sinatra/simple-authentication.rb,
lib/sinatra/simple_authentication/controllers/helpers.rb,
lib/sinatra/simple_authentication/controllers/session.rb,
lib/sinatra/simple_authentication/controllers/defaults.rb,
lib/sinatra/simple_authentication/models/datamapper/user.rb,
lib/sinatra/simple_authentication/models/active_record/user.rb,
lib/sinatra/simple_authentication/models/datamapper/adapter.rb,
lib/sinatra/simple_authentication/models/active_record/adapter.rb,
lib/sinatra/simple_authentication/models/common/instance_methods.rb
Defined Under Namespace
Modules: Controllers, Models
Class Method Summary
collapse
Class Method Details
.registered(app) ⇒ Object
.require_adapter ⇒ Object
13
14
15
16
17
18
19
20
21
|
# File 'lib/sinatra/simple-authentication.rb', line 13
def self.require_adapter()
if Object.const_defined?("DataMapper")
require File.join(File.expand_path("..", __FILE__), "simple_authentication/models/datamapper/adapter")
elsif Object.const_defined?("ActiveRecord")
require File.join(File.expand_path("..", __FILE__), "simple_authentication/models/active_record/adapter")
else
throw "Not DataMapper nor ActiveRecord connection detected."
end
end
|