featury 1.0.0.rc7 → 1.0.0.rc9

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: 1522d4964ade14279e3d80cd642467e9adfd97cfcb6c707338daec190c2b5c70
4
- data.tar.gz: e79b1c3e707f71c4bd68fcca458e785a9075a1599a02b9b135f0849da29eb0a8
3
+ metadata.gz: 6e320b9500461bb0a53b488f1df9bab28a0ef08807d399b422687e6e4595d48b
4
+ data.tar.gz: c342e87a64fc3ac24638ccd1fe3f54a9086b8feca88068d8d312331937864fc8
5
5
  SHA512:
6
- metadata.gz: a29e826900541ef82f730670bee43146ca0460ae0e2383ba4744fd12ce8829e42ab73ba8e6216a2357b710574bde3e56a9b7efe326c252e175cd8df6e1726007
7
- data.tar.gz: 44ca9a9bfc65266304327fed24bd9137aec8bc1824eb0317fa0f25ca2d680c4cedc6b5cee77c0fe2ba17dfc84fbef66cedf818ff7c60c12dd0a09fc257100103
6
+ metadata.gz: 573accd6459220930d6cd1c3daa8b02f0d2982927dff4bb003fc7f9e9a1ce5ed3e09105d5b4743f8afa3b8d0eb0e13322faea022008e7aee9f86775f03ed0841
7
+ data.tar.gz: cef4b50a8bbc55897a76a09a45d93edeb7807b6174af2a5d166654e813a9804711d9ae82437b0e1701d95b87c1c45c11cc551abe3a692b667ae53fd1209e8d97
@@ -36,51 +36,47 @@ module Featury
36
36
  input :collection_of_features, type: Featury::Features::Collection
37
37
  input :collection_of_groups, type: Featury::Groups::Collection
38
38
 
39
- internal :conditions_are_true, type: [TrueClass, FalseClass]
40
- internal :features_are_true, type: [TrueClass, FalseClass]
41
- internal :groups_are_true, type: [TrueClass, FalseClass]
42
-
43
39
  output :all_true, type: [TrueClass, FalseClass]
44
40
 
45
- check :conditions
46
- check :features
47
- check :groups
48
-
49
41
  check :all
50
42
 
51
43
  private
52
44
 
53
- def check_conditions
54
- internals.conditions_are_true = inputs.collection_of_conditions.all? do |condition|
45
+ def check_all
46
+ outputs.all_true = conditions_are_true
47
+ return unless outputs.all_true
48
+
49
+ outputs.all_true = features_are_true
50
+ return unless outputs.all_true
51
+
52
+ outputs.all_true = groups_are_true
53
+ end
54
+
55
+ ####################################################################
56
+
57
+ def conditions_are_true
58
+ inputs.collection_of_conditions.all? do |condition|
55
59
  condition.block.call(resources: inputs)
56
60
  end
57
61
  end
58
62
 
59
- def check_features # rubocop:disable Metrics/AbcSize
63
+ def features_are_true
60
64
  options = inputs.collection_of_resources.only_option.to_h do |resource|
61
65
  [resource.name, inputs.public_send(resource.name)]
62
66
  end
63
67
 
64
- internals.features_are_true =
65
- inputs.action.block.call(features: inputs.collection_of_features.list, **options)
68
+ inputs.action.block.call(features: inputs.collection_of_features.list, **options)
66
69
  end
67
70
 
68
- def check_groups # rubocop:disable Metrics/AbcSize
71
+ def groups_are_true
69
72
  arguments = inputs.collection_of_resources.only_nested.to_h do |resource|
70
73
  [resource.name, inputs.public_send(resource.name)]
71
74
  end
72
75
 
73
- internals.groups_are_true = inputs.collection_of_groups.all? do |group|
76
+ inputs.collection_of_groups.all? do |group|
74
77
  group.group.public_send(inputs.action.name, **arguments)
75
78
  end
76
79
  end
77
-
78
- def check_all
79
- outputs.all_true =
80
- internals.conditions_are_true &&
81
- internals.features_are_true &&
82
- internals.groups_are_true
83
- end
84
80
  end
85
81
  end
86
82
  end
@@ -5,7 +5,7 @@ module Featury
5
5
  MAJOR = 1
6
6
  MINOR = 0
7
7
  PATCH = 0
8
- PRE = "rc7"
8
+ PRE = "rc9"
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
11
11
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: featury
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc7
4
+ version: 1.0.0.rc9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Sokolov
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-08 00:00:00.000000000 Z
10
+ date: 2025-02-20 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -192,7 +191,6 @@ metadata:
192
191
  bug_tracker_uri: https://github.com/servactory/featury/issues
193
192
  changelog_uri: https://github.com/servactory/featury/blob/master/CHANGELOG.md
194
193
  rubygems_mfa_required: 'true'
195
- post_install_message:
196
194
  rdoc_options: []
197
195
  require_paths:
198
196
  - lib
@@ -207,8 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
205
  - !ruby/object:Gem::Version
208
206
  version: '0'
209
207
  requirements: []
210
- rubygems_version: 3.5.22
211
- signing_key:
208
+ rubygems_version: 3.6.2
212
209
  specification_version: 4
213
210
  summary: A set of tools for building reliable services of any complexity
214
211
  test_files: []