neo4j-core 7.0.0.alpha.3 → 7.0.0.alpha.4

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: 8e69d6a3474ef2e057ce91015f3dcf2882b0d711
4
- data.tar.gz: ff82a54d57df258f33d485c92f4d9af6f8209220
3
+ metadata.gz: befbd7791bec91114c4caa5ea26b15a5e6e1acd0
4
+ data.tar.gz: 2a2685bfa367c45fb5c778105789da69d6faa742
5
5
  SHA512:
6
- metadata.gz: 0f56a085cfe83029f16b466a9b06babdfc57a33908cd39c129a8d0201238c11f247d6b4869b580788573e2b8ae054f4f0c9d83a98f3b89f9a0a6241353cc644b
7
- data.tar.gz: 4b6465780ac28f61383e543dcffa818cd17b0e6846fd67668126d9a286c620fba4f3c93f4dba35be7c9a6b4cd4c6c1fea1625bb20d8bfc314af94cd1f7dc75c9
6
+ metadata.gz: a54152396e166a7ae7a327d90b7ab37691d9ddbe538762c983f1edeb78bb9714db755c36cbcee4c747c4d53406455b666c7937144ea9939bbc552e0a4feb0737
7
+ data.tar.gz: 5a32754520b47dd004511a2e4db91916fafe7250d8c4cd1d0463721a756107e480c12a570747f05071bc94ee2859d369c9dfdc682f177972729885e2cdd7c230
@@ -17,6 +17,8 @@ module Neo4j
17
17
 
18
18
  def connect
19
19
  @requestor = Requestor.new(@url, USER_AGENT_STRING, self.class.method(:instrument_request))
20
+ rescue Faraday::ConnectionFailed => e
21
+ raise CypherSession::ConnectionFailedError, "#{e.class}: #{e.message}"
20
22
  end
21
23
 
22
24
  ROW_REST = %w(row REST)
@@ -39,6 +39,7 @@ ERROR
39
39
  module SchemaErrors
40
40
  class ConstraintValidationFailedError < CypherError; end
41
41
  end
42
+ class ConnectionFailedError < StandardError; end
42
43
 
43
44
  module Adaptors
44
45
  MAP = {}
@@ -16,6 +16,7 @@ module Neo4j
16
16
  include Neo4j::Core::QueryFindInBatches
17
17
  DEFINED_CLAUSES = {}
18
18
 
19
+
19
20
  attr_accessor :clauses
20
21
 
21
22
  class Parameters
@@ -217,7 +218,7 @@ module Neo4j
217
218
  # Query.new.match('(q: Person {id: {id}})').params(id: 12)
218
219
  #
219
220
  def params(args)
220
- copy.tap { |new_query| new_query.instance_variable_get('@params').add_params(args) }
221
+ copy.tap { |new_query| new_query.instance_variable_get('@params'.freeze).add_params(args) }
221
222
  end
222
223
 
223
224
  def unwrapped
@@ -397,9 +398,9 @@ module Neo4j
397
398
  def copy
398
399
  dup.tap do |query|
399
400
  to_cypher
400
- query.instance_variable_set('@params', @params.copy)
401
- query.instance_variable_set('@partitioned_clauses', nil)
402
- query.instance_variable_set('@response', nil)
401
+ query.instance_variable_set('@params'.freeze, @params.copy)
402
+ query.instance_variable_set('@partitioned_clauses'.freeze, nil)
403
+ query.instance_variable_set('@response'.freeze, nil)
403
404
  end
404
405
  end
405
406
 
@@ -425,7 +426,7 @@ module Neo4j
425
426
  def build_deeper_query(clause_class, args = {}, options = {})
426
427
  copy.tap do |new_query|
427
428
  new_query.add_clauses [nil] if [nil, WithClause].include?(clause_class)
428
- new_query.add_clauses clause_class.from_args(args, new_query.instance_variable_get('@params'), options) if clause_class
429
+ new_query.add_clauses clause_class.from_args(args, new_query.instance_variable_get('@params'.freeze), options) if clause_class
429
430
  end
430
431
  end
431
432
 
@@ -13,6 +13,7 @@ module Neo4j
13
13
  UNDERSCORE = '_'
14
14
  COMMA_SPACE = ', '
15
15
  AND = ' AND '
16
+ PRETTY_NEW_LINE = "\n "
16
17
 
17
18
  attr_accessor :params, :arg
18
19
  attr_reader :options, :param_vars_added
@@ -148,11 +149,12 @@ module Neo4j
148
149
  end
149
150
 
150
151
  def clause_string(clauses, pretty)
151
- join_string = clause_join + (pretty ? "\n " : '')
152
+ join_string = pretty ? clause_join + PRETTY_NEW_LINE : clause_join
152
153
 
153
154
  strings = clause_strings(clauses)
154
- string = ((pretty && strings.size > 1) ? "\n " : '')
155
- string + strings.join(join_string).strip
155
+ stripped_string = strings.join(join_string)
156
+ stripped_string.strip!
157
+ (pretty && strings.size > 1) ? PRETTY_NEW_LINE + stripped_string : stripped_string
156
158
  end
157
159
 
158
160
  def clause_join
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '7.0.0.alpha.3'
3
+ VERSION = '7.0.0.alpha.4'
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: 7.0.0.alpha.3
4
+ version: 7.0.0.alpha.4
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: 2016-08-04 00:00:00.000000000 Z
11
+ date: 2016-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday