neo4j-ruby-driver 0.4.0 → 1.7.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
  SHA256:
3
- metadata.gz: 013cc0d22828c049d4a90f6c6acfa84e169813c5b77f0b6e5cf230c3c92a473e
4
- data.tar.gz: 146b0148e2481b26f0d4e1102e67ecba7c77059b04dbacb6147de252f491558b
3
+ metadata.gz: 73e017d0ba7cbb58f6ab2ef0e4118e33e81bca173483ec8b28a60fe21ffa5d9e
4
+ data.tar.gz: eb314a4ad5450cac37dca70dac4ff6e2171d4f8067a094baa112d93e102d788b
5
5
  SHA512:
6
- metadata.gz: 47bc1f429a86d57c24cab73f5001fe45cc41df384b571e72373a3315ecd0c1ae5fd95139975b7404fd358cfd9227dfebb87aab5dd49139208e92597de839155f
7
- data.tar.gz: ab623a015d5256273ee7939ba9557296aa0b8343186cb740bc77a32161a453835a9dadebcad318384c501a7834127c7a7e6c776bf38fc3c96271994fa3270928
6
+ metadata.gz: 8a9548471d5962bf3d53bf0a5fd48ef0a04753a4fa41f5cf19d2038ebebc8e375159b364465f6bd03c00197add59b04c8eddd905fa33aeccc1fe0f9726da36f1
7
+ data.tar.gz: 7ad0bdfaaa1f202f86b102a95a3d12cb50c65e64fd3e941fe2c780f4b6cdf87b01428874ec15d6c8eb60fe43c844c94751fe7be0f738ecfd3abb1cc1cec2a3a0
@@ -41,6 +41,7 @@ end
41
41
 
42
42
  require 'active_support/concern'
43
43
  require 'active_support/core_ext/array/grouping'
44
+ require 'active_support/logger'
44
45
  require 'concurrent/atomic/atomic_boolean'
45
46
  require 'concurrent/atomic/atomic_reference'
46
47
  require 'ffi'
@@ -44,7 +44,7 @@ module Neo4j
44
44
  scheme = (uris.map(&method(:URI)).map(&:scheme) - VALID_ROUTING_SCHEMES).first
45
45
  return unless scheme
46
46
  raise ArgumentError,
47
- "Illegal URI scheme, expected URI scheme '#{scheme}' to be among [#{VALID_ROUTING_SCHEMES.join ', '}]"
47
+ "Illegal URI scheme, expected URI scheme '#{scheme}' to be among '[#{VALID_ROUTING_SCHEMES.join ', '}]'"
48
48
  end
49
49
  end
50
50
  end
@@ -82,7 +82,11 @@ module Neo4j
82
82
  end
83
83
 
84
84
  def throw(error)
85
- on_failure(error)
85
+ if @failure
86
+ error.add_suppressed(@failure)
87
+ else
88
+ on_failure(error)
89
+ end
86
90
  raise error
87
91
  end
88
92
 
@@ -61,12 +61,11 @@ module Neo4j
61
61
  end
62
62
 
63
63
  def on_failure(error)
64
+ @failure = error
64
65
  summary
65
66
  @finished = true
66
67
 
67
68
  after_failure(error)
68
-
69
- @failure = error
70
69
  end
71
70
 
72
71
  def finalize
@@ -34,8 +34,8 @@ module Neo4j
34
34
  after_success(nil)
35
35
  else
36
36
  return if previous&.failure
37
- @failure = Value::ValueAdapter.to_ruby(Bolt::Connection.failure(bolt_connection))
38
- raise new_neo4j_error(**@failure)
37
+ failure = Value::ValueAdapter.to_ruby(Bolt::Connection.failure(bolt_connection))
38
+ raise @failure = new_neo4j_error(**failure)
39
39
  end
40
40
  end
41
41
 
@@ -84,7 +84,7 @@ module Neo4j
84
84
  end
85
85
  end
86
86
 
87
- def acquire_connection(mode = @mode)
87
+ def acquire_connection(mode)
88
88
  # make sure previous result is fully consumed and connection is released back to the pool
89
89
  @result&.failure
90
90
 
@@ -94,7 +94,7 @@ module Neo4j
94
94
  # 3) previous result failed and error has been consumed
95
95
 
96
96
  raise Exceptions::IllegalStateException, 'Existing open connection detected' if @connection&.open?
97
- @connection = @connection_provider.acquire_connection(@mode)
97
+ @connection = @connection_provider.acquire_connection(mode)
98
98
  end
99
99
 
100
100
  def close_transaction_and_release_connection
@@ -13,7 +13,7 @@ module Neo4j
13
13
  nodes = [prev_node] # Start node is always 0, and isn't encoded in the sequence
14
14
  rels = []
15
15
  path = Types::Path.new(nodes, rels)
16
- sequence.in_groups_of(2) do |node_idx, rel_idx|
16
+ sequence.in_groups_of(2) do |rel_idx, node_idx|
17
17
  node = uniq_nodes[node_idx]
18
18
  nodes << node
19
19
  rel = uniq_rels[rel_idx.abs - 1] # -1 because rel idx are 1-indexed
@@ -11,6 +11,10 @@ module Neo4j
11
11
  @id = id
12
12
  @properties = properties
13
13
  end
14
+
15
+ def ==(other)
16
+ self.class == other.class && id == other.id
17
+ end
14
18
  end
15
19
  end
16
20
  end
@@ -4,7 +4,7 @@ module Neo4j
4
4
  module Driver
5
5
  module Types
6
6
  class Path < Array
7
- attr_reader :modes, :relationships
7
+ attr_reader :nodes, :relationships
8
8
 
9
9
  class Segment
10
10
  attr_reader :start_node, :relationship, :end_node
@@ -4,12 +4,11 @@ module Neo4j
4
4
  module Driver
5
5
  module Exceptions
6
6
  class Neo4jException < RuntimeError
7
- attr_reader :code, :cause, :suppressed
7
+ attr_reader :code, :suppressed
8
8
 
9
9
  def initialize(*args)
10
10
  @code = args.shift if args.count > 1
11
11
  message = args.shift
12
- @cause = args.shift
13
12
  @suppressed = args.shift
14
13
  super(message)
15
14
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Neo4j
4
4
  module Driver
5
- VERSION = '0.4.0'
5
+ VERSION = '1.7.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-ruby-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heinrich Klobuczek
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-09 00:00:00.000000000 Z
11
+ date: 2020-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -319,7 +319,7 @@ licenses:
319
319
  - MIT
320
320
  metadata:
321
321
  homepage_uri: https://github.com/neo4jrb/neo4j-ruby-driver
322
- post_install_message:
322
+ post_install_message:
323
323
  rdoc_options:
324
324
  - "--main"
325
325
  - README.md
@@ -338,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  version: '0'
339
339
  requirements: []
340
340
  rubygems_version: 3.1.2
341
- signing_key:
341
+ signing_key:
342
342
  specification_version: 4
343
343
  summary: ''
344
344
  test_files: []