Class: RedAlert::Rack::Notifier

Inherits:
Object
  • Object
show all
Includes:
Notifier
Defined in:
lib/red_alert/rack/notifier.rb

Instance Method Summary collapse

Methods included from Notifier

#alert, included, #notifier_settings

Instance Method Details

#filter_keysObject



6
7
8
# File 'lib/red_alert/rack/notifier.rb', line 6

def filter_keys
  RACK_DEFAULT_FILTERS + PARAMS_DEFAULT_FILTERS
end

#templateObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/red_alert/rack/notifier.rb', line 11

def template
<<-EMAIL
A <%= exception.class %> occured: <%= exception %>
<% if data[:request] %>

===================================================================
Request Body:
===================================================================

<%= data[:request].gsub(/^/, '  ') %>
<% end %>

===================================================================
Rack Environment:
===================================================================

  PID:                     <%= $$ %>
  PWD:                     <%= Dir.getwd %>

  <%= data[:env].to_a.
    sort{|a,b| a.first <=> b.first}.
    map{ |k,v| "%-25s%p" % [k+':', v] }.
    join("\n  ") %>

<% if exception.respond_to?(:backtrace) %>
===================================================================
Backtrace:
===================================================================

  <%= exception.backtrace.join("\n  ") %>
<% end %>
EMAIL
end