rollday 0.3.0 → 0.4.0
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/Gemfile.lock +3 -1
- data/lib/rollday/configuration.rb +17 -55
- data/lib/rollday/version.rb +1 -1
- data/rollday.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88eac5b844d6a7cd87818c350d03f96b5d0d470dd8c044f8bab3da9625720595
|
4
|
+
data.tar.gz: fe85155acaebfb01238ce3530bde4c3b2b9537c3a24389e36dc8466423857831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7249b1d26e10e71c56fca2355fe8d2f609724f476ba62a8663c55207c6fb508ab59ef455cc436a93ab4aa0cb9db5d9967dcbcc1ce4bfd82e5eabedd2f531ea7e
|
7
|
+
data.tar.gz: 62b0b30259c81d79c601c50ee5b183939da161fef4460d1d668c50d971697050a7ceccb51a5dd50f4bc5062abda367f96823c62a2f7c61db25f343b994990b70
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rollday (0.
|
4
|
+
rollday (0.4.0)
|
5
|
+
class_composer
|
5
6
|
faraday
|
6
7
|
rollbar
|
7
8
|
|
@@ -9,6 +10,7 @@ GEM
|
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
11
12
|
byebug (11.1.3)
|
13
|
+
class_composer (1.0.0)
|
12
14
|
coderay (1.1.3)
|
13
15
|
concurrent-ruby (1.1.10)
|
14
16
|
diff-lcs (1.5.0)
|
@@ -2,9 +2,12 @@
|
|
2
2
|
|
3
3
|
require "rollday/use_middleware"
|
4
4
|
require "rollbar"
|
5
|
+
require "class_composer"
|
5
6
|
|
6
7
|
module Rollday
|
7
8
|
class Configuration
|
9
|
+
include ClassComposer::Generator
|
10
|
+
|
8
11
|
ROLLBAR_LEVELS = [
|
9
12
|
DEBUG = :debug,
|
10
13
|
INFO = :info,
|
@@ -14,62 +17,21 @@ module Rollday
|
|
14
17
|
]
|
15
18
|
|
16
19
|
DEFAULT_STATUS_CODE_REGEX = /[45]\d\d$/
|
17
|
-
DEFAULT_MESSAGE_PROC = ->(status, phrase, domain) { "[#{status}]: #{domain}" }
|
20
|
+
DEFAULT_MESSAGE_PROC = ->(status, phrase, body, path, domain) { "[#{status}]: #{domain} - #{path}" }
|
18
21
|
DEFAULT_LEVEL_PROC = ->(_status) { WARNING }
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
@message = DEFAULT_MESSAGE_PROC
|
33
|
-
@use_message_exception = true
|
34
|
-
|
35
|
-
@rollbar_level = DEFAULT_LEVEL_PROC
|
36
|
-
end
|
37
|
-
|
38
|
-
def rollbar_level=(level)
|
39
|
-
raise ConfigError, "level= must be passed a Proc or #{ROLLBAR_LEVELS}. But was passed a #{level} instead"
|
40
|
-
|
41
|
-
@rollbar_level = level
|
42
|
-
end
|
43
|
-
|
44
|
-
def rollbar_level
|
45
|
-
@rollbar_level
|
46
|
-
end
|
47
|
-
|
48
|
-
def message=(message)
|
49
|
-
raise ConfigError, "message= must be passed a Proc but was passed a #{message.class} instead"
|
50
|
-
|
51
|
-
@message = message
|
52
|
-
end
|
53
|
-
|
54
|
-
def message
|
55
|
-
@message
|
56
|
-
end
|
57
|
-
|
58
|
-
def status_code_regex
|
59
|
-
@status_code_regex
|
60
|
-
end
|
61
|
-
|
62
|
-
def status_code_regex=(regex)
|
63
|
-
raise ConfigError, "status_code_regex= must be passed a regex but was passed a #{regex.class} instead"
|
64
|
-
|
65
|
-
@status_code_regex = regex
|
66
|
-
end
|
67
|
-
|
68
|
-
def person_scope=(person_scope)
|
69
|
-
raise ConfigError, "person_scope= must be passed a Proc but was passed a #{person_scope.class} instead"
|
70
|
-
|
71
|
-
@person_scope = person_scope
|
72
|
-
end
|
22
|
+
ROLLBAR_VALIDATOR = Proc.new do |value|
|
23
|
+
value.is_a?(Proc) || ROLLBAR_LEVELS.include?(value)
|
24
|
+
end
|
25
|
+
|
26
|
+
add_composer :message, allowed: [Proc, String], default: DEFAULT_MESSAGE_PROC
|
27
|
+
add_composer :params_query_sanitizer, allowed: Array, default: []
|
28
|
+
add_composer :params_scope_sanitizer, allowed: Array, default: []
|
29
|
+
add_composer :status_code_regex, allowed: Regexp, default: DEFAULT_STATUS_CODE_REGEX
|
30
|
+
add_composer :use_message_exception, allowed: [TrueClass, FalseClass], default: true
|
31
|
+
add_composer :use_params_scope, allowed: [TrueClass, FalseClass], default: true
|
32
|
+
add_composer :use_person_scope, allowed: [TrueClass, FalseClass], default: true
|
33
|
+
add_composer :use_query_scope, allowed: [TrueClass, FalseClass], default: true
|
34
|
+
add_composer :rollbar_level, allowed: [Proc, Symbol], default: DEFAULT_LEVEL_PROC, validator: ROLLBAR_VALIDATOR, invalid_message: -> (val) { "Value must be a Proc or one of #{ROLLBAR_LEVELS}" }
|
73
35
|
|
74
36
|
def person_scope
|
75
37
|
return -> {} unless @use_person_scope
|
data/lib/rollday/version.rb
CHANGED
data/rollday.gemspec
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: class_composer
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: faraday
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|