ruby-montage 1.1.0 → 1.2.0
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 +4 -4
- data/Rakefile +1 -0
- data/lib/montage/operators/gt.rb +1 -1
- data/lib/montage/operators/gte.rb +1 -1
- data/lib/montage/operators/ilike.rb +1 -1
- data/lib/montage/operators/in.rb +1 -1
- data/lib/montage/operators/includes.rb +1 -1
- data/lib/montage/operators/intersects.rb +1 -1
- data/lib/montage/operators/like.rb +1 -1
- data/lib/montage/operators/lt.rb +1 -1
- data/lib/montage/operators/lte.rb +1 -1
- data/lib/montage/operators/not.rb +1 -1
- data/lib/montage/operators/not_in.rb +1 -1
- data/lib/montage/operators.rb +1 -1
- data/lib/montage/query/query_parser.rb +6 -6
- data/lib/montage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ad2f36315b6d08ab4b631d6294d0e16adb48077
|
4
|
+
data.tar.gz: 04447618fc62e0776b7ba47e20574cc441720953
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5c8e150825baba19131a674920349f2e3a5baa80ec451a18b529b961776bdcd2c38950023122dc6343909ff6e0d9ecefa4413fd3896326f8b2b21376c764461
|
7
|
+
data.tar.gz: daf00f4f90bd696947774f0aaa8cee3557f76efd9c3f73d548f3787fae8cfb610c208c5ed390ca606c611df1a9c04ac32844ddddfd8c49afcfa8d5dc594bd1e5
|
data/Rakefile
CHANGED
data/lib/montage/operators/gt.rb
CHANGED
data/lib/montage/operators/in.rb
CHANGED
data/lib/montage/operators/lt.rb
CHANGED
data/lib/montage/operators.rb
CHANGED
@@ -55,7 +55,7 @@ module Montage
|
|
55
55
|
# * *Examples* :
|
56
56
|
# @part = "tree_happiness_level > 9"
|
57
57
|
# get_query_operator(@part)
|
58
|
-
# => [">", "
|
58
|
+
# => [">", "$gt"]
|
59
59
|
#
|
60
60
|
def get_query_operator(part)
|
61
61
|
operator = Montage::Operators.find_operator(part)
|
@@ -79,7 +79,7 @@ module Montage
|
|
79
79
|
end
|
80
80
|
|
81
81
|
# Parse a single portion of the query string. String values representing
|
82
|
-
# a float or
|
82
|
+
# a float or integer are coerced into actual numerical values. Newline
|
83
83
|
# characters are removed and single quotes are replaced with double quotes
|
84
84
|
#
|
85
85
|
# * *Args* :
|
@@ -120,7 +120,7 @@ module Montage
|
|
120
120
|
# * *Examples* :
|
121
121
|
# @part = "tree_happiness_level > 9"
|
122
122
|
# get_parts(@part)
|
123
|
-
# => ["tree_happiness_level", "
|
123
|
+
# => ["tree_happiness_level", "$gt", 9]
|
124
124
|
#
|
125
125
|
def get_parts(str)
|
126
126
|
operator, montage_operator = get_query_operator(str)
|
@@ -147,8 +147,8 @@ module Montage
|
|
147
147
|
#
|
148
148
|
def parse_hash
|
149
149
|
query.map do |key, value|
|
150
|
-
|
151
|
-
[
|
150
|
+
new_value = value.is_a?(Array) ? ["$in", value] : value
|
151
|
+
[key.to_s, new_value]
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
@@ -169,7 +169,7 @@ module Montage
|
|
169
169
|
if operator == ""
|
170
170
|
["#{column_name}", value]
|
171
171
|
else
|
172
|
-
["#{column_name}", ["
|
172
|
+
["#{column_name}", ["#{operator}", value]]
|
173
173
|
end
|
174
174
|
end
|
175
175
|
end
|
data/lib/montage/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-montage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dphaener
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|