exception_handling 1.2.1 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -1
  3. data/Gemfile +17 -0
  4. data/Gemfile.lock +142 -102
  5. data/README.md +11 -2
  6. data/config/exception_filters.yml +2 -0
  7. data/exception_handling.gemspec +6 -10
  8. data/lib/exception_handling.rb +222 -313
  9. data/lib/exception_handling/exception_catalog.rb +8 -6
  10. data/lib/exception_handling/exception_description.rb +8 -6
  11. data/lib/exception_handling/exception_info.rb +272 -0
  12. data/lib/exception_handling/honeybadger_callbacks.rb +42 -0
  13. data/lib/exception_handling/log_stub_error.rb +18 -3
  14. data/lib/exception_handling/mailer.rb +14 -0
  15. data/lib/exception_handling/methods.rb +26 -8
  16. data/lib/exception_handling/testing.rb +2 -2
  17. data/lib/exception_handling/version.rb +3 -1
  18. data/test/helpers/controller_helpers.rb +27 -0
  19. data/test/helpers/exception_helpers.rb +11 -0
  20. data/test/test_helper.rb +42 -19
  21. data/test/unit/exception_handling/exception_catalog_test.rb +19 -0
  22. data/test/unit/exception_handling/exception_description_test.rb +12 -1
  23. data/test/unit/exception_handling/exception_info_test.rb +501 -0
  24. data/test/unit/exception_handling/honeybadger_callbacks_test.rb +85 -0
  25. data/test/unit/exception_handling/log_error_stub_test.rb +26 -3
  26. data/test/unit/exception_handling/mailer_test.rb +39 -14
  27. data/test/unit/exception_handling/methods_test.rb +40 -18
  28. data/test/unit/exception_handling_test.rb +947 -539
  29. data/views/exception_handling/mailer/escalate_custom.html.erb +17 -0
  30. data/views/exception_handling/mailer/exception_notification.html.erb +1 -1
  31. data/views/exception_handling/mailer/log_parser_exception_notification.html.erb +1 -1
  32. metadata +28 -60
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <title>Exception Escalation</title>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7
+ </head>
8
+ <body>
9
+ <h3><%=h @summary %></h3>
10
+ <b>Error #:</b> <%= h(@cleaned_data[:timestamp]).presence || '<i>no error #</i>'.html_safe -%><br />
11
+ <b>Exception:</b> <%= h(@cleaned_data[:error_string]).gsub("\n","<br/>\n").gsub(/ {2,}/) { |spaces| '&nbsp;'*spaces.size }.html_safe %><br />
12
+ <b>Server:</b> <%= h(@server).presence || '<i>hostname not set</i>'.html_safe -%><br />
13
+ <% if @cleaned_data[:scm_revision] %>
14
+ <b>Revision:</b> <%= @cleaned_data[:scm_revision] %><br />
15
+ <% end %>
16
+ </body>
17
+ </html>
@@ -64,7 +64,7 @@
64
64
  <%= "#{ h location[:controller]}##{ h location[:action]}<br />".html_safe if location && location[:controller] -%>
65
65
  <%= "#{ h location[:file]}, line #{ h location[:line]}<br />".html_safe if location && location[:file] -%>
66
66
 
67
- <% for section in ExceptionHandling::SECTIONS %>
67
+ <% for section in ExceptionHandling::ExceptionInfo::SECTIONS %>
68
68
  <% section_value = @cleaned_data[section] %>
69
69
  <% if section_value %>
70
70
  <h3><%= section.to_s.capitalize -%>:</h3>
@@ -58,7 +58,7 @@
58
58
 
59
59
 
60
60
 
61
- <% for section in ExceptionHandling::SECTIONS %>
61
+ <% for section in ExceptionHandling::ExceptionInfo::SECTIONS %>
62
62
  <% section_value = @cleaned_data[section] %>
63
63
  <% if section_value %>
64
64
  <h3><%= section.to_s.capitalize -%>:</h3>
metadata CHANGED
@@ -1,85 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_handling
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Kelley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-25 00:00:00.000000000 Z
11
+ date: 2019-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.12.10
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.12.10
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.2'
33
+ version: '4.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.2'
40
+ version: '4.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: actionpack
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.2'
47
+ version: '4.2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.2'
54
+ version: '4.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: actionmailer
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.2'
61
+ version: '4.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.2'
68
+ version: '4.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: invoca-utils
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.0.2
75
+ version: '0.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.0.2
82
+ version: '0.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: hobo_support
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -95,55 +95,13 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rake
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0.9'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0.9'
111
- - !ruby/object:Gem::Dependency
112
- name: shoulda
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - '='
116
- - !ruby/object:Gem::Version
117
- version: 3.1.1
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - '='
123
- - !ruby/object:Gem::Version
124
- version: 3.1.1
125
- - !ruby/object:Gem::Dependency
126
- name: rr
98
+ name: contextual_logger
127
99
  requirement: !ruby/object:Gem::Requirement
128
100
  requirements:
129
101
  - - ">="
130
102
  - !ruby/object:Gem::Version
131
103
  version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: pry
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
104
+ type: :runtime
147
105
  prerelease: false
148
106
  version_requirements: !ruby/object:Gem::Requirement
149
107
  requirements:
@@ -169,6 +127,8 @@ files:
169
127
  - lib/exception_handling.rb
170
128
  - lib/exception_handling/exception_catalog.rb
171
129
  - lib/exception_handling/exception_description.rb
130
+ - lib/exception_handling/exception_info.rb
131
+ - lib/exception_handling/honeybadger_callbacks.rb
172
132
  - lib/exception_handling/log_stub_error.rb
173
133
  - lib/exception_handling/mailer.rb
174
134
  - lib/exception_handling/methods.rb
@@ -176,14 +136,19 @@ files:
176
136
  - lib/exception_handling/testing.rb
177
137
  - lib/exception_handling/version.rb
178
138
  - semaphore_ci/setup.sh
139
+ - test/helpers/controller_helpers.rb
140
+ - test/helpers/exception_helpers.rb
179
141
  - test/test_helper.rb
180
142
  - test/unit/exception_handling/exception_catalog_test.rb
181
143
  - test/unit/exception_handling/exception_description_test.rb
144
+ - test/unit/exception_handling/exception_info_test.rb
145
+ - test/unit/exception_handling/honeybadger_callbacks_test.rb
182
146
  - test/unit/exception_handling/log_error_stub_test.rb
183
147
  - test/unit/exception_handling/mailer_test.rb
184
148
  - test/unit/exception_handling/methods_test.rb
185
149
  - test/unit/exception_handling/sensu_test.rb
186
150
  - test/unit/exception_handling_test.rb
151
+ - views/exception_handling/mailer/escalate_custom.html.erb
187
152
  - views/exception_handling/mailer/escalation_notification.html.erb
188
153
  - views/exception_handling/mailer/exception_notification.html.erb
189
154
  - views/exception_handling/mailer/log_parser_exception_notification.html.erb
@@ -206,18 +171,21 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
171
  version: '0'
207
172
  requirements: []
208
173
  rubyforge_project:
209
- rubygems_version: 2.2.2
174
+ rubygems_version: 2.7.6
210
175
  signing_key:
211
176
  specification_version: 4
212
177
  summary: Invoca's exception handling logger/emailer layer, based on exception_notifier.
213
178
  Works with Rails or EventMachine or EventMachine+Synchrony.
214
179
  test_files:
180
+ - test/helpers/controller_helpers.rb
181
+ - test/helpers/exception_helpers.rb
215
182
  - test/test_helper.rb
216
183
  - test/unit/exception_handling/exception_catalog_test.rb
217
184
  - test/unit/exception_handling/exception_description_test.rb
185
+ - test/unit/exception_handling/exception_info_test.rb
186
+ - test/unit/exception_handling/honeybadger_callbacks_test.rb
218
187
  - test/unit/exception_handling/log_error_stub_test.rb
219
188
  - test/unit/exception_handling/mailer_test.rb
220
189
  - test/unit/exception_handling/methods_test.rb
221
190
  - test/unit/exception_handling/sensu_test.rb
222
191
  - test/unit/exception_handling_test.rb
223
- has_rdoc: