featury 1.0.0.rc8 → 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: 201bfafa1c5c535c36980e60a29e9d5e3228330386c84fc36926b99992481050
4
- data.tar.gz: 267bf926a5f57d734ac0714f24af0bd87dc11ba4dfb77b768ac0bfa464719e2d
3
+ metadata.gz: 6e320b9500461bb0a53b488f1df9bab28a0ef08807d399b422687e6e4595d48b
4
+ data.tar.gz: c342e87a64fc3ac24638ccd1fe3f54a9086b8feca88068d8d312331937864fc8
5
5
  SHA512:
6
- metadata.gz: c8c3deaa91faf85292cad10a0295af1396739859a890449a9bff78a47f05010d22d681efc3b7759ca5acdd1d7855e4a9a5a7c9a15ac1fb5f008b6df7ee49bda2
7
- data.tar.gz: addc261eba38e98918fa64f22c5f0288716b6ff9995ab179cfb5ff8943164f821ab6539c4363b93ec7ebba0b2f2f7d9e4f7f4e079aa57c467ab63ea46514c0c5
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 = "rc8"
8
+ PRE = "rc9"
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: featury
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc8
4
+ version: 1.0.0.rc9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Sokolov
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-19 00:00:00.000000000 Z
10
+ date: 2025-02-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport