exception-track 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +48 -0
- data/app/views/exception_track/logs/index.html.erb +2 -2
- data/config/initializers/exception-track.rb +16 -0
- data/db/migrate/20170217023900_create_exception_track_logs.rb +1 -1
- data/lib/exception-track.rb +1 -1
- data/lib/exception-track/configuration.rb +1 -1
- data/lib/exception-track/version.rb +1 -1
- data/lib/generators/exception_track/install_generator.rb +17 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e58406c8d565977ab639f5b05af8412e18dc49b
|
4
|
+
data.tar.gz: 9da9833235e61c16222780688792594ebdfe7711
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b639f4865fbada3a03f4b25770f8665920aa176bc955299917b12841f216f9d60ff9a94456dc19186c24bbd13c8d68b1ea6cd1d8ef45d3c924aa55dfa758773c
|
7
|
+
data.tar.gz: 55e20cda1a60d5f62e7f4c136ea069a36f1ba01e082be91fe05c94f1cf72b1cf33925281a5ab8ad1d9ec202c253908f875804b4a2dbcfd51cd76372e5f2b355d
|
data/README.md
CHANGED
@@ -23,6 +23,54 @@ And then execute:
|
|
23
23
|
$ bundle
|
24
24
|
```
|
25
25
|
|
26
|
+
Generate migration and config files
|
27
|
+
|
28
|
+
```bash
|
29
|
+
$ rails g exception_track:install
|
30
|
+
```
|
31
|
+
|
32
|
+
And mount routers:
|
33
|
+
|
34
|
+
config/router.rb
|
35
|
+
|
36
|
+
```rb
|
37
|
+
Rails.application.routes.draw do
|
38
|
+
mount ExceptionTrack::Engine => "/exception-track"
|
39
|
+
end
|
40
|
+
```
|
41
|
+
|
42
|
+
Now you can open: http://localhost:3000/exception-track
|
43
|
+
|
44
|
+
## Configuration
|
45
|
+
|
46
|
+
Add config/initializers/exception-track.rb
|
47
|
+
|
48
|
+
```rb
|
49
|
+
ExceptionTrack.configure do
|
50
|
+
# environments for store Exception log in to database.
|
51
|
+
# default: [:development, :production]
|
52
|
+
# self.environments = %i(production)
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
## exception_notification Configuration
|
57
|
+
|
58
|
+
You can config [exception_notification](https://github.com/smartinez87/exception_notification/) by itself's way, more documentations please visit:
|
59
|
+
|
60
|
+
https://github.com/smartinez87/exception_notification/
|
61
|
+
|
62
|
+
## Router admin authenticate for Devise
|
63
|
+
|
64
|
+
config/router.rb
|
65
|
+
|
66
|
+
```rb
|
67
|
+
authenticate :user, ->(u) { u.admin? } do
|
68
|
+
mount ExceptionTrack::Engine => "/exception-track"
|
69
|
+
end
|
70
|
+
```
|
71
|
+
|
72
|
+
https://github.com/plataformatec/devise/wiki/How-To:-Define-resource-actions-that-require-authentication-using-routes.rb
|
73
|
+
|
26
74
|
## License
|
27
75
|
|
28
76
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<script type="text/javascript">
|
2
2
|
function confirmDestroyAll() {
|
3
|
-
if (!confirm('
|
3
|
+
if (!confirm('Are you sure want destroy all Exception logs?')) {
|
4
4
|
return false;
|
5
5
|
}
|
6
6
|
}
|
@@ -16,7 +16,7 @@
|
|
16
16
|
</div>
|
17
17
|
|
18
18
|
<% if @logs.blank? %>
|
19
|
-
<div class="no-record">
|
19
|
+
<div class="no-record">No exceptions.</div>
|
20
20
|
<% else %>
|
21
21
|
<%= will_paginate @logs %>
|
22
22
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# require 'exception_notification/sidekiq'
|
2
|
+
|
3
|
+
ExceptionTrack.configure do
|
4
|
+
# environments for store Exception log in to database.
|
5
|
+
# default: [:development, :production]
|
6
|
+
# self.environments = %i(development production)
|
7
|
+
end
|
8
|
+
|
9
|
+
# ExceptionNotification.configure do |config|
|
10
|
+
# config.ignored_exceptions += %w(ActionView::TemplateError
|
11
|
+
# ActionController::InvalidAuthenticityToken
|
12
|
+
# ActionController::BadRequest
|
13
|
+
# ActionView::MissingTemplate
|
14
|
+
# ActionController::UrlGenerationError
|
15
|
+
# ActionController::UnknownFormat)
|
16
|
+
# end
|
data/lib/exception-track.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
module ExceptionTrack
|
3
|
+
module Generators
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
5
|
+
desc "Create ExceptionTrack's base files"
|
6
|
+
source_root File.expand_path('../../../../', __FILE__)
|
7
|
+
|
8
|
+
def add_initializer
|
9
|
+
template 'config/initializers/exception-track.rb', 'config/initializers/exception-track.rb'
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_migrations
|
13
|
+
exec('rake exception_track:install:migrations')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- app/views/exception_track/logs/index.html.erb
|
90
90
|
- app/views/exception_track/logs/show.html.erb
|
91
91
|
- app/views/layouts/exception-track/application.html.erb
|
92
|
+
- config/initializers/exception-track.rb
|
92
93
|
- config/routes.rb
|
93
94
|
- db/migrate/20170217023900_create_exception_track_logs.rb
|
94
95
|
- lib/exception-track.rb
|
@@ -96,6 +97,7 @@ files:
|
|
96
97
|
- lib/exception-track/engine.rb
|
97
98
|
- lib/exception-track/version.rb
|
98
99
|
- lib/exception_notifier/exception_track_notifier.rb
|
100
|
+
- lib/generators/exception_track/install_generator.rb
|
99
101
|
homepage: https://github.com/rails-engine/exception-track
|
100
102
|
licenses:
|
101
103
|
- MIT
|