exception-track 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -3
- data/lib/exception-track/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcb5858f2cfdd417d977b925270c8b04a41c4616
|
|
4
|
+
data.tar.gz: 46b9964497879b206a21c5213d7dcd4af7febf0c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 37f03fd69a64444b0534e10da3e91a89a46cc53a3ce2ebe3e5ddad8e98d8b1dbd2d1df92dc975c8b72f65273ae4f89d5cddf1de000994ed8ed6174bdc96e1b0d
|
|
7
|
+
data.tar.gz: 4ba8e28108ac18070399365f149811f3198c7892ff2a013786341e312e6399c39ad764b6c01cb1aa5aa539cfa7a074cf9bbf075cc6487754cccdec8d97a638c1
|
data/README.md
CHANGED
|
@@ -5,6 +5,8 @@ Tracking exceptions for Rails application store them in database.
|
|
|
5
5
|
|
|
6
6
|
This gem is base on [exception_notification](https://github.com/smartinez87/exception_notification/).
|
|
7
7
|
|
|
8
|
+
[中文介绍和使用说明](https://ruby-china.org/topics/32325)
|
|
9
|
+
|
|
8
10
|
[](https://badge.fury.io/rb/exception-track) [](https://travis-ci.org/rails-engine/exception-track) [](https://codeclimate.com/github/rails-engine/exception-track) [](https://codecov.io/github/rails-engine/exception-track?branch=master) [](http://inch-ci.org/github/rails-engine/exception-track?branch=master)
|
|
9
11
|
|
|
10
12
|

|
|
@@ -59,17 +61,33 @@ You can config [exception_notification](https://github.com/smartinez87/exception
|
|
|
59
61
|
|
|
60
62
|
https://github.com/smartinez87/exception_notification/
|
|
61
63
|
|
|
62
|
-
## Router admin authenticate
|
|
64
|
+
## Router admin authenticate
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
```rb
|
|
67
|
+
# lib/admin_constraint.rb
|
|
68
|
+
class AdminConstraint
|
|
69
|
+
def matches?(request)
|
|
70
|
+
return false if !request.session[:user_id]
|
|
71
|
+
user = User.find(request.session[:user_id])
|
|
72
|
+
user && user.admin?
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# config/router.rb
|
|
77
|
+
require 'admin_constraint'
|
|
78
|
+
mount ExceptionTrack::Engine => "/exception-track", constraints: AdminConstraint.new
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**With Devise**
|
|
65
82
|
|
|
66
83
|
```rb
|
|
84
|
+
# config/router.rb
|
|
67
85
|
authenticate :user, ->(u) { u.admin? } do
|
|
68
86
|
mount ExceptionTrack::Engine => "/exception-track"
|
|
69
87
|
end
|
|
70
88
|
```
|
|
71
89
|
|
|
72
|
-
https://github.com/
|
|
90
|
+
More examples: [Sidekiq Web Document](https://github.com/mperham/sidekiq/wiki/Monitoring#authentication)
|
|
73
91
|
|
|
74
92
|
## License
|
|
75
93
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: exception-track
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason Lee
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-02-
|
|
11
|
+
date: 2017-02-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -16,34 +16,34 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 4.
|
|
19
|
+
version: '4.0'
|
|
20
20
|
- - "<"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '5.
|
|
22
|
+
version: '5.2'
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - ">="
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: 4.
|
|
29
|
+
version: '4.0'
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '5.
|
|
32
|
+
version: '5.2'
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: exception_notification
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '4
|
|
39
|
+
version: '4'
|
|
40
40
|
type: :runtime
|
|
41
41
|
prerelease: false
|
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
44
|
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '4
|
|
46
|
+
version: '4'
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
48
|
name: will_paginate
|
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|