servactory 1.6.11 → 1.6.13

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: 2b12f427c8f43d8179f695716ffdc2afc1de1390320ff092b83a70dded92f9a7
4
- data.tar.gz: ddd30b3129568ce698291b9cb3a039bd8eec32b200e01cc312d4dab9f8509ec4
3
+ metadata.gz: 8fb456eae63f08b03712474124ad24d2af28d8cf34501dcc442ff489d94152c0
4
+ data.tar.gz: 250cc4f9058345bfe888034c163aa49720cb5e469fe7956093defce979f85c9b
5
5
  SHA512:
6
- metadata.gz: 92abe4b72caa144a53c54a12d72613277798026a0625695cf1711e725a560befaf67ce4914ef2c6fa675fb27f0a4697360255849c3922803d88457d0134219e9
7
- data.tar.gz: 11df004407cbb75c24ad342a508012c3b6bab3034674477fd01d20ccce8c1603712554d09127f01a395b3e658c3464cbd842decb293df9dc41a2a482e42d2da9
6
+ metadata.gz: d8a3b0c171df80b8eab5941f7c6fdfd01a032689aab2b45ca91f4f6a1ef199f12e0cd998cf8a92380f1bceb76577c5d5ebe746ed1afa5ecd4c96c7c3815e39b9
7
+ data.tar.gz: b2a0eefa30dfc7841a425bb9b7f3405bbbea0d93c1a2d9e0e6d6306eba376ab452becff2f7fe511f775593ea6679f0b24f442eb2353934ee3444868e5654fe37
@@ -28,8 +28,12 @@ module Servactory
28
28
  )
29
29
  end
30
30
 
31
- def fail!(message:, meta: nil)
32
- failure = Servactory.configuration.failure_class.new(message: message, meta: meta)
31
+ def fail!(
32
+ message:,
33
+ failure_class: Servactory.configuration.failure_class,
34
+ meta: nil
35
+ )
36
+ failure = failure_class.new(message: message, meta: meta)
33
37
 
34
38
  raise failure if @service_strict_mode
35
39
 
@@ -38,9 +38,9 @@ module Servactory
38
38
  end
39
39
 
40
40
  def check # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
41
- if @input.array? && @value.present?
41
+ if @input.array? && Servactory::Utils.value_present?(@value)
42
42
  return if @value.respond_to?(:all?) && @value.all?(&:present?)
43
- elsif @value.present?
43
+ elsif Servactory::Utils.value_present?(@value)
44
44
  return
45
45
  end
46
46
 
@@ -44,6 +44,8 @@ module Servactory
44
44
 
45
45
  instance_variable_set(:@#{output.name}, value)
46
46
  end
47
+
48
+ attr_reader :#{output.name}
47
49
  RUBY
48
50
  end
49
51
  end
@@ -9,5 +9,11 @@ module Servactory
9
9
  def true?(value)
10
10
  value.to_s.casecmp("true").to_i.zero?
11
11
  end
12
+
13
+ def value_present?(value)
14
+ !value.nil? && (
15
+ value.respond_to?(:empty?) ? !value.empty? : true
16
+ )
17
+ end
12
18
  end
13
19
  end
@@ -4,7 +4,7 @@ module Servactory
4
4
  module VERSION
5
5
  MAJOR = 1
6
6
  MINOR = 6
7
- PATCH = 11
7
+ PATCH = 13
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH].join(".")
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: servactory
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.11
4
+ version: 1.6.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Sokolov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-13 00:00:00.000000000 Z
11
+ date: 2023-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport