itly-sdk 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: f956ac42d9761509feed18e020c4c5afee5cfa5928f099e1895b982e59dd5d10
4
- data.tar.gz: e980e7b80fab1c12ce52ec928afbd264221a1d0ba9d1ba9570c69c849e9a42a9
3
+ metadata.gz: 72f29db1320e2a4e60c85d7bcf7faaed0e0865df01fcbac668f6f33c87cb2c07
4
+ data.tar.gz: 811f186a7d5ec1f024624291bbd97f9d6fdf4f2d3b10419719c12398a54e9a81
5
5
  SHA512:
6
- metadata.gz: 85ab4bfde5fc16accc2629d83417ca697dfbdd6511ad26b95bfdde8cdff39346f76034897ae028916d452ed1a37afe8a37e4a2a406cf19187dbfbfd9352cd20e
7
- data.tar.gz: 5b90b6d14135f194aa63c1b3d0cd09119a11d1b84cae7b3f93d84455220a97c7236f51606250c7aadd2309aef085df334c6e1cfbd72e8d7dd9ac476b148a1777
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 unless !is_valid && @options.validation == Itly::Options::Validation::ERROR_ON_INVALID
396
+ return if is_valid
397
397
 
398
- messages = validations.reject(&:valid).collect(&:message)
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Itly main class
4
4
  class Itly
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
data/sig/itly.rbs CHANGED
@@ -1,6 +1,4 @@
1
1
  class Itly
2
- include Itly::Plugins
3
-
4
2
  VERSION: String
5
3
 
6
4
  attr_reader options: Itly::Options
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.0
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: 2021-06-15 00:00:00.000000000 Z
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.0.3.1
81
+ rubygems_version: 3.1.4
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: Iteratively SDK for Ruby