eight_ball 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/eight_ball/conditions/base.rb +13 -0
- data/lib/eight_ball/conditions/list.rb +6 -0
- data/lib/eight_ball/conditions/range.rb +6 -0
- data/lib/eight_ball/feature.rb +9 -0
- data/lib/eight_ball/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: 521486fba75fc1996224ec260d22ed00860955da71941256452cb910adb3539d
|
4
|
+
data.tar.gz: 2c905caa109755024226a5ae088c9731ee7349930e423bf76a5d96de057e2b2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9265bc7abf5060158f14ba9b42e9945a618fc4fb94c6f97b946228927fa37f8638fc5e9f014340aa4e03698edf00df39d24f3ef58bd2087dda0f15162ea59a3
|
7
|
+
data.tar.gz: c55f4e5fc008e92bc1b70a6c5d02efe5af600c59834aa35bbf850ccab0fd2d89c427ee16ca1931bc781009e4cc57b0ed6ac358f8632d81f55520d0aac0dccddc
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -12,8 +12,21 @@ module EightBall::Conditions
|
|
12
12
|
raise 'You can never satisfy the Base condition'
|
13
13
|
end
|
14
14
|
|
15
|
+
def ==(other)
|
16
|
+
other.class == self.class && other.state == state
|
17
|
+
end
|
18
|
+
alias eql? ==
|
19
|
+
|
20
|
+
def hash
|
21
|
+
state.hash
|
22
|
+
end
|
23
|
+
|
15
24
|
protected
|
16
25
|
|
26
|
+
def state
|
27
|
+
[@parameter]
|
28
|
+
end
|
29
|
+
|
17
30
|
def parameter=(parameter)
|
18
31
|
return if parameter.nil?
|
19
32
|
|
data/lib/eight_ball/feature.rb
CHANGED
@@ -48,6 +48,15 @@ module EightBall
|
|
48
48
|
any_satisfied?(@enabled_for, parameters) && !any_satisfied?(@disabled_for, parameters)
|
49
49
|
end
|
50
50
|
|
51
|
+
def ==(other)
|
52
|
+
name == other.name &&
|
53
|
+
enabled_for.size == other.enabled_for.size &&
|
54
|
+
enabled_for.all? { |condition| other.enabled_for.any? { |other_condition| condition == other_condition } } &&
|
55
|
+
disabled_for.size == other.disabled_for.size &&
|
56
|
+
disabled_for.all? { |condition| other.disabled_for.any? { |other_condition| condition == other_condition } }
|
57
|
+
end
|
58
|
+
alias eql? ==
|
59
|
+
|
51
60
|
private
|
52
61
|
|
53
62
|
def any_satisfied?(conditions, parameters)
|
data/lib/eight_ball/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eight_ball
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rewind.io
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awrence
|