super_exception_notifier 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -50,9 +50,17 @@ changes fit nicely with the enhancements I have already made.
50
50
 
51
51
  This fork of Exception Notifier is in production use on several large websites (top 5000).
52
52
 
53
- == Installation
53
+ == Installation as RubyGem
54
54
 
55
- Gem Using Git building from source:
55
+ Gemcutter is the hot new gem host, and you can use it like this:
56
+
57
+ [sudo] gem install gemcutter
58
+ [sudo] gem tumble # makes gemcutter gem source first in line
59
+ [sudo] gem install super_exception_notifier
60
+
61
+ == Installation as RubyGem from source
62
+
63
+ Use Git to build from source:
56
64
 
57
65
  mkdir -p ~/src
58
66
  cd ~/src
@@ -65,33 +73,53 @@ Then cd to your rails app to optionally freeze the gem into your app:
65
73
 
66
74
  rake gems:freeze GEM=super_exception_notifier
67
75
 
68
- Then in your environment.rb:
76
+ == Installation as Plugin from source:
69
77
 
70
- config.gem 'super_exception_notifier',
71
- :version => '~> 2.0.0',
72
- :lib => "exception_notifier"
78
+ Plugin using Git (let me know if you find any bugs, as I don't ever run it this way.):
73
79
 
80
+ ./script/plugin install git://github.com/pboling/exception_notification.git
74
81
 
75
- Gemcutter is the hot new gem host, and you can use it like this:
76
-
77
- [sudo] gem install gemcutter
78
- [sudo] gem tumble # makes gemcutter gem source first in line
79
- [sudo] gem install super_exception_notifier
82
+ == Config.gem
80
83
 
81
- Then in your environment.rb:
84
+ If installed as a gem, in your environment.rb:
82
85
 
83
86
  config.gem 'super_exception_notifier',
84
87
  :version => '~> 2.0.0',
85
- :lib => "exception_notifier",
86
-
87
- Plugin using Git:
88
+ :lib => "exception_notifier" #The :lib declaration is required!
88
89
 
89
- # Installation as plugin works too! (let me know if you find any bugs, as I don't ever run it this way.)
90
- ./script/plugin install git://github.com/pboling/exception_notification.git
90
+ == Basic Environment Configuration
91
91
 
92
- SVN Plugin (very deprecated, no longer updated, DO NOT USE, install Git!):
92
+ These are settings that are global for SEN wherever it is used in your project.
93
+ You can tweak other values to your liking, as well. In your environment file,
94
+ just set any or all of the following values (defaults are shown):
93
95
 
94
- ./script/plugin install http://super-exception-notifier.googlecode.com/svn/trunk/super_exception_notifier
96
+ ExceptionNotifier.configure_exception_notifier do |config|
97
+ # If left empty web hooks will not be engaged
98
+ config[:web_hooks] = []
99
+ config[:app_name] = "[MYAPP]"
100
+ config[:sender_address] = "super.exception.notifier@example.com"
101
+ config[:exception_recipients] = []
102
+ # Customize the subject line
103
+ config[:subject_prepend] = "[#{(defined?(Rails) ? Rails.env : RAILS_ENV).capitalize} ERROR] "
104
+ config[:subject_append] = nil
105
+ # Include which sections of the exception email?
106
+ config[:sections] = %w(request session environment backtrace)
107
+ # Only use this gem to render, never email
108
+ #defaults to false - meaning by default it sends email. Setting true will cause it to only render the error pages, and NOT email.
109
+ config[:skip_local_notification] = true
110
+ # Example:
111
+ #config[:view_path] = 'app/views/error'
112
+ config[:view_path] = nil
113
+ # Error Notification will be sent if the HTTP response code for the error matches one of the following error codes
114
+ config[:notify_error_codes] = %W( 405 500 503 )
115
+ # Error Notification will be sent if the error class matches one of the following error error classes
116
+ config[:notify_error_classes] = %W( )
117
+ # What should we do for errors not listed?
118
+ config[:notify_other_errors] = true
119
+ # If you set this SEN will
120
+ config[:git_repo_path] = nil
121
+ config[:template_root] = "#{File.dirname(__FILE__)}/../views"
122
+ end
95
123
 
96
124
  == Exceptions Without a Controller
97
125
 
@@ -133,42 +161,6 @@ to generate error emails (typically ApplicationController):
133
161
 
134
162
  4. That's it! The defaults take care of the rest.
135
163
 
136
- == Basic Environment Configuration
137
-
138
- These are settings that are global for SEN wherever it is used in your project.
139
- You can tweak other values to your liking, as well. In your environment file,
140
- just set any or all of the following values (defaults are shown):
141
-
142
- ExceptionNotifier.configure_exception_notifier do |config|
143
- # If left empty web hooks will not be engaged
144
- config[:web_hooks] = []
145
- config[:app_name] = "[MYAPP]"
146
- # NOTE: THERE IS A BUG IN RAILS 2.3.3 which forces us to NOT use anything but a simple email address string for the sender address.
147
- # https://rails.lighthouseapp.com/projects/8994/tickets/2340
148
- config[:sender_address] = %("#{(defined?(Rails) ? Rails.env : RAILS_ENV).capitalize} Error" <super.exception.notifier@example.com>)
149
- config[:exception_recipients] = []
150
- # Customize the subject line
151
- config[:subject_prepend] = "[#{(defined?(Rails) ? Rails.env : RAILS_ENV).capitalize} ERROR] "
152
- config[:subject_append] = nil
153
- # Include which sections of the exception email?
154
- config[:sections] = %w(request session environment backtrace)
155
- # Only use this gem to render, never email
156
- #defaults to false - meaning by default it sends email. Setting true will cause it to only render the error pages, and NOT email.
157
- config[:skip_local_notification] = true
158
- # Example:
159
- #config[:view_path] = 'app/views/error'
160
- config[:view_path] = nil
161
- # Error Notification will be sent if the HTTP response code for the error matches one of the following error codes
162
- config[:notify_error_codes] = %W( 405 500 503 )
163
- # Error Notification will be sent if the error class matches one of the following error error classes
164
- config[:notify_error_classes] = %W( )
165
- # What should we do for errors not listed?
166
- config[:notify_other_errors] = true
167
- # If you set this SEN will
168
- config[:git_repo_path] = nil
169
- config[:template_root] = "#{File.dirname(__FILE__)}/../views"
170
- end
171
-
172
164
  == Basic Controller Configuration
173
165
 
174
166
  In any controller you do this:
@@ -533,6 +525,18 @@ Now you can get notifications from rake tasks! Use 'NotifiedTask.new' instead o
533
525
  puts "I'm a task"
534
526
  end
535
527
 
528
+ == Bugs
529
+
530
+ # NOTE: Some people (myself included) experience a bug in rails versions > 2.3.3
531
+ # which forces us to use a simple email address string for the sender address.
532
+ # https://rails.lighthouseapp.com/projects/8994/tickets/2340
533
+ config[:sender_address] = "super.exception.notifier@example.com"
534
+
535
+ == History
536
+
537
+ The old, crusty , buggy, original verison of the plugin:
538
+ http://super-exception-notifier.googlecode.com
539
+
536
540
  == Copyright
537
541
 
538
542
  Copyright (c) 2008-9 Peter H. Boling, released under the MIT license
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 4
3
2
  :major: 2
4
3
  :minor: 0
4
+ :patch: 5
5
5
  :build:
@@ -56,11 +56,11 @@ module SuperExceptionNotifier
56
56
  end
57
57
 
58
58
  def should_email_on_exception?(exception, status_cd = nil, verbose = false)
59
- notification_level_sends_email? && !ExceptionNotifier.config[:exception_recipients].empty? && should_notify_on_exception?(exception, status_cd, verbose)
59
+ notification_level_sends_email? && !ExceptionNotifier.config[:exception_recipients].blank? && should_notify_on_exception?(exception, status_cd, verbose)
60
60
  end
61
61
 
62
62
  def should_web_hook_on_exception?(exception, status_cd = nil, verbose = false)
63
- notification_level_sends_web_hooks? && !ExceptionNotifier.config[:web_hooks].empty? && should_notify_on_exception?(exception, status_cd, verbose)
63
+ notification_level_sends_web_hooks? && !ExceptionNotifier.config[:web_hooks].blank? && should_notify_on_exception?(exception, status_cd, verbose)
64
64
  end
65
65
 
66
66
  # Relies on the base class to define be_silent_for_exception?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_exception_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2009-11-05 00:00:00 -05:00
16
+ date: 2009-12-30 00:00:00 -05:00
17
17
  default_executable:
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency