errdo 0.11.3 → 0.11.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/errdo/errors_controller.rb +1 -1
- data/app/models/errdo/exception.rb +5 -2
- data/config/routes.rb +2 -0
- data/lib/errdo/helpers/views_helper.rb +4 -0
- data/lib/errdo/logger.rb +1 -0
- data/lib/errdo/models/error_env_parser.rb +8 -4
- data/lib/errdo/notifications/slack/notification_adapter.rb +23 -8
- data/lib/errdo/version.rb +1 -1
- data/lib/errdo.rb +4 -4
- data/test/dummy/config/environments/development.rb +1 -0
- data/test/dummy/config/environments/production.rb +2 -0
- data/test/dummy/config/environments/test.rb +2 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +1967 -0
- data/test/dummy/log/test.log +146293 -0
- data/test/integrations/plugins_integration_test.rb +2 -1
- data/test/models/errdo_test.rb +6 -6
- data/test/test_helper.rb +0 -3
- data/test/tmp/config/application.rb +4 -0
- data/test/tmp/config/initializers/errdo.rb +49 -7
- metadata +4 -4
- data/test/dummy/tmp/pids/server.pid +0 -1
@@ -27,8 +27,8 @@ class PluginsIntegrationTest < ActionDispatch::IntegrationTest
|
|
27
27
|
Errdo.error_name = nil
|
28
28
|
stub_request :any, /.*slack.*/
|
29
29
|
get static_generic_error_path
|
30
|
-
assert_requested :any, /.*slack.*/
|
31
30
|
Errdo.error_name = :errors
|
31
|
+
assert_requested :any, /.*slack.*/
|
32
32
|
end
|
33
33
|
|
34
34
|
should "not fail when the slack ping returns an error" do
|
@@ -39,6 +39,7 @@ class PluginsIntegrationTest < ActionDispatch::IntegrationTest
|
|
39
39
|
end
|
40
40
|
|
41
41
|
teardown do
|
42
|
+
Errdo.error_name = :errors
|
42
43
|
Errdo.instance_variable_set(:@notifiers, [])
|
43
44
|
end
|
44
45
|
|
data/test/models/errdo_test.rb
CHANGED
@@ -14,7 +14,7 @@ class ErrdoTest < ActiveSupport::TestCase
|
|
14
14
|
Errdo.instance_variable_set(:@notifiers, [])
|
15
15
|
end
|
16
16
|
|
17
|
-
should "create an error and send notification with Errdo.
|
17
|
+
should "create an error and send notification with Errdo.error" do
|
18
18
|
assert_difference 'Errdo::Error.count', 1 do
|
19
19
|
begin
|
20
20
|
raise "error stuff"
|
@@ -25,28 +25,28 @@ class ErrdoTest < ActiveSupport::TestCase
|
|
25
25
|
assert_requested :any, /.*slack.*/
|
26
26
|
end
|
27
27
|
|
28
|
-
should "create an error and send notification with Errdo.
|
28
|
+
should "create an error and send notification with Errdo.error even when nothing is set" do
|
29
29
|
assert_difference 'Errdo::Error.count', 1 do
|
30
30
|
Errdo.error
|
31
31
|
end
|
32
32
|
assert_requested :any, /.*slack.*/
|
33
33
|
end
|
34
34
|
|
35
|
-
should "create an error and send notification with Errdo.
|
35
|
+
should "create an error and send notification with Errdo.warn" do
|
36
36
|
assert_difference 'Errdo::Error.count', 1 do
|
37
37
|
Errdo.warn
|
38
38
|
end
|
39
39
|
assert_requested :any, /.*slack.*/
|
40
40
|
end
|
41
41
|
|
42
|
-
should "not create an error, but should send notification with Errdo.
|
42
|
+
should "not create an error, but should send notification with Errdo.notify" do
|
43
43
|
assert_difference 'Errdo::Error.count', 0 do
|
44
|
-
Errdo.notify
|
44
|
+
Errdo.notify("Error happened")
|
45
45
|
end
|
46
46
|
assert_requested :any, /.*slack.*/
|
47
47
|
end
|
48
48
|
|
49
|
-
should "create an error, but should not send notification with Errdo.
|
49
|
+
should "create an error, but should not send notification with Errdo.log" do
|
50
50
|
assert_difference 'Errdo::Error.count', 1 do
|
51
51
|
Errdo.log
|
52
52
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,12 +1,54 @@
|
|
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
|
+
# Errdo.dirty_words += ["custom_param"]
|
2
6
|
|
3
|
-
|
4
|
-
#
|
7
|
+
## == Authorization and Devise integration =========
|
8
|
+
# If you have the ability to track who's logged in, setting the current_user_method
|
9
|
+
# will allow the logged-in user to be recorded with the error
|
10
|
+
# config.current_user_method = :current_user
|
11
|
+
# Some form of authentication here is basically necessary for authorization
|
12
|
+
# config.authenticate_with do
|
13
|
+
# warden.authenticate! scope: :user
|
14
|
+
# end
|
15
|
+
|
16
|
+
## == Authorization ================================
|
17
|
+
# Setup authorization to be run as a before filter
|
18
|
+
# This is run inside the controller instance so you can setup any authorization you need to.
|
19
|
+
# By default, there is no authorization.
|
20
|
+
#
|
21
|
+
# config.authorize_with do
|
22
|
+
# redirect_to root_path unless warden.user.try(:is_admin?)
|
23
|
+
# end
|
5
24
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
25
|
+
# To use an authorization adapter, pass the name of the adapter. For example,
|
26
|
+
# to use with CanCanCan[https://github.com/CanCanCommunity/cancancan], pass it like this.
|
27
|
+
# Currently, only cancan/cancancan is supported
|
28
|
+
# config.authorize_with :cancan
|
29
|
+
|
30
|
+
# This determines how the user is displayed on the table of errors
|
31
|
+
# Can be any method that a user responds to, I.E. Any method that returns a string
|
32
|
+
# when called on user (Default is :email)
|
33
|
+
config.user_string_method = :email
|
34
|
+
|
35
|
+
# Setting this will allow the user string to be linked to the show path
|
36
|
+
# Default is the errdo root path
|
37
|
+
# config.user_show_path = :user_path
|
38
|
+
|
39
|
+
## == Notification Integration ====================
|
40
|
+
# See the github page at https://github.com/erichaydel/errdo for more info on how to set up slack
|
41
|
+
# If you want to set up slack, this is the only required parameter.
|
42
|
+
# The rest are totally optional, and default to the values here
|
9
43
|
#
|
10
|
-
|
44
|
+
# Errdo.notify_with slack: { webhook: "WEBHOOK-URL",
|
45
|
+
# channel: nil
|
46
|
+
# icon: ":boom:",
|
47
|
+
# name: "Errdo-bot" }
|
48
|
+
# For now, slack is the only integration. More coming soon!
|
49
|
+
|
50
|
+
## == Non Web Requests ============================
|
51
|
+
# Error logging for rake tasks is on by default. To turn it off, set
|
52
|
+
# Errdo.log_task_exceptions = false
|
11
53
|
|
12
|
-
end
|
54
|
+
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.11.
|
4
|
+
version: 0.11.4
|
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-
|
11
|
+
date: 2016-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -1166,7 +1166,6 @@ files:
|
|
1166
1166
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/yT/yTtHPSuoQcrWILF_zjGkfZqDXuxAI64qp9UfCmjbEZI.cache
|
1167
1167
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/yZ/yZjhCWWhVUVSNJf6V4nzVClRI4EYH8gm7rdAesM6XDk.cache
|
1168
1168
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/yg/yg04QotCA0Nyl2UMuOj7Rst0Y1BtZhxHgggoVMC-PjA.cache
|
1169
|
-
- test/dummy/tmp/pids/server.pid
|
1170
1169
|
- test/factories.rb
|
1171
1170
|
- test/fixtures/users.yml
|
1172
1171
|
- test/generators/active_record_generator_test.rb
|
@@ -1182,6 +1181,7 @@ files:
|
|
1182
1181
|
- test/models/error_occurrence_test.rb
|
1183
1182
|
- test/models/error_test.rb
|
1184
1183
|
- test/test_helper.rb
|
1184
|
+
- test/tmp/config/application.rb
|
1185
1185
|
- test/tmp/config/initializers/errdo.rb
|
1186
1186
|
homepage: https://github.com/erichaydel/errdo
|
1187
1187
|
licenses:
|
@@ -2176,7 +2176,6 @@ test_files:
|
|
2176
2176
|
- test/dummy/tmp/cache/assets/sprockets/v3.0/D_/D_KcfHEBsRaZDGqaiFtERXr1g8Av54-9T958jUK7R0A.cache
|
2177
2177
|
- test/dummy/tmp/cache/assets/sprockets/v3.0/ED/EDVZLiJoq6wj93pJxKsK4TI15LIXRqwx4OdFGAAr068.cache
|
2178
2178
|
- test/dummy/tmp/cache/assets/sprockets/v3.0/Ip/IplSosjlbQ5aan_h10fBG52WhsI8ogweDeukCOuwPWI.cache
|
2179
|
-
- test/dummy/tmp/pids/server.pid
|
2180
2179
|
- test/dummy/README.rdoc
|
2181
2180
|
- test/dummy/bin/bundle
|
2182
2181
|
- test/dummy/bin/setup
|
@@ -2209,6 +2208,7 @@ test_files:
|
|
2209
2208
|
- test/models/error_occurrence_test.rb
|
2210
2209
|
- test/models/errdo_test.rb
|
2211
2210
|
- test/models/error_test.rb
|
2211
|
+
- test/tmp/config/application.rb
|
2212
2212
|
- test/tmp/config/initializers/errdo.rb
|
2213
2213
|
- test/generators/install_generator_test.rb
|
2214
2214
|
- test/generators/active_record_generator_test.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
5011
|