Module: Entrance
- Defined in:
- lib/entrance/addons/sinatra.rb,
lib/entrance.rb,
lib/entrance/model.rb,
lib/entrance/config.rb,
lib/entrance/fields.rb,
lib/entrance/ciphers.rb,
lib/entrance/version.rb,
lib/entrance/controller.rb,
lib/entrance/addons/omniauth.rb
Overview
require ‘sinatra/base’ require ‘omniauth-twitter’ require ‘entrance/addons/omniauth’
class Hello < Sinatra::Base
register Entrance::OmniAuth
set :sessions, true
set :auth_test, false set :auth_remember, true set :auth_redirect, '/' set :auth_providers, {
:twitter => {
:key => 'foobar'
}
}
end
Defined Under Namespace
Modules: Ciphers, Controller, Model, OmniAuth, Sinatra
Classes: Config, Fields
Constant Summary
collapse
- MAJOR =
0
- MINOR =
6
- PATCH =
0
- VERSION =
[MAJOR, MINOR, PATCH].join('.')
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
10
11
12
|
# File 'lib/entrance.rb', line 10
def self.config
@config ||= Config.new
end
|
22
23
24
25
|
# File 'lib/entrance.rb', line 22
def self.configure
yield config
config.validate!
end
|
.fields ⇒ Object
18
19
20
|
# File 'lib/entrance.rb', line 18
def self.fields
@fields ||= Fields.new
end
|
.generate_token(length = 40) ⇒ Object
27
28
29
30
|
# File 'lib/entrance.rb', line 27
def self.generate_token(length = 40)
str = Digest::SHA1.hexdigest([Time.now, rand].join)
str[0..(length-1)]
end
|
.model ⇒ Object
14
15
16
|
# File 'lib/entrance.rb', line 14
def self.model
@model ||= get_class(config.model)
end
|