jt-rails-toolbox 2.5.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/Rakefile +2 -0
- data/jt-rails-toolbox.gemspec +4 -2
- data/lib/generators/jt/toolbox/templates/jt-toolbox.yml +3 -2
- data/lib/jt-rails-toolbox.rb +12 -16
- metadata +34 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00b7892b7343bd226ac1e3c7e89ed22c32e2757e
|
4
|
+
data.tar.gz: 2e8dc6f8e710c5013935f70f94634f78f31f74e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70baf3e2d64203762ccbd904764f9299b832fe5863795bc632ecbedb6e32037212b4adff9d0b0d61e74dad43acd83024511d83fef1b85fcb633bef1351dc94de
|
7
|
+
data.tar.gz: 467df83f59dbc7fb29b3df27e37b430edfd7f94aa44d4dab24bcc6dd3e6ead9c33cb2805ff8e2e7678e40d47279b1e1b2f6b6ded384cea9f9da6ed0ba73fc639
|
data/README.md
CHANGED
@@ -67,6 +67,8 @@ send notifications when errors occur (email, slack)
|
|
67
67
|
- [jt-rails-meta](https://github.com/jonathantribouharet/jt-rails-meta) Manage HTML meta tags
|
68
68
|
- [jt-rails-generator-user](https://github.com/jonathantribouharet/jt-rails-generator-user) Generate a scaffold for user authentication
|
69
69
|
- [jt-rails-tokenizable](https://github.com/jonathantribouharet/jt-rails-tokenizable) Generate tokens for ActiveRecord models
|
70
|
+
- [jt-rails-address](https://github.com/jonathantribouharet/jt-rails-address) Helpers for addresses / geolocation management
|
71
|
+
- [jt-rails-enum](https://github.com/jonathantribouharet/jt-rails-enum) Enum in models
|
70
72
|
- simplified configuration of hostnames and `ActionMailer` with a YAML file
|
71
73
|
- some helper methods
|
72
74
|
|
data/Rakefile
ADDED
data/jt-rails-toolbox.gemspec
CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
|
|
3
3
|
s.summary = "Common libs used for Ruby On Rails development."
|
4
4
|
s.description = "JTRailsToolbox contains a list of common libs used for Ruby On Rails development."
|
5
5
|
s.homepage = 'https://github.com/jonathantribouharet/jt-rails-toolbox'
|
6
|
-
s.version = '2.
|
6
|
+
s.version = '2.6.0'
|
7
7
|
s.files = `git ls-files`.split("\n")
|
8
8
|
s.require_paths = ['lib']
|
9
9
|
s.authors = ['Jonathan TRIBOUHARET']
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_dependency('http_accept_language')
|
18
18
|
|
19
19
|
s.add_dependency('exception_notification', '~> 4.1')
|
20
|
-
s.add_dependency('airbrake', '~>
|
20
|
+
s.add_dependency('airbrake-ruby', '~> 2.4')
|
21
21
|
|
22
22
|
s.add_dependency('paperclip', '~> 5.0')
|
23
23
|
s.add_dependency('validates_email_format_of', '~> 1.6')
|
@@ -26,6 +26,8 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.add_dependency('jt-rails-meta', '~> 1.0')
|
27
27
|
s.add_dependency('jt-rails-generator-user', '~> 1.0')
|
28
28
|
s.add_dependency('jt-rails-tokenizable', '~> 1.0')
|
29
|
+
s.add_dependency('jt-rails-address', '~> 1.0')
|
30
|
+
s.add_dependency('jt-rails-enum', '~> 1.0')
|
29
31
|
|
30
32
|
s.add_dependency('sidekiq', '< 6')
|
31
33
|
s.add_dependency('redis-namespace')
|
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# you can use `shared` for multiple environments
|
2
|
+
# shared:
|
2
3
|
# files:
|
3
4
|
# folder: upload
|
4
5
|
# mail:
|
@@ -9,7 +10,7 @@
|
|
9
10
|
# cdn_host: same as host
|
10
11
|
# sidekiq:
|
11
12
|
# redis_url: redis://localhost:6379/nameoftheapp
|
12
|
-
#
|
13
|
+
#
|
13
14
|
# development:
|
14
15
|
# sidekiq:
|
15
16
|
# disable: true
|
data/lib/jt-rails-toolbox.rb
CHANGED
@@ -7,6 +7,8 @@ require 'rails_i18n'
|
|
7
7
|
require 'jt-rails-meta'
|
8
8
|
require 'jt-rails-generator-user'
|
9
9
|
require 'jt-rails-tokenizable'
|
10
|
+
require 'jt-rails-address'
|
11
|
+
require 'jt-rails-enum'
|
10
12
|
require 'oj'
|
11
13
|
require 'oj_mimic_json'
|
12
14
|
|
@@ -20,9 +22,10 @@ module JTRailsToolbox
|
|
20
22
|
@params = {}
|
21
23
|
|
22
24
|
if ::File.exists?('config/jt-toolbox.yml')
|
23
|
-
yaml = YAML
|
25
|
+
yaml = YAML.load(ERB.new(File.read('config/jt-toolbox.yml'), 0, '<>').result)
|
24
26
|
if yaml
|
25
|
-
@params = yaml[
|
27
|
+
@params = yaml['shared'] || {}
|
28
|
+
@params.deep_merge!(yaml[Rails.env.to_s] || {})
|
26
29
|
end
|
27
30
|
end
|
28
31
|
|
@@ -75,8 +78,7 @@ module JTRailsToolbox
|
|
75
78
|
|
76
79
|
if @params['exception']['airbrake']
|
77
80
|
|
78
|
-
require 'airbrake'
|
79
|
-
require 'airbrake/sidekiq/error_handler' unless sidekiq_disabled?
|
81
|
+
require 'airbrake-ruby'
|
80
82
|
|
81
83
|
Airbrake.configure do |c|
|
82
84
|
if @params['exception']['airbrake']['host']
|
@@ -94,18 +96,6 @@ module JTRailsToolbox
|
|
94
96
|
c.ignore_environments = %w(development test)
|
95
97
|
end
|
96
98
|
end
|
97
|
-
|
98
|
-
# Default ignored exceptions in Exception Notification
|
99
|
-
exceptions_to_ignore = %w{ActiveRecord::RecordNotFound Mongoid::Errors::DocumentNotFound AbstractController::ActionNotFound ActionController::RoutingError ActionController::UnknownFormat ActionController::UrlGenerationError}
|
100
|
-
|
101
|
-
# Additionnal exceptions to ignore
|
102
|
-
exceptions_to_ignore.push *%w{ActionController::InvalidCrossOriginRequest ActionController::InvalidAuthenticityToken}
|
103
|
-
|
104
|
-
Airbrake.add_filter do |notice|
|
105
|
-
if notice[:errors].any? { |error| exceptions_to_ignore.include?(error[:type]) }
|
106
|
-
notice.ignore!
|
107
|
-
end
|
108
|
-
end
|
109
99
|
end
|
110
100
|
|
111
101
|
require 'exception_notification'
|
@@ -128,6 +118,12 @@ module JTRailsToolbox
|
|
128
118
|
exception_recipients: @params['exception']['exception_recipients']
|
129
119
|
}
|
130
120
|
end
|
121
|
+
|
122
|
+
if @params['exception']['airbrake']
|
123
|
+
config.add_notifier :airbrake, -> (exception, options) {
|
124
|
+
Airbrake.notify(exception)
|
125
|
+
}
|
126
|
+
end
|
131
127
|
end
|
132
128
|
end
|
133
129
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jt-rails-toolbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan TRIBOUHARET
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -67,19 +67,19 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '4.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: airbrake
|
70
|
+
name: airbrake-ruby
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.4'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2.4'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: paperclip
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,6 +178,34 @@ dependencies:
|
|
178
178
|
- - ~>
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '1.0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: jt-rails-address
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ~>
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '1.0'
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ~>
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '1.0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: jt-rails-enum
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ~>
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '1.0'
|
202
|
+
type: :runtime
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ~>
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '1.0'
|
181
209
|
- !ruby/object:Gem::Dependency
|
182
210
|
name: sidekiq
|
183
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -245,6 +273,7 @@ files:
|
|
245
273
|
- Gemfile
|
246
274
|
- LICENSE
|
247
275
|
- README.md
|
276
|
+
- Rakefile
|
248
277
|
- app/helpers/jt_rails_toolbox_helper.rb
|
249
278
|
- jt-rails-toolbox.gemspec
|
250
279
|
- lib/generators/jt/toolbox/USAGE
|