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.
@@ -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/PredicateName
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/PredicateName
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
 
@@ -20,7 +20,7 @@ module Servactory
20
20
  common_condition_with(...)
21
21
  end
22
22
 
23
- def common_condition_with(value:, option:, **)
23
+ def common_condition_with(value:, option:, **) # rubocop:disable Naming/PredicateMethod
24
24
  case value
25
25
  when Integer
26
26
  value <= option.value
@@ -20,7 +20,7 @@ module Servactory
20
20
  common_condition_with(...)
21
21
  end
22
22
 
23
- def common_condition_with(value:, option:, **)
23
+ def common_condition_with(value:, option:, **) # rubocop:disable Naming/PredicateMethod
24
24
  case value
25
25
  when Integer
26
26
  value >= option.value
@@ -29,7 +29,8 @@ module Servactory
29
29
  common_condition_with(attribute: output, value:, option:)
30
30
  end
31
31
 
32
- def common_condition_with(attribute:, value:, option:) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
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)
@@ -3,9 +3,9 @@
3
3
  module Servactory
4
4
  module VERSION
5
5
  MAJOR = 2
6
- MINOR = 14
6
+ MINOR = 15
7
7
  PATCH = 0
8
- PRE = nil
8
+ PRE = "rc1"
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
11
11
  end
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.14.0
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: 2025-04-21 00:00:00.000000000 Z
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.2
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: []