twiglet 3.14.1 → 3.14.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74fb4c7bc6517c18be48a46806d36806adc976994f5c5d00183e2c5c14eaa027
4
- data.tar.gz: a2cb74b9eccbb53ed88236b7ba513067b67fac8cdb410e541a72b61a3efa71a8
3
+ metadata.gz: c030fe6480fd37510af2d221e39a3e873b95dbaba85d41ac326e1953020bedd5
4
+ data.tar.gz: d6bfe4e632fff03c510ac0dae3d28502129765c5fa2547e8fe77c66808c68a83
5
5
  SHA512:
6
- metadata.gz: 4dc6934fd28231579790ac34d19ffef2118bb4b7383071f82faece3f3b276cb58ae3ffde5db1fc3029055b2304f8bf405268d219caca15323f1a0572289d62de
7
- data.tar.gz: 71b3a8e43ee9fb9f178463a2bddd80f301872dd2f82a5a2b88d18b4e35b5e5e70af2b7ed3ee2a5a0f04bbb3231e720eb9f4936bd4857dbf0d88549b7c2d1c910
6
+ metadata.gz: 7394b7de15eb772fc1f6e87c2e2bbfd1cdbad502e04a35ff079e0d49162af1a21f540cf753baa6ac9f11db367603c3b45e55849c467cb88a03da01ceae1d8f90
7
+ data.tar.gz: 1a4852c899c2362bd5c7fd0e65e0e4f8ee1ce0422999c3d9a59f9db5950519887a953c5e02358307039734b5f03d4ccd03d94ecd0997cfe5616d2ee6ae5f6636
@@ -23,12 +23,12 @@ module Twiglet
23
23
  now = args.fetch(:now, -> { Time.now.utc })
24
24
  output = args.fetch(:output, $stdout)
25
25
  level = args.fetch(:level, INFO)
26
- validation_schema = args.fetch(:validation_schema, DEFAULT_VALIDATION_SCHEMA)
26
+ schema = args.fetch(:validation_schema, DEFAULT_VALIDATION_SCHEMA)
27
27
 
28
28
  raise 'Service name is mandatory' \
29
29
  unless service_name.is_a?(String) && !service_name.strip.empty?
30
30
 
31
- @validator = Validator.new(validation_schema)
31
+ @validator = Validator.new(schema)
32
32
 
33
33
  formatter = Twiglet::Formatter.new(
34
34
  service_name,
@@ -10,10 +10,11 @@ module Twiglet
10
10
  def initialize(schema)
11
11
  @schema = JSON.parse(schema)
12
12
  @custom_error_handler = ->(e) { raise e }
13
+ @validator = JSON::Validator.new(@schema)
13
14
  end
14
15
 
15
16
  def validate(message)
16
- JSON::Validator.validate!(@schema, message)
17
+ @validator.validate(message)
17
18
  rescue JSON::Schema::ValidationError => e
18
19
  custom_error_handler.call(e)
19
20
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Twiglet
4
- VERSION = '3.14.1'
4
+ VERSION = '3.14.2'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twiglet
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.14.1
4
+ version: 3.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simply Business
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-12 00:00:00.000000000 Z
10
+ date: 2025-08-01 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: json-schema