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 +4 -4
- data/lib/featury/actions/service/factory.rb +18 -22
- data/lib/featury/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e320b9500461bb0a53b488f1df9bab28a0ef08807d399b422687e6e4595d48b
|
4
|
+
data.tar.gz: c342e87a64fc3ac24638ccd1fe3f54a9086b8feca88068d8d312331937864fc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
54
|
-
|
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
|
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
|
-
|
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
|
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
|
-
|
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
|
data/lib/featury/version.rb
CHANGED
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.
|
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-
|
10
|
+
date: 2025-02-20 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activesupport
|