servactory 2.6.1 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/servactory/tool_kit/dynamic_options/format.rb +16 -1
- data/lib/servactory/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ce5565f3e907fc4f2739acfd68389a9d10bfc1a0dbfdcafe81692d631c4ec96
|
4
|
+
data.tar.gz: 2e7dae944a0fd40907dbe2cfdb2593ee6f43e1d4112641643f917c76fbe8a90b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8ff6b069089defb72497b5431ac790a59b019253fc10f2f6c5562184b6f42bb5457a28264efd19f3e1d5f1801c28e068f0c4315ddbaec8e8155cad3e13855b6
|
7
|
+
data.tar.gz: 6552a2df9438f6e7b3c9737ae814d61d835446396ad9ef0777eb805680923aa47e0b90de15662388dcde3baab3ae0640df35d79223f656f1335accbdcde64266
|
@@ -82,11 +82,25 @@ module Servactory
|
|
82
82
|
common_condition_with(...)
|
83
83
|
end
|
84
84
|
|
85
|
-
|
85
|
+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
86
|
+
def common_condition_with(value:, option:, input: nil, internal: nil, output: nil)
|
86
87
|
option_value = option.value&.to_sym
|
87
88
|
|
88
89
|
return [false, :unknown] unless @formats.key?(option_value)
|
89
90
|
|
91
|
+
attribute = Utils.define_attribute_with(input: input, internal: internal, output: output)
|
92
|
+
|
93
|
+
if value.blank? &&
|
94
|
+
(
|
95
|
+
(attribute.input? && attribute.optional?) ||
|
96
|
+
(
|
97
|
+
(attribute.internal? || attribute.output?) &&
|
98
|
+
attribute.types.include?(NilClass)
|
99
|
+
)
|
100
|
+
)
|
101
|
+
return true
|
102
|
+
end
|
103
|
+
|
90
104
|
format_options = @formats.fetch(option_value)
|
91
105
|
|
92
106
|
format_pattern = option.properties.fetch(:pattern, format_options.fetch(:pattern))
|
@@ -95,6 +109,7 @@ module Servactory
|
|
95
109
|
|
96
110
|
option.properties.fetch(:validator, format_options.fetch(:validator)).call(value: value)
|
97
111
|
end
|
112
|
+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
98
113
|
|
99
114
|
########################################################################
|
100
115
|
|
data/lib/servactory/version.rb
CHANGED
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: 2.6.
|
4
|
+
version: 2.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|