servactory 2.14.0 → 2.15.0.rc1
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/result.rb +17 -4
- data/lib/servactory/test_kit/rspec/helpers.rb +2 -12
- 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 +3 -3
@@ -7,13 +7,13 @@ module Servactory
|
|
7
7
|
module TestKit
|
8
8
|
module Rspec
|
9
9
|
module Matchers # rubocop:disable Metrics/ModuleLength
|
10
|
-
def have_service_input(input_name) # rubocop:disable Naming/
|
10
|
+
def have_service_input(input_name) # rubocop:disable Naming/PredicatePrefix
|
11
11
|
HaveServiceInputMatcher.new(described_class, input_name)
|
12
12
|
end
|
13
13
|
|
14
14
|
RSpec::Matchers.alias_matcher :have_input, :have_service_input
|
15
15
|
|
16
|
-
def have_service_internal(internal_name) # rubocop:disable Naming/
|
16
|
+
def have_service_internal(internal_name) # rubocop:disable Naming/PredicatePrefix
|
17
17
|
HaveServiceInternalMatcher.new(described_class, internal_name)
|
18
18
|
end
|
19
19
|
|
@@ -57,11 +57,11 @@ module Servactory
|
|
57
57
|
of == :integer ? { fake: 1 } : { fake: :yes }
|
58
58
|
end
|
59
59
|
|
60
|
-
def fake_true_class
|
60
|
+
def fake_true_class # rubocop:disable Naming/PredicateMethod
|
61
61
|
true
|
62
62
|
end
|
63
63
|
|
64
|
-
def fake_false_class
|
64
|
+
def fake_false_class # rubocop:disable Naming/PredicateMethod
|
65
65
|
false
|
66
66
|
end
|
67
67
|
|
@@ -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
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: servactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.15.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activesupport
|
@@ -354,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
354
354
|
- !ruby/object:Gem::Version
|
355
355
|
version: '0'
|
356
356
|
requirements: []
|
357
|
-
rubygems_version: 3.6.
|
357
|
+
rubygems_version: 3.6.7
|
358
358
|
specification_version: 4
|
359
359
|
summary: A set of tools for building reliable services of any complexity
|
360
360
|
test_files: []
|