wrangler 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -2
- data/lib/wrangler/exception_handler.rb +4 -2
- data/lib/wrangler/wrangler_helper.rb +7 -1
- data/rails/app/views/wrangler/404.html +1 -0
- data/rails/app/views/wrangler/500.html +1 -0
- data/wrangler.gemspec +6 -4
- metadata +6 -4
data/README
CHANGED
@@ -27,6 +27,8 @@ emailing application state at the time of the exception
|
|
27
27
|
* Allows email notification on exceptions thrown totally outside Controller
|
28
28
|
context, e.g. in a script run (with rails environment) in a cronjob or
|
29
29
|
delayed_job
|
30
|
+
* See TODO for things that are explicitly not included yet, but that could/
|
31
|
+
should be added
|
30
32
|
|
31
33
|
== Quickstart
|
32
34
|
=== Bare Minimum
|
@@ -48,8 +50,8 @@ new initializer file (create a wrangler.rb (or whatever you want to name the fil
|
|
48
50
|
in RAILS_ROOT/config/initializers/wrangler.rb). In it, add the following:
|
49
51
|
|
50
52
|
Wrangler::ExceptionNotifier.configure do |notifier_config|
|
51
|
-
notifier_config.merge! :from_address => '
|
52
|
-
:recipient_addresses => ['
|
53
|
+
notifier_config.merge! :from_address => 'notifer@example.com',
|
54
|
+
:recipient_addresses => ['ops-team@example.com']
|
53
55
|
end
|
54
56
|
|
55
57
|
And, if you haven't already configured ActionMailer to send emails, you'll need
|
@@ -58,8 +58,8 @@ module Wrangler
|
|
58
58
|
# configure whether to send emails synchronously or asynchronously
|
59
59
|
# using delayed_job (these can be true even if delayed job is not
|
60
60
|
# installed, in which case, will just send emails synchronously anyway)
|
61
|
-
:delayed_job_for_controller_errors =>
|
62
|
-
:delayed_job_for_non_controller_errors =>
|
61
|
+
:delayed_job_for_controller_errors => true,
|
62
|
+
:delayed_job_for_non_controller_errors => true,
|
63
63
|
# mappings from exception classes to http status codes (see above)
|
64
64
|
# add/remove from this list as desired in environment configuration
|
65
65
|
:error_class_status_codes => Wrangler::codes_for_exception_classes,
|
@@ -92,6 +92,8 @@ module Wrangler
|
|
92
92
|
# regexp-style
|
93
93
|
|
94
94
|
# just DON'T change this! this is the error template of last resort!
|
95
|
+
# if you do change this, you really should have a good reason for it and
|
96
|
+
# really know what you're doing. really.
|
95
97
|
:absolute_last_resort_default_error_template =>
|
96
98
|
File.join(WRANGLER_ROOT,'rails','app','views','wrangler','500.html')
|
97
99
|
}
|
@@ -2,7 +2,13 @@ module Wrangler
|
|
2
2
|
WRANGLER_ROOT = "#{File.dirname(__FILE__)}/../.."
|
3
3
|
|
4
4
|
# make all of these instance methods act as module functions as well
|
5
|
-
# (any instance method below this gets added as a module function as well)
|
5
|
+
# (any instance method below this gets added as a module function as well),
|
6
|
+
# so that they can be used from within an instance of a class that includes
|
7
|
+
# this module, or by calling methods on the module itself. this allows for
|
8
|
+
# more 'procedural' or script code to use the notification logic without
|
9
|
+
# forcing the creating of a class (and instantiation thereof) that includes
|
10
|
+
# this module.
|
11
|
+
# http://ruby-doc.org/core/classes/Module.html#M001642
|
6
12
|
module_function
|
7
13
|
|
8
14
|
# utility to determine if a class has another class as its ancestor.
|
data/wrangler.gemspec
CHANGED
@@ -5,18 +5,20 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{wrangler}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian Percival"]
|
12
|
-
s.date = %q{2009-11-
|
12
|
+
s.date = %q{2009-11-16}
|
13
13
|
s.description = %q{A gem for handling exceptions thrown inside your Rails app. If you include the
|
14
|
-
gem in your application controller,
|
14
|
+
gem in your application controller, wrangler will render the error pages you
|
15
15
|
configure for each exception or HTTP error code. It will also handle notifying
|
16
16
|
you via email when certain exceptions are raised. Allows for configuration of
|
17
17
|
which exceptions map to which error pages, which exceptions result in emails
|
18
18
|
being sent. Also allows for asynchronous email sending via delayed job so that
|
19
|
-
error pages don't take forever to load
|
19
|
+
error pages don't take forever to load (but delayed_job is not required for
|
20
|
+
sending email; wrangler will automatically send email synchronously if
|
21
|
+
delayed_job is not available. . See README for lots of info on how to
|
20
22
|
get started and what configuration options are available.
|
21
23
|
}
|
22
24
|
s.email = %q{percivalatumamibuddotcom}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wrangler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Percival
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-16 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -24,12 +24,14 @@ dependencies:
|
|
24
24
|
version:
|
25
25
|
description: |
|
26
26
|
A gem for handling exceptions thrown inside your Rails app. If you include the
|
27
|
-
gem in your application controller,
|
27
|
+
gem in your application controller, wrangler will render the error pages you
|
28
28
|
configure for each exception or HTTP error code. It will also handle notifying
|
29
29
|
you via email when certain exceptions are raised. Allows for configuration of
|
30
30
|
which exceptions map to which error pages, which exceptions result in emails
|
31
31
|
being sent. Also allows for asynchronous email sending via delayed job so that
|
32
|
-
error pages don't take forever to load
|
32
|
+
error pages don't take forever to load (but delayed_job is not required for
|
33
|
+
sending email; wrangler will automatically send email synchronously if
|
34
|
+
delayed_job is not available. . See README for lots of info on how to
|
33
35
|
get started and what configuration options are available.
|
34
36
|
|
35
37
|
email: percivalatumamibuddotcom
|