neo4j-core 5.1.1 → 5.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/lib/neo4j-core/query_clauses.rb +5 -3
- data/lib/neo4j-core/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: eb1c2e88da0bcf522a38391e45af4b9c67a48c2f
|
4
|
+
data.tar.gz: b9cdb19be15670a567413623d4cc65912885ec17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 957878bf744e5c4876c8bf978803bd547f1102c0232cb0f4a7ccce65165bb8808b96c5e440eccdea28be32f238dea15d732893d84dda3578fac23d027bde0301
|
7
|
+
data.tar.gz: 5c69bf4a5b696e9d4fa87bf0f1e94918b688aa7ffefeade4ff9540c79037f054491fb6f98542e47d099e840578fcc21b1da4d7aaf4049f27b55bc2bf0d9820db
|
data/Gemfile
CHANGED
@@ -264,6 +264,8 @@ module Neo4j
|
|
264
264
|
class WhereClause < Clause
|
265
265
|
KEYWORD = 'WHERE'
|
266
266
|
|
267
|
+
PAREN_SURROUND_REGEX = /^\s*\(.+\)\s*$/
|
268
|
+
|
267
269
|
def from_key_and_value(key, value, previous_keys = [])
|
268
270
|
case value
|
269
271
|
when Hash then hash_key_value_string(key, value, previous_keys)
|
@@ -279,7 +281,7 @@ module Neo4j
|
|
279
281
|
def clause_strings(clauses)
|
280
282
|
clauses.flat_map do |clause|
|
281
283
|
Array(clause.value).map do |v|
|
282
|
-
(clause.options[:not] ? 'NOT' : '') + "(#{v})"
|
284
|
+
(clause.options[:not] ? 'NOT' : '') + (v.to_s.match(PAREN_SURROUND_REGEX) ? v.to_s : "(#{v})")
|
283
285
|
end
|
284
286
|
end
|
285
287
|
end
|
@@ -314,7 +316,7 @@ module Neo4j
|
|
314
316
|
end
|
315
317
|
|
316
318
|
class << self
|
317
|
-
ARG_HAS_QUESTION_MARK_REGEX = /(^|\s)\?(\s|$)/
|
319
|
+
ARG_HAS_QUESTION_MARK_REGEX = /(^|\(|\s)\?(\s|\)|$)/
|
318
320
|
|
319
321
|
def from_args(args, options = {})
|
320
322
|
query_string, params = args
|
@@ -322,7 +324,7 @@ module Neo4j
|
|
322
324
|
if query_string.is_a?(String) && (query_string.match(ARG_HAS_QUESTION_MARK_REGEX) || params.is_a?(Hash))
|
323
325
|
if !params.is_a?(Hash)
|
324
326
|
question_mark_params_param = self.question_mark_params_param
|
325
|
-
query_string.gsub
|
327
|
+
query_string = query_string.gsub(ARG_HAS_QUESTION_MARK_REGEX, "\\1{#{question_mark_params_param}}\\2")
|
326
328
|
params = {question_mark_params_param.to_sym => params}
|
327
329
|
end
|
328
330
|
|
data/lib/neo4j-core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Ronge, Chris Grigg, Brian Underwood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|