Class: Lilypad
- Inherits:
-
Object
show all
- Defined in:
- lib/lilypad.rb,
lib/lilypad/log.rb,
lib/lilypad/config.rb,
lib/lilypad/hoptoad/xml.rb,
lib/lilypad/adapters/rails.rb,
lib/lilypad/config/request.rb,
lib/lilypad/hoptoad/deploy.rb,
lib/lilypad/hoptoad/notify.rb,
lib/lilypad/adapters/sinatra.rb
Defined Under Namespace
Modules: Rails, Sinatra
Classes: Config, Hoptoad, Log
Class Method Summary
collapse
Class Method Details
.active? ⇒ Boolean
7
8
9
|
# File 'lib/lilypad.rb', line 7
def active?
Config.api_key
end
|
.config(api_key = nil, &block) ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/lilypad.rb', line 11
def config(api_key=nil, &block)
if api_key
Config.api_key api_key
end
if block_given?
Config.class_eval &block
end
end
|
.deploy(options) ⇒ Object
20
21
22
23
24
|
# File 'lib/lilypad.rb', line 20
def deploy(options)
if active? && production?
Hoptoad::Deploy.new options
end
end
|
.notify(exception, env = nil) ⇒ Object
26
27
28
29
30
|
# File 'lib/lilypad.rb', line 26
def notify(exception, env=nil)
if active? && production?
Hoptoad::Notify.new env, exception
end
end
|
.production? ⇒ Boolean
32
33
34
|
# File 'lib/lilypad.rb', line 32
def production?
Config.environments.include? ENV['RACK_ENV']
end
|