itly-sdk 0.1.0 → 0.1.1
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/lib/itly/itly.rb +7 -2
- data/lib/itly/options.rb +4 -2
- data/lib/itly/version.rb +1 -1
- data/sig/itly.rbs +0 -2
- data/sig/options.rbs +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72f29db1320e2a4e60c85d7bcf7faaed0e0865df01fcbac668f6f33c87cb2c07
|
4
|
+
data.tar.gz: 811f186a7d5ec1f024624291bbd97f9d6fdf4f2d3b10419719c12398a54e9a81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36ed03b0c7e5a062df80f106494927fdaa26ab0065b16c56163053fea6c39d8c04c9849d7a44a3c8a57830f10a6f55ff2da5a144789966dcaa51b245216f1d36
|
7
|
+
data.tar.gz: 22ba0577d3598e2c4e81b3b1a633cffe1226059f6db18faaeca8a9d8f4992210b6218667c219ec642e7b76bb0fa881032d8f1b928a480f52754b282fe5d65c52
|
data/lib/itly/itly.rb
CHANGED
@@ -393,9 +393,14 @@ class Itly
|
|
393
393
|
end
|
394
394
|
|
395
395
|
def raise_validation_errors(is_valid, validations, event)
|
396
|
-
return
|
396
|
+
return if is_valid
|
397
397
|
|
398
|
-
|
398
|
+
invalid_validations = validations.reject(&:valid)
|
399
|
+
@options.on_validation_error&.call(event, invalid_validations)
|
400
|
+
|
401
|
+
return unless @options.validation == Itly::Options::Validation::ERROR_ON_INVALID
|
402
|
+
|
403
|
+
messages = invalid_validations.collect(&:message)
|
399
404
|
messages = messages.select { |m| !m.nil? && m.length.positive? }
|
400
405
|
messages << "Unknown error validating #{event.name}" if messages.empty?
|
401
406
|
|
data/lib/itly/options.rb
CHANGED
@@ -50,7 +50,7 @@ class Itly
|
|
50
50
|
# Deflault to nil, to disable Logging.
|
51
51
|
#
|
52
52
|
class Options
|
53
|
-
attr_accessor :disabled, :logger, :plugins, :environment
|
53
|
+
attr_accessor :disabled, :logger, :plugins, :environment, :on_validation_error
|
54
54
|
attr_writer :validation
|
55
55
|
|
56
56
|
##
|
@@ -61,13 +61,15 @@ class Itly
|
|
61
61
|
disabled: false,
|
62
62
|
plugins: [],
|
63
63
|
validation: nil,
|
64
|
-
logger: nil
|
64
|
+
logger: nil,
|
65
|
+
on_validation_error: nil
|
65
66
|
)
|
66
67
|
@environment = environment
|
67
68
|
@disabled = disabled
|
68
69
|
@plugins = plugins
|
69
70
|
@validation = validation
|
70
71
|
@logger = logger
|
72
|
+
@on_validation_error = on_validation_error
|
71
73
|
end
|
72
74
|
|
73
75
|
##
|
data/lib/itly/version.rb
CHANGED
data/sig/itly.rbs
CHANGED
data/sig/options.rbs
CHANGED
@@ -5,6 +5,7 @@ class Itly
|
|
5
5
|
attr_accessor logger: Logger?
|
6
6
|
attr_accessor plugins: Array[Itly::Plugin]
|
7
7
|
attr_writer validation: Integer
|
8
|
+
attr_accessor on_validation_error: (^(Itly::Event event, Array[Itly::ValidationResponse] validations) -> void)?
|
8
9
|
|
9
10
|
def for_plugin: () -> Itly::PluginOptions
|
10
11
|
def validation: () -> Integer
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itly-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iteratively
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2023-03-02 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: Track and validate analytics with a unified, extensible interface that
|
17
17
|
works with all your 3rd party analytics providers.
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
81
|
+
rubygems_version: 3.1.4
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Iteratively SDK for Ruby
|