neo4j-java-driver 0.4.0-java → 1.7.4-java

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: 0d15a30347713fb80742a8abc60472a20dd240dc327dc7b5ec48e69e128810e7
4
- data.tar.gz: a276cf844d3a0a1b5c3b977744aedd8e74634d7a0e9c1829addb334d7e19d825
3
+ metadata.gz: 0a39ad35198a8958f2857bfcfb6040ffffeee0338fee2105ff2ca4e4f98f162b
4
+ data.tar.gz: 5f617ac0e6a69992f8febe4ec4ed115383c8088b4732bf33c3607aa9994d8c96
5
5
  SHA512:
6
- metadata.gz: 7afbfb75c3268db498e5a5ec0a8b64b664e4fc0121f395e97448338e4fbce30fd80dc5341b951465063056f0ad2f7119faba49410cce2440a4733ffaa4cbda9a
7
- data.tar.gz: 960124acd456ee2a9fb4f3edd2d0c9bc816b3929792a926a5397d13bbcf814932a6d813b5e2fd81be4694fcb25ddf055293dcfa085e6ef2fe490e6287695e033
6
+ metadata.gz: 59aa3597d96b34851293e27c49dee3d9d52d5a604112f35274f1dc5477fa87f1c5c27977d36e345ec413d195b1b4b128c6fa12c248d90c234bc88d9a9176f8bb
7
+ data.tar.gz: de8450ea68258da74d9e17274a12f2d7f83129fbd06a8e9eb497847cd487aa3a5ae3a1a8af4a4d10733bf1565b4cb645bee6caf28692bbce9269a05867e0ce12
@@ -42,7 +42,7 @@ end
42
42
  Loader.load
43
43
 
44
44
  Java::OrgNeo4jDriverInternal::InternalDriver.prepend Neo4j::Driver::Ext::InternalDriver
45
- Java::OrgNeo4jDriverInternal::InternalEntity.include Neo4j::Driver::Ext::MapAccessor
45
+ Java::OrgNeo4jDriverInternal::InternalEntity.include Neo4j::Driver::Ext::InternalEntity
46
46
  Java::OrgNeo4jDriverInternal::InternalNode.prepend Neo4j::Driver::Ext::InternalNode
47
47
  Java::OrgNeo4jDriverInternal::InternalPath.include Neo4j::Driver::Ext::StartEndNaming
48
48
  Java::OrgNeo4jDriverInternal::InternalPath::SelfContainedSegment.include Neo4j::Driver::Ext::StartEndNaming
@@ -17,10 +17,8 @@ module Neo4j
17
17
  unit = nil
18
18
  case key.to_s
19
19
  when 'encryption'
20
- unless value
21
- method = :without_encryption
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 StandardError => e
24
- raise(e.cause || ExceptionMapper.reverse_exception_class(e)&.new('') || e)
23
+ rescue Neo4j::Driver::Exceptions::ServiceUnavailableException => e
24
+ raise(throwable(e.cause) || org.neo4j.driver.v1.exceptions.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
@@ -23,14 +23,7 @@ module Neo4j
23
23
  end
24
24
 
25
25
  def arguments
26
- [code, message, self, suppressed.map(&method(:mapped_exception))]
27
- end
28
-
29
- def self.reverse_exception_class(exception)
30
- case exception
31
- when Neo4j::Driver::Exceptions::ServiceUnavailableException
32
- ServiceUnavailableException
33
- end
26
+ [code, message, suppressed.map(&method(:mapped_exception))]
34
27
  end
35
28
 
36
29
  private
@@ -3,7 +3,7 @@
3
3
  module Neo4j
4
4
  module Driver
5
5
  module Ext
6
- module MapAccessor
6
+ module InternalEntity
7
7
  include MapConverter
8
8
 
9
9
  alias properties to_h
@@ -11,6 +11,10 @@ module Neo4j
11
11
  def [](key)
12
12
  get(key.to_s).as_ruby_object
13
13
  end
14
+
15
+ def ==(other)
16
+ java_method(:isEqual).call(other)
17
+ end
14
18
  end
15
19
  end
16
20
  end
@@ -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
@@ -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.0'
5
+ VERSION = '1.7.4'
6
6
  end
7
7
  end
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: 0.4.0
4
+ version: 1.7.4
5
5
  platform: java
6
6
  authors:
7
7
  - Heinrich Klobuczek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-09 00:00:00.000000000 Z
11
+ date: 2021-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -218,13 +218,13 @@ files:
218
218
  - jruby/neo4j/driver/ext/graph_database.rb
219
219
  - jruby/neo4j/driver/ext/internal/summary/internal_result_summary.rb
220
220
  - jruby/neo4j/driver/ext/internal_driver.rb
221
+ - jruby/neo4j/driver/ext/internal_entity.rb
221
222
  - jruby/neo4j/driver/ext/internal_keys.rb
222
223
  - jruby/neo4j/driver/ext/internal_node.rb
223
224
  - jruby/neo4j/driver/ext/internal_record.rb
224
225
  - jruby/neo4j/driver/ext/internal_relationship.rb
225
226
  - jruby/neo4j/driver/ext/internal_statement_result.rb
226
227
  - jruby/neo4j/driver/ext/logger.rb
227
- - jruby/neo4j/driver/ext/map_accessor.rb
228
228
  - jruby/neo4j/driver/ext/map_converter.rb
229
229
  - jruby/neo4j/driver/ext/neo_converter.rb
230
230
  - jruby/neo4j/driver/ext/network_session.rb