neo4j-java-driver 4.1.0.beta.1-java → 4.2.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jruby/neo4j/driver/ext/auth_tokens.rb +1 -1
- data/jruby/neo4j/driver/ext/config_converter.rb +3 -5
- data/jruby/neo4j/driver/ext/exception_checkable.rb +13 -2
- data/jruby/neo4j/driver/ext/exception_mapper.rb +1 -8
- data/jruby/neo4j/driver/ext/neo_converter.rb +5 -3
- data/lib/loader.rb +1 -1
- data/lib/neo4j/driver/exceptions/neo4j_exception.rb +1 -2
- data/lib/neo4j/driver/internal/duration_normalizer.rb +2 -1
- data/lib/neo4j/driver/version.rb +1 -1
- data/lib/neo4j_ruby_driver.rb +1 -0
- metadata +5 -6
- data/lib/neo4j/driver/internal/ruby_signature.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf45a8f27d9cf287ab09b59734afe619612f5d19922d15e244a03f1b21acb175
|
4
|
+
data.tar.gz: c68fe4e55bf2805f633ca453f4736979936ac47a9b8ebb3d0bc8f484729c7025
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca113bd288db561f5ce921e358c10d99b4f5d6c4a98cca9e106a5f2f28af74aed0aebbdb36e189d695dc74b6773ad7aba7d40bd1cd07f999dc96873e5197c3a5
|
7
|
+
data.tar.gz: 9d6f276659e0ea199a6f940f1e7cab7b7a9083a2603ed02bfde75c58bf411d918a93f5400383fc4ebfbca185044280d75f7bc6d2a3e10d705f42d9adcaf2d1bf
|
@@ -9,7 +9,7 @@ module Neo4j
|
|
9
9
|
private
|
10
10
|
|
11
11
|
def to_java_config(builder_class, **hash)
|
12
|
-
hash.reduce(builder_class.builder) { |object, key_value| object.send(*config_method(*key_value)) }.build
|
12
|
+
hash.compact.reduce(builder_class.builder) { |object, key_value| object.send(*config_method(*key_value)) }.build
|
13
13
|
end
|
14
14
|
|
15
15
|
def config_method(key, value)
|
@@ -17,10 +17,8 @@ module Neo4j
|
|
17
17
|
unit = nil
|
18
18
|
case key.to_s
|
19
19
|
when 'encryption'
|
20
|
-
unless value
|
21
|
-
|
22
|
-
value = nil
|
23
|
-
end
|
20
|
+
method = :without_encryption unless value
|
21
|
+
value = nil
|
24
22
|
when 'timeout'
|
25
23
|
value = java.time.Duration.ofMillis(Driver::Internal::DurationNormalizer.milliseconds(value))
|
26
24
|
when /time(out)?$/
|
@@ -20,8 +20,19 @@ module Neo4j
|
|
20
20
|
|
21
21
|
def reverse_check
|
22
22
|
yield
|
23
|
-
rescue
|
24
|
-
raise(e.cause ||
|
23
|
+
rescue Neo4j::Driver::Exceptions::ServiceUnavailableException => e
|
24
|
+
raise(throwable(e.cause) || Java::OrgNeo4jDriverExceptions::ServiceUnavailableException.new(e.message))
|
25
|
+
rescue Neo4j::Driver::Exceptions::Neo4jException,
|
26
|
+
Neo4j::Driver::Exceptions::NoSuchRecordException,
|
27
|
+
Neo4j::Driver::Exceptions::UntrustedServerException,
|
28
|
+
Neo4j::Driver::Exceptions::IllegalStateException => e
|
29
|
+
raise(throwable(e.cause) || e)
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def throwable(e)
|
35
|
+
e if e.is_a? Java::JavaLang::Throwable
|
25
36
|
end
|
26
37
|
end
|
27
38
|
end
|
@@ -24,14 +24,7 @@ module Neo4j
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def arguments
|
27
|
-
[code, message,
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.reverse_exception_class(exception)
|
31
|
-
case exception
|
32
|
-
when Neo4j::Driver::Exceptions::ServiceUnavailableException
|
33
|
-
ServiceUnavailableException
|
34
|
-
end
|
27
|
+
[code, message, suppressed.map(&method(:mapped_exception))]
|
35
28
|
end
|
36
29
|
|
37
30
|
private
|
@@ -16,8 +16,6 @@ module Neo4j
|
|
16
16
|
object.map(&method(:to_neo))
|
17
17
|
when Types::Bytes
|
18
18
|
object.to_java_bytes
|
19
|
-
when Date
|
20
|
-
Java::JavaTime::LocalDate.of(object.year, object.month, object.day)
|
21
19
|
when ActiveSupport::Duration
|
22
20
|
Java::OrgNeo4jDriverInternal::InternalIsoDuration.new(
|
23
21
|
*Driver::Internal::DurationNormalizer.normalize(object)
|
@@ -34,8 +32,12 @@ module Neo4j
|
|
34
32
|
object.nsec)
|
35
33
|
when ActiveSupport::TimeWithZone
|
36
34
|
to_zoned_date_time(object, object.time_zone.tzinfo.identifier)
|
37
|
-
when Time
|
35
|
+
when Time, DateTime
|
38
36
|
to_zoned_date_time(object, object.formatted_offset)
|
37
|
+
when Date
|
38
|
+
Java::JavaTime::LocalDate.of(object.year, object.month, object.day)
|
39
|
+
when Symbol
|
40
|
+
object.to_s
|
39
41
|
when nil, true, false, Integer, Float, String
|
40
42
|
object
|
41
43
|
else
|
data/lib/loader.rb
CHANGED
@@ -8,7 +8,7 @@ class Loader
|
|
8
8
|
loader.tag = 'neo4j-ruby-driver'
|
9
9
|
loader.push_dir(File.expand_path(__dir__))
|
10
10
|
loader.push_dir(File.dirname(File.dirname(caller_locations(1..1).first.path)))
|
11
|
-
loader.ignore(File.expand_path('neo4j
|
11
|
+
loader.ignore(File.expand_path('neo4j-*-driver_jars.rb', __dir__))
|
12
12
|
loader.ignore(File.expand_path('neo4j_ruby_driver.rb', __dir__))
|
13
13
|
loader.ignore(File.expand_path('org', __dir__))
|
14
14
|
loader.inflector = Zeitwerk::GemInflector.new(File.expand_path('neo4j/driver', __dir__))
|
@@ -4,12 +4,11 @@ module Neo4j
|
|
4
4
|
module Driver
|
5
5
|
module Exceptions
|
6
6
|
class Neo4jException < RuntimeError
|
7
|
-
attr_reader :code, :
|
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)
|
data/lib/neo4j/driver/version.rb
CHANGED
data/lib/neo4j_ruby_driver.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-java-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Heinrich Klobuczek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -249,7 +249,6 @@ files:
|
|
249
249
|
- lib/neo4j/driver/exceptions/transient_exception.rb
|
250
250
|
- lib/neo4j/driver/exceptions/untrusted_server_exception.rb
|
251
251
|
- lib/neo4j/driver/internal/duration_normalizer.rb
|
252
|
-
- lib/neo4j/driver/internal/ruby_signature.rb
|
253
252
|
- lib/neo4j/driver/internal/validator.rb
|
254
253
|
- lib/neo4j/driver/types/bytes.rb
|
255
254
|
- lib/neo4j/driver/types/local_date_time.rb
|
@@ -278,11 +277,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
278
277
|
version: '2.5'
|
279
278
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
280
279
|
requirements:
|
281
|
-
- - "
|
280
|
+
- - ">="
|
282
281
|
- !ruby/object:Gem::Version
|
283
|
-
version:
|
282
|
+
version: '0'
|
284
283
|
requirements:
|
285
|
-
- jar org.neo4j.driver, neo4j-java-driver, 4.
|
284
|
+
- jar org.neo4j.driver, neo4j-java-driver, 4.2.4
|
286
285
|
rubygems_version: 3.0.6
|
287
286
|
signing_key:
|
288
287
|
specification_version: 4
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Neo4j
|
4
|
-
module Driver
|
5
|
-
module Internal
|
6
|
-
module RubySignature
|
7
|
-
class << self
|
8
|
-
def session(args)
|
9
|
-
[
|
10
|
-
args.empty? || args.first.is_a?(String) ? Neo4j::Driver::AccessMode::WRITE : args.shift, # mode
|
11
|
-
args # bookmarks
|
12
|
-
]
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|