hash_conditions 0.1.19 → 1.1.20
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/hash_conditions/core.rb +5 -0
- data/lib/hash_conditions/matcher.rb +4 -0
- data/lib/hash_conditions/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDMwYWRhYWIzOGNhZDFkOWUzZTgyOWQxYTczMzJlZGY3M2FmOGQ1OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTU2YzNjM2QxOTg3YzlhMjk2M2FlNjAyOTAyMmVjYTQ4ZjBmNGQwNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDAzZTY3NTkzMDA5OGMwYmFlNDc4MmZhMTE1MmFlNDhmNTM1OGEyNzdmY2M0
|
10
|
+
ZjJkZjY1MjIwZDFhMDcyYTVkNzA3NDgyMDJkODcyYjgyNjdhNWM4YzM2ZTg2
|
11
|
+
MjM1NjkyM2YxYjk4NDUyNmE4YTNiNzU3YWMwYzMzOTUxYjg1YWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGM0NDFkNDhiZjQ1ZThjOGQyZDIzNDRjZjMzNWRlMzkyMDQyNTQ4MWM5MTQy
|
14
|
+
MzkwZjQ3NWE1NTY5ZjFjZWY5NmYzNDk4OTg5Nzg1OTg1ZTc5OTUyM2NkZGE4
|
15
|
+
MDgxYjkzN2M5YTZiMzRiNmQyY2EyMjU5YzJhYzk1M2E5ZTU3MWQ=
|
data/lib/hash_conditions/core.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module HashConditions
|
2
2
|
module Core
|
3
3
|
# Modular Matchers
|
4
|
+
DEBUG=false
|
4
5
|
ARITMETIC_OPERATORS = {
|
5
6
|
'$add' => :+,
|
6
7
|
'$substract' => :-,
|
@@ -207,5 +208,9 @@ module HashConditions
|
|
207
208
|
else raise "return data of type #{ parser_output.class } not supported"
|
208
209
|
end
|
209
210
|
end
|
211
|
+
|
212
|
+
def log *args
|
213
|
+
puts *args if(DEBUG)
|
214
|
+
end
|
210
215
|
end
|
211
216
|
end
|
@@ -49,9 +49,13 @@ module HashConditions
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def self.match_single hash, expression, options
|
52
|
+
log "Matching:", expression
|
52
53
|
hash_value = eval_operand hash, expression[:key], options.merge(is_key: true)
|
53
54
|
comparisson_value = eval_operand hash, expression[ :value ], options
|
54
55
|
|
56
|
+
log "Left:", hash_value
|
57
|
+
log "Right:", comparisson_value
|
58
|
+
|
55
59
|
case expression[:operator]
|
56
60
|
when :==
|
57
61
|
if configuration( :force_string_comparations )
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hash_conditions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giancarlo Palavicini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|