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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ecd9495c4a02dfa2be9d6afe4e3b416262529666
4
- data.tar.gz: bca5b7008c476e70806a19a875a05ece945c29da
3
+ metadata.gz: 9e58406c8d565977ab639f5b05af8412e18dc49b
4
+ data.tar.gz: 9da9833235e61c16222780688792594ebdfe7711
5
5
  SHA512:
6
- metadata.gz: c1158b0ade22de97f3d1dc6042b557cf1d52d18547ff3b4329e84593b0face93d2d4d3c8138520b30b80c4243d035226633c818fd2c5871cc227d9863ddd637a
7
- data.tar.gz: e079a9e5db30f3c9a9fcc070ac25597c01d25052c1780fc53fbebbd821ea2fd58a4c0c50a0c798165d5fdfd72997099a810d15282442badfe50da0115d939eba
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('This will destroy all Exception logs, are you sure?')) {
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">Good! This have no Exception logs.</div>
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
@@ -2,7 +2,7 @@ class CreateExceptionTrackLogs < ActiveRecord::Migration[5.0]
2
2
  def change
3
3
  create_table :exception_tracks do |t|
4
4
  t.string :title
5
- t.longtext :body
5
+ t.text :body
6
6
 
7
7
  t.timestamps
8
8
  end
@@ -14,7 +14,7 @@ module ExceptionTrack
14
14
  def config
15
15
  return @config if defined?(@config)
16
16
  @config = Configuration.new
17
- @config.environments = %i(development test production)
17
+ @config.environments = %i(development production)
18
18
  @config
19
19
  end
20
20
 
@@ -1,7 +1,7 @@
1
1
  module ExceptionTrack
2
2
  class Configuration
3
3
  # environments for store Exception log in to database.
4
- # default: [:development, :test, :production]
4
+ # default: [:development, :production]
5
5
  attr_accessor :environments
6
6
 
7
7
  def enabled_env?(env)
@@ -1,3 +1,3 @@
1
1
  module ExceptionTrack
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -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.0
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