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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93580bb5b39ff35b25715174887abea69fccf773
4
- data.tar.gz: fe2bface702fde07f2277b3365a6f14ac8078e64
3
+ metadata.gz: eb1c2e88da0bcf522a38391e45af4b9c67a48c2f
4
+ data.tar.gz: b9cdb19be15670a567413623d4cc65912885ec17
5
5
  SHA512:
6
- metadata.gz: 625874e1ba9ae52f5eec44d9dd11a943b8b4293ea25a5738ba387b9f0ba193d0964d56b70c6e95d6855b260dac05b5b47e2494250074d785d4a94ca7f5ba580b
7
- data.tar.gz: 4b99b3a43db8bdd36b2fa8e00b883bef2f21c6c3aa91566e1cbb0502aa584febbba932d4b5b1d076aa29893e647748a6517f78213414acf24038c219ca78e969
6
+ metadata.gz: 957878bf744e5c4876c8bf978803bd547f1102c0232cb0f4a7ccce65165bb8808b96c5e440eccdea28be32f238dea15d732893d84dda3578fac23d027bde0301
7
+ data.tar.gz: 5c69bf4a5b696e9d4fa87bf0f1e94918b688aa7ffefeade4ff9540c79037f054491fb6f98542e47d099e840578fcc21b1da4d7aaf4049f27b55bc2bf0d9820db
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ gemspec
7
7
 
8
8
  group 'development' do
9
9
  gem 'guard-rspec', require: false
10
+ gem 'overcommit'
10
11
  end
11
12
 
12
13
  group 'test' do
@@ -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!(ARG_HAS_QUESTION_MARK_REGEX, "\\1{#{question_mark_params_param}}\\2")
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
 
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '5.1.1'
3
+ VERSION = '5.1.2'
4
4
  end
5
5
  end
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.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-21 00:00:00.000000000 Z
11
+ date: 2015-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty