ruy 2.0.0 → 2.0.1
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.
- checksums.yaml +8 -8
- data/lib/ruy/conditions.rb +1 -1
- data/lib/ruy/conditions/{in.rb → belong.rb} +4 -4
- data/lib/ruy/dsl.rb +7 -7
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjJkZmI0ZDQ4YTQ5MmQ2NDBlZmM0MmM4MjM0ODliNGViMGFiY2MxMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Yjk4NWI5MmYyMmIzNTBiMDJjNGMzNmIxZTRhOTE4NGU3NWNiOTQxNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjY1ZWE4Mjc5OWUwMzkzMWFhODRhZjUyNWQ0ZDZjYjc2MGZhMDJiNmQzMWZi
|
10
|
+
ZTZhMzFiZDhkMTA5M2M3MWQ3MGMyYmNhNDM2Mzk3NTI4YTUwNTE2NzVjYmQ5
|
11
|
+
OTlmMWJmYzJiYjgyYzNhZTM2NWRkODI1OWE3ZWExNjQ3YWM0ODc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjEzZGIzMWQ4NTIzNWE4NDJkY2Q3MWVlNTE2NDc5Yjk3NWU2MWI3YTJiMmQz
|
14
|
+
ZjYxMGQ1OWVhODgyM2FkNGQxOTM2NjJmMGIyZTAwZjg5MGQxZTY0MTFkYTYw
|
15
|
+
NjYzNzI2ZjRhOWNkN2U1ZmQwNzk0YzBkZTQ1NThiODA2OWU5ODc=
|
data/lib/ruy/conditions.rb
CHANGED
@@ -3,6 +3,7 @@ require_relative 'conditions/compound_condition'
|
|
3
3
|
require_relative 'conditions/all'
|
4
4
|
require_relative 'conditions/any'
|
5
5
|
require_relative 'conditions/assert'
|
6
|
+
require_relative 'conditions/belong'
|
6
7
|
require_relative 'conditions/between'
|
7
8
|
require_relative 'conditions/in_cyclic_order'
|
8
9
|
require_relative 'conditions/cond'
|
@@ -13,7 +14,6 @@ require_relative 'conditions/every'
|
|
13
14
|
require_relative 'conditions/except'
|
14
15
|
require_relative 'conditions/greater_than'
|
15
16
|
require_relative 'conditions/greater_than_or_equal'
|
16
|
-
require_relative 'conditions/in'
|
17
17
|
require_relative 'conditions/include'
|
18
18
|
require_relative 'conditions/less_than'
|
19
19
|
require_relative 'conditions/less_than_or_equal'
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module Ruy
|
2
2
|
module Conditions
|
3
3
|
|
4
|
-
# Expects that a context attribute
|
4
|
+
# Expects that a context attribute belongs to a set of values
|
5
5
|
#
|
6
|
-
class
|
6
|
+
class Belong < Condition
|
7
7
|
attr_reader :ary
|
8
8
|
|
9
9
|
# @param ary
|
10
10
|
# @param key
|
11
11
|
# @example check that :key is included in [1,3,5]
|
12
|
-
#
|
12
|
+
# Belong.new([1,3,5], :key)
|
13
13
|
def initialize(ary, *key)
|
14
14
|
super
|
15
15
|
@ary = ary
|
@@ -17,7 +17,7 @@ module Ruy
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def ==(o)
|
20
|
-
o.kind_of?(
|
20
|
+
o.kind_of?(Belong) &&
|
21
21
|
o.ary == @ary &&
|
22
22
|
o.key == @key
|
23
23
|
end
|
data/lib/ruy/dsl.rb
CHANGED
@@ -28,6 +28,13 @@ module Ruy
|
|
28
28
|
self.conditions << Conditions::Assert.new(*attrs)
|
29
29
|
end
|
30
30
|
|
31
|
+
# Adds a Belong condition.
|
32
|
+
#
|
33
|
+
# @param (see Conditions::Belong#initialize)
|
34
|
+
def belong(values, *attrs)
|
35
|
+
self.conditions << Conditions::Belong.new(values, *attrs)
|
36
|
+
end
|
37
|
+
|
31
38
|
# Adds a Between condition.
|
32
39
|
#
|
33
40
|
# @param (see Conditions::Between#initialize)
|
@@ -95,13 +102,6 @@ module Ruy
|
|
95
102
|
self.conditions << Conditions::GreaterThanOrEqual.new(value, *attrs)
|
96
103
|
end
|
97
104
|
|
98
|
-
# Adds an In condition.
|
99
|
-
#
|
100
|
-
# @param (see Conditions::Include#initialize)
|
101
|
-
def in(values, *attrs)
|
102
|
-
self.conditions << Conditions::In.new(values, *attrs)
|
103
|
-
end
|
104
|
-
|
105
105
|
# Adds a InCyclicOrder condition.
|
106
106
|
#
|
107
107
|
# @param (see Conditions::InCyclicOrder#initialize)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moove-IT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tzinfo
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- lib/ruy/conditions/all.rb
|
67
67
|
- lib/ruy/conditions/any.rb
|
68
68
|
- lib/ruy/conditions/assert.rb
|
69
|
+
- lib/ruy/conditions/belong.rb
|
69
70
|
- lib/ruy/conditions/between.rb
|
70
71
|
- lib/ruy/conditions/compound_condition.rb
|
71
72
|
- lib/ruy/conditions/cond.rb
|
@@ -77,7 +78,6 @@ files:
|
|
77
78
|
- lib/ruy/conditions/except.rb
|
78
79
|
- lib/ruy/conditions/greater_than.rb
|
79
80
|
- lib/ruy/conditions/greater_than_or_equal.rb
|
80
|
-
- lib/ruy/conditions/in.rb
|
81
81
|
- lib/ruy/conditions/in_cyclic_order.rb
|
82
82
|
- lib/ruy/conditions/include.rb
|
83
83
|
- lib/ruy/conditions/less_than.rb
|