errdo 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/errdo/exception.rb +14 -2
- data/lib/errdo/version.rb +1 -1
- data/lib/errdo.rb +3 -0
- data/lib/generators/templates/errdo.rb +7 -2
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +38 -0
- data/test/dummy/log/test.log +44421 -0
- data/test/dummy/tmp/pids/server.pid +1 -1
- data/test/integrations/errors_integration_test.rb +11 -0
- data/test/test_helper.rb +8 -0
- data/test/tmp/config/initializers/errdo.rb +7 -51
- metadata +2 -4
- data/test/tmp/config/application.rb +0 -4
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
4587
|
@@ -105,6 +105,17 @@ class ErrorsIntegrationTest < ActionDispatch::IntegrationTest
|
|
105
105
|
get "/not-a-path"
|
106
106
|
end
|
107
107
|
end
|
108
|
+
|
109
|
+
should "not notify when the ignore_time is set and the last error occurrence is within that time" do
|
110
|
+
get static_generic_error_path
|
111
|
+
|
112
|
+
Errdo.notify_with slack: { webhook: "https://slack.com/test" }
|
113
|
+
Errdo.ignore_time = 5.minutes
|
114
|
+
|
115
|
+
stub_request :any, /.*slack.*/
|
116
|
+
get static_generic_error_path
|
117
|
+
assert_not_requested :any, /.*slack.*/
|
118
|
+
end
|
108
119
|
end
|
109
120
|
|
110
121
|
private
|
data/test/test_helper.rb
CHANGED
@@ -42,6 +42,10 @@ class ActionDispatch::IntegrationTest
|
|
42
42
|
Errdo.authorize_with { true }
|
43
43
|
end
|
44
44
|
|
45
|
+
teardown do
|
46
|
+
Errdo.instance_variable_set(:@notifiers, [])
|
47
|
+
end
|
48
|
+
|
45
49
|
end
|
46
50
|
|
47
51
|
class ActionController::TestCase
|
@@ -50,4 +54,8 @@ class ActionController::TestCase
|
|
50
54
|
Errdo.authorize_with { true }
|
51
55
|
end
|
52
56
|
|
57
|
+
teardown do
|
58
|
+
Errdo.instance_variable_set(:@notifiers, [])
|
59
|
+
end
|
60
|
+
|
53
61
|
end
|
@@ -1,56 +1,12 @@
|
|
1
1
|
Errdo.setup do |config|
|
2
|
-
# Add words to be scrubbed from the params here. By default, this is
|
3
|
-
# %w(password passwd password_confirmation secret confirm_password secret_token)
|
4
|
-
# So make sure you add on, not replace!
|
5
|
-
# config.dirty_words += ["custom_param"]
|
6
2
|
|
7
|
-
#
|
8
|
-
#
|
9
|
-
|
10
|
-
## == Authorization and Devise integration =========
|
11
|
-
# If you have the ability to track who's logged in, setting the current_user_method
|
12
|
-
# will allow the logged-in user to be recorded with the error
|
13
|
-
# config.current_user_method = :current_user
|
14
|
-
# Some form of authentication here is basically necessary for authorization
|
15
|
-
# config.authenticate_with do
|
16
|
-
# warden.authenticate! scope: :user
|
17
|
-
# end
|
18
|
-
|
19
|
-
## == Authorization ================================
|
20
|
-
# Setup authorization to be run as a before filter
|
21
|
-
# This is run inside the controller instance so you can setup any authorization you need to.
|
22
|
-
# By default, there is no authorization.
|
23
|
-
#
|
24
|
-
# config.authorize_with do
|
25
|
-
# redirect_to root_path unless warden.user.try(:is_admin?)
|
26
|
-
# end
|
3
|
+
# This is the name of the class inside your application that the exceptions are stored as.
|
4
|
+
# Exceptions are a reserved class name.
|
27
5
|
#
|
28
|
-
#
|
29
|
-
# to
|
30
|
-
#
|
31
|
-
# config.authorize_with :cancan
|
32
|
-
|
33
|
-
# This determines how the user is displayed on the table of errors
|
34
|
-
# Can be any method that a user responds to, I.E. Any method that returns a string
|
35
|
-
# when called on user (Default is :email)
|
36
|
-
config.user_string_method = :email
|
37
|
-
|
38
|
-
# Setting this will allow the user string to be linked to the show path
|
39
|
-
# Default is the errdo root path
|
40
|
-
# config.user_show_path = :user_path
|
41
|
-
|
42
|
-
## == Notification Integration ====================
|
43
|
-
# See the github page at https://github.com/erichaydel/errdo for more info on how to set up slack
|
44
|
-
# If you want to set up slack, this is the only required parameter.
|
45
|
-
# The rest are totally optional, and default to the values here
|
6
|
+
# If you want to rename it, make sure you also change the migration that comes with the gem.
|
7
|
+
# Setting this to nil means that errors won't be tracked in the database
|
8
|
+
# Note: The model name "{name}_instance" should also be free
|
46
9
|
#
|
47
|
-
|
48
|
-
# channel: nil
|
49
|
-
# icon: ":boom:",
|
50
|
-
# name: "Errdo-bot" }
|
51
|
-
# For now, slack is the only integration. More coming soon!
|
10
|
+
config.error_name = :errs
|
52
11
|
|
53
|
-
|
54
|
-
# Error logging for rake tasks is on by default. To turn it off, set
|
55
|
-
# Errdo.log_task_exceptions = false
|
56
|
-
end
|
12
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: errdo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- erichaydel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -1432,7 +1432,6 @@ files:
|
|
1432
1432
|
- test/models/error_occurrence_test.rb
|
1433
1433
|
- test/models/error_test.rb
|
1434
1434
|
- test/test_helper.rb
|
1435
|
-
- test/tmp/config/application.rb
|
1436
1435
|
- test/tmp/config/initializers/errdo.rb
|
1437
1436
|
homepage: https://github.com/erichaydel/errdo
|
1438
1437
|
licenses:
|
@@ -2710,7 +2709,6 @@ test_files:
|
|
2710
2709
|
- test/models/error_occurrence_test.rb
|
2711
2710
|
- test/models/errdo_test.rb
|
2712
2711
|
- test/models/error_test.rb
|
2713
|
-
- test/tmp/config/application.rb
|
2714
2712
|
- test/tmp/config/initializers/errdo.rb
|
2715
2713
|
- test/generators/install_generator_test.rb
|
2716
2714
|
- test/generators/active_record_generator_test.rb
|