neo4j-ruby-driver 0.4.2 → 1.7.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
  SHA256:
3
- metadata.gz: d2ac2597035dbaec401dedd95824f8ac615b939013555ebb8bc5911b2271a87f
4
- data.tar.gz: 4d744afe851264c2e9f7c5497ea9bfc6a17717b146ccdab935ffe9f1afce2d05
3
+ metadata.gz: 10b401fcd6765f428d7b377cb9ed6e6dc021d7e6c1fa41bc95839a991d3a8d11
4
+ data.tar.gz: 29bd664e4481f3e42bd5cd369603887d1c349c3caa472747179b4bffe7c96e0d
5
5
  SHA512:
6
- metadata.gz: 61405f251e82b0da093dd6bb9b4b6cd4d27b01098bc99076c2e29c26936c476bdb67f7ab2752184d54d2a7108a2d1a87482d8e004e39ff20f0d53909bef3ca2e
7
- data.tar.gz: 07d3aa9c85e273ae462da8854d8be86019b03794af6001c25c9f0845544507a665986bd19ad96a2267b7f2ebb75f99701d6febf610a233ad96f7cfdd93c37276
6
+ metadata.gz: 006d20096a8a7643f9ae842a0b3340bb2517d46cc1781dd3e7f95cd7aa262eb4c4a524687ec87324910e3e8e25c8fcaa077773b226a8173d8383e42ec86380b9
7
+ data.tar.gz: ad244e09f318ca75a63d7b8fb1d345cb04e0567ea0e6e6ffdc0b86b73817b5adf2e1c673201e1afb4ac5a0adcfe661353d1e854897baf03007030a1704656d84
@@ -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
@@ -95,7 +94,7 @@ module Neo4j
95
94
  nil
96
95
  end
97
96
  rescue StandardError => e
98
- on_failure(e)
97
+ on_failure(e) unless @failure
99
98
  raise e
100
99
  end
101
100
  end
@@ -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
 
@@ -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
@@ -50,6 +50,8 @@ module Neo4j
50
50
  when String
51
51
  object = object.encode(Encoding::UTF_8) unless object.encoding == Encoding::UTF_8
52
52
  Bolt::Value.format_as_string(value, object, object.bytesize)
53
+ when Symbol
54
+ to_neo(value, object.to_s)
53
55
  when Hash
54
56
  Bolt::Value.format_as_dictionary(value, object.size)
55
57
  object.each_with_index do |(key, elem), index|
@@ -63,8 +65,6 @@ module Neo4j
63
65
  object = object.to_a
64
66
  Bolt::Value.format_as_list(value, object.size)
65
67
  object.each_with_index { |elem, index| to_neo(Bolt::List.value(value, index), elem) }
66
- when Date
67
- DateValue.to_neo(value, object)
68
68
  when ActiveSupport::Duration
69
69
  DurationValue.to_neo(value, object)
70
70
  when Neo4j::Driver::Types::Point
@@ -84,8 +84,10 @@ module Neo4j
84
84
  LocalDateTimeValue.to_neo(value, object)
85
85
  when ActiveSupport::TimeWithZone
86
86
  TimeWithZoneIdValue.to_neo(value, object)
87
- when Time
87
+ when Time, DateTime
88
88
  TimeWithZoneOffsetValue.to_neo(value, object)
89
+ when Date
90
+ DateValue.to_neo(value, object)
89
91
  else
90
92
  Exceptions::ClientException.unable_to_convert(object)
91
93
  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
@@ -6,7 +6,8 @@ module Neo4j
6
6
  module DurationNormalizer
7
7
  class << self
8
8
  def normalize(object)
9
- parts = object.parts
9
+ parts = object.parts.to_h
10
+ parts.default = 0
10
11
  months_i, months_remainder_seconds = divmod(months(parts), ActiveSupport::Duration::SECONDS_PER_MONTH)
11
12
  months_days, months_remainder_seconds =
12
13
  months_remainder_seconds.divmod(ActiveSupport::Duration::SECONDS_PER_DAY)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Neo4j
4
4
  module Driver
5
- VERSION = '0.4.2'
5
+ VERSION = '1.7.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,22 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-ruby-driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 1.7.4
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-05-21 00:00:00.000000000 Z
11
+ date: 2020-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: activesupport
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
18
  version: '0'
19
+ name: activesupport
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -25,12 +25,12 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: zeitwerk
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
32
  version: 2.1.10
33
+ name: zeitwerk
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
@@ -39,12 +39,12 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.1.10
41
41
  - !ruby/object:Gem::Dependency
42
- name: ffi
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - ">="
46
45
  - !ruby/object:Gem::Version
47
46
  version: '0'
47
+ name: ffi
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
@@ -53,12 +53,12 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: recursive-open-struct
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - ">="
60
59
  - !ruby/object:Gem::Version
61
60
  version: '0'
61
+ name: recursive-open-struct
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
@@ -67,12 +67,12 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: ffaker
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - ">="
74
73
  - !ruby/object:Gem::Version
75
74
  version: '0'
75
+ name: ffaker
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
@@ -81,12 +81,12 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: hoe
85
84
  requirement: !ruby/object:Gem::Requirement
86
85
  requirements:
87
86
  - - ">="
88
87
  - !ruby/object:Gem::Version
89
88
  version: '0'
89
+ name: hoe
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
@@ -95,12 +95,12 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: hoe-bundler
99
98
  requirement: !ruby/object:Gem::Requirement
100
99
  requirements:
101
100
  - - ">="
102
101
  - !ruby/object:Gem::Version
103
102
  version: '0'
103
+ name: hoe-bundler
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
@@ -109,12 +109,12 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: hoe-gemspec
113
112
  requirement: !ruby/object:Gem::Requirement
114
113
  requirements:
115
114
  - - ">="
116
115
  - !ruby/object:Gem::Version
117
116
  version: '0'
117
+ name: hoe-gemspec
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -123,12 +123,12 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: parallel
127
126
  requirement: !ruby/object:Gem::Requirement
128
127
  requirements:
129
128
  - - ">="
130
129
  - !ruby/object:Gem::Version
131
130
  version: '0'
131
+ name: parallel
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
@@ -137,12 +137,12 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rake
141
140
  requirement: !ruby/object:Gem::Requirement
142
141
  requirements:
143
142
  - - ">="
144
143
  - !ruby/object:Gem::Version
145
144
  version: '0'
145
+ name: rake
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
@@ -151,12 +151,12 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: rspec-its
155
154
  requirement: !ruby/object:Gem::Requirement
156
155
  requirements:
157
156
  - - ">="
158
157
  - !ruby/object:Gem::Version
159
158
  version: '0'
159
+ name: rspec-its
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
@@ -165,12 +165,12 @@ dependencies:
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
- name: rspec-mocks
169
168
  requirement: !ruby/object:Gem::Requirement
170
169
  requirements:
171
170
  - - ">="
172
171
  - !ruby/object:Gem::Version
173
172
  version: '0'
173
+ name: rspec-mocks
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
@@ -179,7 +179,6 @@ dependencies:
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
- name: rdoc
183
182
  requirement: !ruby/object:Gem::Requirement
184
183
  requirements:
185
184
  - - ">="
@@ -188,6 +187,7 @@ dependencies:
188
187
  - - "<"
189
188
  - !ruby/object:Gem::Version
190
189
  version: '7'
190
+ name: rdoc
191
191
  type: :development
192
192
  prerelease: false
193
193
  version_requirements: !ruby/object:Gem::Requirement
@@ -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
@@ -337,8 +337,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
337
337
  - !ruby/object:Gem::Version
338
338
  version: '0'
339
339
  requirements: []
340
- rubygems_version: 3.1.2
341
- signing_key:
340
+ rubygems_version: 3.0.6
341
+ signing_key:
342
342
  specification_version: 4
343
343
  summary: ''
344
344
  test_files: []