servactory 2.14.1 → 2.15.0
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/servactory/actions/dsl.rb +3 -3
- data/lib/servactory/context/workspace/internals.rb +7 -1
- data/lib/servactory/dsl.rb +16 -10
- data/lib/servactory/exceptions/failure.rb +14 -0
- data/lib/servactory/info/builder.rb +70 -47
- data/lib/servactory/inputs/input.rb +91 -50
- data/lib/servactory/inputs/tools/validation.rb +4 -2
- data/lib/servactory/internals/internal.rb +84 -43
- data/lib/servactory/maintenance/attributes/option.rb +59 -25
- data/lib/servactory/maintenance/attributes/options/registrar.rb +77 -57
- data/lib/servactory/maintenance/attributes/options_collection.rb +25 -15
- data/lib/servactory/maintenance/attributes/tools/validation.rb +1 -1
- data/lib/servactory/outputs/output.rb +83 -43
- data/lib/servactory/result.rb +5 -6
- data/lib/servactory/test_kit/rspec/matchers/have_service_input_matchers/default_matcher.rb +2 -0
- data/lib/servactory/test_kit/rspec/matchers.rb +2 -2
- data/lib/servactory/test_kit/utils/faker.rb +2 -2
- data/lib/servactory/tool_kit/dynamic_options/max.rb +1 -1
- data/lib/servactory/tool_kit/dynamic_options/min.rb +1 -1
- data/lib/servactory/tool_kit/dynamic_options/schema.rb +7 -1
- data/lib/servactory/version.rb +2 -2
- metadata +1 -1
@@ -29,7 +29,8 @@ module Servactory
|
|
29
29
|
common_condition_with(attribute: output, value:, option:)
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
33
|
+
def common_condition_with(attribute:, value:, option:)
|
33
34
|
return true if option.value == false
|
34
35
|
return [false, :wrong_type] unless @default_hash_mode_class_names.intersect?(attribute.types)
|
35
36
|
|
@@ -39,12 +40,17 @@ module Servactory
|
|
39
40
|
|
40
41
|
schema = option.value.fetch(:is, option.value)
|
41
42
|
|
43
|
+
if attribute.internal? || attribute.output?
|
44
|
+
schema = schema.transform_values { |options| options.except(:prepare) }
|
45
|
+
end
|
46
|
+
|
42
47
|
is_success, reason, meta = validate_for!(object: value, schema:)
|
43
48
|
|
44
49
|
prepare_object_with!(object: value, schema:) if is_success
|
45
50
|
|
46
51
|
[is_success, reason, meta]
|
47
52
|
end
|
53
|
+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
48
54
|
|
49
55
|
def validate_for!(object:, schema:, root_schema_key: nil) # rubocop:disable Metrics/MethodLength
|
50
56
|
unless object.respond_to?(:fetch)
|
data/lib/servactory/version.rb
CHANGED