neo4j-ruby-driver 1.7.2 → 1.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73e017d0ba7cbb58f6ab2ef0e4118e33e81bca173483ec8b28a60fe21ffa5d9e
4
- data.tar.gz: eb314a4ad5450cac37dca70dac4ff6e2171d4f8067a094baa112d93e102d788b
3
+ metadata.gz: 4299bc356ee0c406d130ff94440c61122a00061efd90cc66335b710700e7247e
4
+ data.tar.gz: 1060ce101c95bac9e471c51ca04f0267efbd720826e5a301f9183bb2cce26194
5
5
  SHA512:
6
- metadata.gz: 8a9548471d5962bf3d53bf0a5fd48ef0a04753a4fa41f5cf19d2038ebebc8e375159b364465f6bd03c00197add59b04c8eddd905fa33aeccc1fe0f9726da36f1
7
- data.tar.gz: 7ad0bdfaaa1f202f86b102a95a3d12cb50c65e64fd3e941fe2c780f4b6cdf87b01428874ec15d6c8eb60fe43c844c94751fe7be0f738ecfd3abb1cc1cec2a3a0
6
+ metadata.gz: 9d18e0ef3c134175493f9fa555a30114dde1d4a768fe33fecfd6fc559560b965c600457f509a3ad40182598c66c5b5c93438449209e0fd5a2f7599ac52daa2bd
7
+ data.tar.gz: e1ef7028d0c38b7e31e5201bf0fbca8d4d69329fd8eff78e5e6dea3bb6ed6fadfcced4dccbb46895c0f6511800c398f1756ae55e0dc4bcca2bbb6eeff70b2c17
@@ -22,11 +22,11 @@ module Neo4j
22
22
 
23
23
  def write_and_flush(statement, parameters, boomarks_holder, config, run_handler, pull_handler)
24
24
  check_error Bolt::Connection.clear_run(bolt_connection)
25
- check_error Bolt::Connection.set_run_cypher(bolt_connection, statement, statement.size, parameters.size)
25
+ check_error Bolt::Connection.set_run_cypher(bolt_connection, statement, statement.bytesize, parameters.size)
26
26
  parameters.each_with_index do |(name, object), index|
27
27
  name = name.to_s
28
28
  Value::ValueAdapter.to_neo(
29
- Bolt::Connection.set_run_cypher_parameter(bolt_connection, index, name, name.size), object
29
+ Bolt::Connection.set_run_cypher_parameter(bolt_connection, index, name, name.bytesize), object
30
30
  )
31
31
  end
32
32
  set_bookmarks(:set_run_bookmarks, boomarks_holder.bookmarks)
@@ -23,7 +23,8 @@ module Neo4j
23
23
  def create_connector(uri, auth_token, routing_context, config)
24
24
  address = Bolt::Address.create(host(uri).gsub(/^\[(.*)\]$/, '\\1'), port(uri).to_s)
25
25
  bolt_config = bolt_config(config)
26
- logger = InternalLogger.register(bolt_config, config[:logger])
26
+ # callbacks from C to ruby used in logger may cause deadlocks on MRI
27
+ logger = InternalLogger.register(bolt_config, config[:logger]) if RUBY_PLATFORM.match?(/java/)
27
28
  set_socket_options(bolt_config, config)
28
29
  set_routing_context(bolt_config, routing_context)
29
30
  set_scheme(bolt_config, uri, routing_context)
@@ -94,7 +94,7 @@ module Neo4j
94
94
  nil
95
95
  end
96
96
  rescue StandardError => e
97
- on_failure(e)
97
+ on_failure(e) unless @failure
98
98
  raise e
99
99
  end
100
100
  end
@@ -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
@@ -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 = '1.7.2'
5
+ VERSION = '1.7.6'
6
6
  end
7
7
  end
@@ -13,6 +13,7 @@ if RUBY_PLATFORM.match?(/java/)
13
13
  end
14
14
  # End workaround
15
15
 
16
+ require 'active_support'
16
17
  require 'active_support/core_ext/hash/indifferent_access'
17
18
  require 'active_support/core_ext/numeric/time'
18
19
  require 'active_support/duration'
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: 1.7.2
4
+ version: 1.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heinrich Klobuczek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 2022-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -337,7 +337,7 @@ 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
340
+ rubygems_version: 3.3.3
341
341
  signing_key:
342
342
  specification_version: 4
343
343
  summary: ''