rackamole 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rackamole.rb +1 -1
- data/lib/rackamole/alert/emole.rb +11 -7
- metadata +1 -1
data/lib/rackamole.rb
CHANGED
@@ -8,10 +8,10 @@ module Rackamole::Alert
|
|
8
8
|
def self.template_root() @template_root ||= File.join( File.dirname(__FILE__), %w[templates] ); end
|
9
9
|
|
10
10
|
# Send an email notification for particular moled feature. An email will
|
11
|
-
# be sent based on the
|
12
|
-
# Rack::Mole component.
|
13
|
-
# that will trigger the email
|
14
|
-
# moled features to track via email. The notification will be sent via
|
11
|
+
# be sent based on the configuration :email defined on the
|
12
|
+
# Rack::Mole component. This option must specify the to and from addresses and the conditions
|
13
|
+
# that will trigger the email defined by alert_on for the type of
|
14
|
+
# moled features to track via email. The notification will be sent via Mail,
|
15
15
|
# so you will need to make sure it is properly configured for your domain.
|
16
16
|
# NOTE: This is just a notification mechanism. All moled event will be either logged
|
17
17
|
# or persisted in the db regardless.
|
@@ -75,11 +75,15 @@ module Rackamole::Alert
|
|
75
75
|
|
76
76
|
# Format args and spit out into buffer
|
77
77
|
def self.spew( key, silent=false )
|
78
|
-
buff
|
78
|
+
buff = []
|
79
|
+
value = args[key]
|
80
|
+
|
81
|
+
value = request_time?( args ) if key == :request_time
|
79
82
|
|
80
|
-
_spew( buff, '--', (silent ? '' : ' '), key,
|
83
|
+
_spew( buff, '--', (silent ? '' : ' '), key, value, silent )
|
81
84
|
buff.join( "\n" )
|
82
85
|
end
|
86
|
+
|
83
87
|
def self._spew( buff, sep, indent, key, value, silent )
|
84
88
|
if value.is_a?( Hash )
|
85
89
|
buff << "#{indent}#{humanize( key )}:" unless silent
|
@@ -114,7 +118,7 @@ module Rackamole::Alert
|
|
114
118
|
|
115
119
|
# Dump request time if any...
|
116
120
|
def self.request_time?( args )
|
117
|
-
args[:
|
121
|
+
args[:request_time] ? ("%5.2f " % args[:request_time] ) : ''
|
118
122
|
end
|
119
123
|
|
120
124
|
# Identify the type of alert...
|