Module: Auth
- Defined in:
- lib/auth.rb,
lib/auth/engine.rb,
lib/auth/behavior/core.rb,
lib/auth/configuration.rb,
lib/auth/configuration/keys.rb,
lib/auth/behavior/remember_me.rb
Defined Under Namespace
Modules: Behavior, BehaviorLookup
Classes: Configuration, Engine, Model, Observer, TargetList, Token
Class Method Summary
collapse
Class Method Details
.configuration ⇒ Object
14
15
16
|
# File 'lib/auth.rb', line 14
def configuration
@configuration ||= Auth::Configuration.new
end
|
18
19
20
|
# File 'lib/auth.rb', line 18
def configure
yield configuration
end
|
Applies all configuration settings. This is done by the Auth system after it has been configured but before it processes any requests.
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/auth.rb', line 40
def configure!
begin
configuration.apply!
rescue NameError
puts
puts "WARNING: #{$!.message}"
puts
puts "This happened while trying to configure Sparkly Authentication."
puts "You should verify that /config/initializers/sparkly_authentication.rb"
puts "is set up properly. It could be that you just haven't created the"
puts "model yet. If so, this error will disappear when the model exists."
puts
if ENV['AUTH_BACKTRACE']
puts $!.backtrace
else
puts "(Run with AUTH_BACKTRACE=true to see a full bactrace.)"
end
puts
end
end
|
.defer_kickstart=(a) ⇒ Object
26
27
28
|
# File 'lib/auth.rb', line 26
def defer_kickstart=(a)
@defer_kickstart = !!a
end
|
.defer_kickstart? ⇒ Boolean
22
23
24
|
# File 'lib/auth.rb', line 22
def defer_kickstart?
@defer_kickstart ||= !!ENV['DEFER_SPARKLY']
end
|
.path ⇒ Object
30
31
32
33
34
35
36
|
# File 'lib/auth.rb', line 30
def path
if @configuration
@configuration.path
else
File.dirname(__FILE__)
end
end
|
.reset_configuration! ⇒ Object
Useful for cleaning up after tests, but probably not much else.
62
63
64
|
# File 'lib/auth.rb', line 62
def reset_configuration!
@configuration = Auth::Configuration.new
end
|