CloudSesame 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/cloud_sesame.gemspec +1 -1
- data/lib/cloud_sesame/query/ast/range_value.rb +1 -1
- data/lib/cloud_sesame/query/ast/value.rb +1 -1
- data/lib/cloud_sesame/query/dsl/block_methods.rb +5 -1
- data/lib/cloud_sesame/query/dsl/field_array_methods.rb +11 -8
- data/lib/cloud_sesame/query/dsl/scope_methods.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee2f110af5801dc881dfc3066166ad65481bc9db
|
4
|
+
data.tar.gz: 981fc6f70346fb0f0cc89842d34c0ab27a0bf918
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52fbacfb8507b86e22fb01dd10440249ef38ba4305ce83c2aaa348b5f1d447af093b1f5f0184868e22f07e583f6552108a5792ea749520171def79496380b61a
|
7
|
+
data.tar.gz: 082924caf18ca846469bf1e9957a0dbb27b192c2445db8f001724e9137b74cbef7aa323a3ce5def4d4e954f4352c9c099342f1e5e49e792183cafcf2f19b7e97
|
data/Gemfile.lock
CHANGED
data/cloud_sesame.gemspec
CHANGED
@@ -4,7 +4,7 @@ module CloudSesame
|
|
4
4
|
class RangeValue < Value
|
5
5
|
|
6
6
|
def initialize(range = nil)
|
7
|
-
@data = range
|
7
|
+
@data = range.kind_of?(Range) ? [true, valufy(range.begin), valufy(range.end), !range.exclude_end?] : [false, nil, nil, false]
|
8
8
|
end
|
9
9
|
|
10
10
|
def compile
|
@@ -31,10 +31,14 @@ module CloudSesame
|
|
31
31
|
dsl_scope << node
|
32
32
|
dsl_return node
|
33
33
|
else
|
34
|
-
|
34
|
+
return_chaining_relation(node)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
def return_chaining_relation(node)
|
39
|
+
AST::BlockChainingRelation.new(dsl_scope, dsl_return, node)
|
40
|
+
end
|
41
|
+
|
38
42
|
end
|
39
43
|
end
|
40
44
|
end
|
@@ -38,13 +38,7 @@ module CloudSesame
|
|
38
38
|
|
39
39
|
def insert(values = [])
|
40
40
|
values.each do |value|
|
41
|
-
|
42
|
-
parents.compact.each do |parent|
|
43
|
-
node = parent[:klass].new dsl_context, parent[:options]
|
44
|
-
node << child
|
45
|
-
child = node
|
46
|
-
end
|
47
|
-
dsl_scope << child
|
41
|
+
dsl_scope << create_parents(build_literal(value))
|
48
42
|
end
|
49
43
|
parents.clear unless values.empty?
|
50
44
|
dsl_return != dsl_scope ? dsl_return : self
|
@@ -56,7 +50,16 @@ module CloudSesame
|
|
56
50
|
values[-1].is_a?(Hash) ? values.delete_at(-1) : {}
|
57
51
|
end
|
58
52
|
|
59
|
-
def
|
53
|
+
def create_parents(child)
|
54
|
+
parents.compact.each do |parent|
|
55
|
+
node = parent[:klass].new dsl_context, parent[:options]
|
56
|
+
node << child
|
57
|
+
child = node
|
58
|
+
end
|
59
|
+
child
|
60
|
+
end
|
61
|
+
|
62
|
+
def build_literal(value)
|
60
63
|
if value.kind_of?(AST::SingleExpressionOperator) || value.is_a?(AST::Literal)
|
61
64
|
value.is_for field, field_options
|
62
65
|
value
|