pboling-super_exception_notifier 1.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. data/MIT-LICENSE +21 -0
  2. data/README.rdoc +419 -0
  3. data/VERSION.yml +4 -0
  4. data/exception_notification.gemspec +71 -0
  5. data/init.rb +1 -0
  6. data/lib/exception_notifiable.rb +278 -0
  7. data/lib/exception_notifier.rb +108 -0
  8. data/lib/exception_notifier_helper.rb +58 -0
  9. data/lib/hooks_notifier.rb +53 -0
  10. data/lib/notifiable.rb +8 -0
  11. data/lib/super_exception_notifier/custom_exception_classes.rb +16 -0
  12. data/lib/super_exception_notifier/custom_exception_methods.rb +50 -0
  13. data/rails/app/views/exception_notifiable/400.html +5 -0
  14. data/rails/app/views/exception_notifiable/403.html +6 -0
  15. data/rails/app/views/exception_notifiable/404.html +6 -0
  16. data/rails/app/views/exception_notifiable/405.html +6 -0
  17. data/rails/app/views/exception_notifiable/410.html +7 -0
  18. data/rails/app/views/exception_notifiable/418.html +6 -0
  19. data/rails/app/views/exception_notifiable/422.html +5 -0
  20. data/rails/app/views/exception_notifiable/423.html +6 -0
  21. data/rails/app/views/exception_notifiable/501.html +8 -0
  22. data/rails/app/views/exception_notifiable/503.html +6 -0
  23. data/rails/init.rb +18 -0
  24. data/test/exception_notifier_helper_test.rb +76 -0
  25. data/test/exception_notify_functional_test.rb +102 -0
  26. data/test/mocks/404.html +1 -0
  27. data/test/mocks/500.html +1 -0
  28. data/test/mocks/controllers.rb +46 -0
  29. data/test/test_helper.rb +28 -0
  30. data/views/exception_notifier/_backtrace.html.erb +1 -0
  31. data/views/exception_notifier/_environment.html.erb +14 -0
  32. data/views/exception_notifier/_inspect_model.html.erb +16 -0
  33. data/views/exception_notifier/_request.html.erb +8 -0
  34. data/views/exception_notifier/_session.html.erb +7 -0
  35. data/views/exception_notifier/_title.html.erb +3 -0
  36. data/views/exception_notifier/background_exception_notification.text.plain.erb +6 -0
  37. data/views/exception_notifier/exception_notification.text.plain.erb +10 -0
  38. metadata +100 -0
@@ -0,0 +1,28 @@
1
+ require 'test/unit'
2
+ require 'rubygems'
3
+
4
+ require 'active_support'
5
+
6
+ require 'active_record'
7
+
8
+ #just requiring active record wasn't loading classes soon enough for SILENT_EXCEPTIONS
9
+ ActiveRecord::Base
10
+
11
+ require 'action_controller'
12
+ require 'action_controller/test_case'
13
+ require 'action_controller/test_process'
14
+
15
+ #just requiring action controller wasn't loading classes soon enough for SILENT_EXCEPTIONS
16
+ ActionController::Base
17
+
18
+ RAILS_ROOT = '.' unless defined?(RAILS_ROOT)
19
+ RAILS_ENV = 'test'
20
+
21
+ require File.join(File.dirname(__FILE__), "..", "init")
22
+
23
+ ExceptionNotifier.configure_exception_notifier do |config|
24
+ # If left empty web hooks will not be engaged
25
+ config[:web_hooks] = []
26
+ config[:exception_recipients] = ["test.errors@example.com"]
27
+ config[:view_path] = File.join(File.dirname(__FILE__), "mocks")
28
+ end
@@ -0,0 +1 @@
1
+ <%= @backtrace.join "\n" %>
@@ -0,0 +1,14 @@
1
+ <% if @request -%>
2
+ <% max = @request.env.keys.max { |a,b| a.length <=> b.length } -%>
3
+ <% @request.env.keys.sort.each do |key| -%>
4
+ * <%= "%-*s: %s" % [max.length, key, filter_sensitive_post_data_from_env(key, @request.env[key].to_s.strip)] %>
5
+ <% end -%>
6
+ <% end -%>
7
+ <% if @data -%>
8
+ <% @data.each do |key, value| -%>
9
+ * <%= key %>: <%= value %>
10
+ <% end -%>
11
+ <% end -%>
12
+
13
+ * Process: <%= $$ %>
14
+ * Server : <%= `hostname -s`.chomp %>
@@ -0,0 +1,16 @@
1
+ <% if show_attributes -%>
2
+ [attributes]
3
+ <% attrs = inspect_model.attributes -%>
4
+ <% max = attrs.keys.max { |a,b| a.length <=> b.length } -%>
5
+ <% attrs.keys.sort.each do |attr| -%>
6
+ * <%= "%*-s: %s" % [max.length, attr, object_to_yaml(attrs[attr]).gsub(/\n/, "\n ").strip] %>
7
+ <% end -%>
8
+ <% end -%>
9
+
10
+ <% if show_instance_variables -%>
11
+ [instance variables]
12
+ <% inspect_model.instance_variables.sort.each do |variable| -%>
13
+ <%- next if variable == "@attributes" -%>
14
+ * <%= variable %>: <%= inspect_value(inspect_model.instance_variable_get(variable)) %>
15
+ <% end -%>
16
+ <% end -%>
@@ -0,0 +1,8 @@
1
+ <% if @request -%>
2
+ * URL : <%= @request.protocol %><%= @host %><%= @request.request_uri %>
3
+ * Method : <%= @request.method.to_s.upcase %>
4
+ * IP address: <%= @request.env['HTTP_X_REAL_IP'] ||@request.env["HTTP_X_FORWARDED_FOR"] || @request.env["REMOTE_ADDR"] %>
5
+ * Parameters: <%= filter_sensitive_post_data_parameters(@request.parameters).inspect %>
6
+ <% end -%>
7
+ * Rails root: <%= @rails_root %>
8
+
@@ -0,0 +1,7 @@
1
+ <% if ExceptionNotifierHelper::COMPAT_MODE -%>
2
+ * session id: <%= @request.session.instance_variable_get(:@session_id).inspect %>
3
+ * data: <%= PP.pp(@request.session.instance_variable_get(:@data),"").gsub(/\n/, "\n ").strip %>
4
+ <%else -%>
5
+ * session id: <%= @request.session_options[:id] %>
6
+ * data: <%= PP.pp(@request.session.data, "").gsub(/\n/, "\n ").strip %>
7
+ <% end -%>
@@ -0,0 +1,3 @@
1
+ -------------------------------
2
+ <%= title.to_s.humanize %>:
3
+ -------------------------------
@@ -0,0 +1,6 @@
1
+ A <%= @exception.class %> occurred:
2
+
3
+ <%= @exception.message %>
4
+ <%= @backtrace.first %>
5
+
6
+ <%= @sections.map { |section| render_section(section) }.join %>
@@ -0,0 +1,10 @@
1
+ <% unless @request.nil? -%>
2
+ <%= @request.protocol %><%= @host %><%= @request.request_uri %>
3
+ <% end -%>
4
+ A <%= @exception.class %> occurred in <%= @location %>:
5
+ <%= @exception.message %>
6
+ <%= @backtrace.first %>
7
+ <% unless @the_blamed.nil? || @the_blamed[:author].nil? %>
8
+ Git Blame: '<%=@the_blamed[:author]%>' last modified line #<%=@the_blamed[:line]%> in <%=@the_blamed[:file]%>
9
+ <% end%>
10
+ <%= @sections.map { |section| render_section(section) }.join %>
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pboling-super_exception_notifier
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.6.5
5
+ platform: ruby
6
+ authors:
7
+ - Peter Boling
8
+ - Jacques Crocker
9
+ - Jamis Buck
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+
14
+ date: 2009-08-12 00:00:00 -07:00
15
+ default_executable:
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: rails
19
+ type: :runtime
20
+ version_requirement:
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: "2.1"
26
+ version:
27
+ description: "Allows customization of: * the sender address of the email * the recipient addresses * the text used to prefix the subject line * the HTTP status codes to send emails for * the error classes to send emails for * alternatively, the error classes to not send emails for * whether to send error emails or just render without sending anything * the HTTP status and status code that gets rendered with specific errors * the view path to the error page templates * custom errors, with custom error templates * define error layouts at application or controller level, or use the controller's own default layout, or no layout at all * get error notification for errors that occur in the console, using notifiable method * Override the gem's handling and rendering with explicit rescue statements inline."
28
+ email: peter.boling@gmail.com
29
+ executables: []
30
+
31
+ extensions: []
32
+
33
+ extra_rdoc_files: []
34
+
35
+ files:
36
+ - MIT-LICENSE
37
+ - README.rdoc
38
+ - exception_notification.gemspec
39
+ - init.rb
40
+ - lib/super_exception_notifier/custom_exception_classes.rb
41
+ - lib/super_exception_notifier/custom_exception_methods.rb
42
+ - lib/exception_notifiable.rb
43
+ - lib/exception_notifier.rb
44
+ - lib/hooks_notifier.rb
45
+ - lib/exception_notifier_helper.rb
46
+ - lib/notifiable.rb
47
+ - rails/init.rb
48
+ - rails/app/views/exception_notifiable/400.html
49
+ - rails/app/views/exception_notifiable/403.html
50
+ - rails/app/views/exception_notifiable/404.html
51
+ - rails/app/views/exception_notifiable/405.html
52
+ - rails/app/views/exception_notifiable/410.html
53
+ - rails/app/views/exception_notifiable/418.html
54
+ - rails/app/views/exception_notifiable/422.html
55
+ - rails/app/views/exception_notifiable/423.html
56
+ - rails/app/views/exception_notifiable/501.html
57
+ - rails/app/views/exception_notifiable/503.html
58
+ - views/exception_notifier/_backtrace.html.erb
59
+ - views/exception_notifier/_environment.html.erb
60
+ - views/exception_notifier/_inspect_model.html.erb
61
+ - views/exception_notifier/_request.html.erb
62
+ - views/exception_notifier/_session.html.erb
63
+ - views/exception_notifier/_title.html.erb
64
+ - views/exception_notifier/background_exception_notification.text.plain.erb
65
+ - views/exception_notifier/exception_notification.text.plain.erb
66
+ - VERSION.yml
67
+ has_rdoc: true
68
+ homepage: http://github.com/pboling/exception_notification
69
+ licenses:
70
+ post_install_message:
71
+ rdoc_options: []
72
+
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ version:
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: "0"
86
+ version:
87
+ requirements: []
88
+
89
+ rubyforge_project:
90
+ rubygems_version: 1.3.5
91
+ signing_key:
92
+ specification_version: 2
93
+ summary: Allows unhandled (and handled!) exceptions to be captured and sent via email
94
+ test_files:
95
+ - test/exception_notifier_helper_test.rb
96
+ - test/exception_notify_functional_test.rb
97
+ - test/test_helper.rb
98
+ - test/mocks/404.html
99
+ - test/mocks/500.html
100
+ - test/mocks/controllers.rb