Skip to content

Commit 31e145e

Browse files
committed
Rename AutoClosable to AutoCloseable
1 parent 5e14063 commit 31e145e

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

jruby/neo4j/driver/ext/graph_database.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ module Neo4j
44
module Driver
55
module Ext
66
module GraphDatabase
7-
extend AutoClosable
7+
extend AutoCloseable
88
include ConfigConverter
99
include ExceptionCheckable
1010

11-
auto_closable :driver
11+
auto_closeable :driver
1212

1313
def driver(uri, auth_token = Neo4j::Driver::AuthTokens.none, **config)
1414
check do

jruby/neo4j/driver/ext/internal_driver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ module Neo4j
44
module Driver
55
module Ext
66
module InternalDriver
7-
extend AutoClosable
7+
extend AutoCloseable
88
include ConfigConverter
99
include ExceptionCheckable
1010
include AsyncConverter
1111

12-
auto_closable :session
12+
auto_closeable :session
1313

1414
def session(**session_config)
1515
java_method(:session, [org.neo4j.driver.SessionConfig])

jruby/neo4j/driver/ext/internal_session.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ module Neo4j
44
module Driver
55
module Ext
66
module InternalSession
7-
extend AutoClosable
7+
extend AutoCloseable
88
include ConfigConverter
99
include ExceptionCheckable
1010
include RunOverride
1111

12-
auto_closable :begin_transaction
12+
auto_closeable :begin_transaction
1313

1414
# work around jruby issue https://github.com/jruby/jruby/issues/5603
1515
Struct.new('Wrapper', :object)

lib/neo4j/driver/auto_closable.rb renamed to lib/neo4j/driver/auto_closeable.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
module Neo4j
44
module Driver
5-
module AutoClosable
6-
def auto_closable(*methods)
5+
module AutoCloseable
6+
def auto_closeable(*methods)
77
prepend with_block_definer(methods)
88
end
99

@@ -13,15 +13,15 @@ def with_block_definer(methods)
1313
Module.new do
1414
methods.each do |method|
1515
define_method(method) do |*args, **kwargs, &block|
16-
closable = super(*args, **kwargs)
16+
closeable = super(*args, **kwargs)
1717
if block
1818
begin
19-
block.arity.zero? ? closable.instance_eval(&block) : block.call(closable)
19+
block.arity.zero? ? closeable.instance_eval(&block) : block.call(closeable)
2020
ensure
21-
closable&.close
21+
closeable&.close
2222
end
2323
else
24-
closable
24+
closeable
2525
end
2626
end
2727
end

ruby/neo4j/driver/graph_database.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
module Neo4j::Driver
44
class GraphDatabase
55
class << self
6-
extend AutoClosable
7-
auto_closable :driver, :routing_driver
6+
extend AutoCloseable
7+
auto_closeable :driver, :routing_driver
88

99
def driver(uri, auth_token = nil, **config)
1010
internal_driver(uri, auth_token, config)

ruby/neo4j/driver/internal/internal_driver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module Neo4j::Driver
22
module Internal
33
class InternalDriver
4-
extend AutoClosable
4+
extend AutoCloseable
55
extend Synchronizable
66
attr_reader :session_factory, :metrics_provider
77
# delegate :verify_connectivity, to: :session_factory
88
delegate :metrics, :metrics_enabled?, to: :metrics_provider
9-
auto_closable :session
9+
auto_closeable :session
1010
sync :close, :supports_multi_db?, :verify_connectivity, :session
1111

1212
def initialize(security_plan, session_factory, metrics_provider, logger)

ruby/neo4j/driver/internal/internal_session.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module Neo4j::Driver
22
module Internal
33
class InternalSession
4-
extend AutoClosable
4+
extend AutoCloseable
55
extend Synchronizable
66
# include Ext::RunOverride
77
delegate :open?, :last_bookmark, to: :@session
8-
auto_closable :begin_transaction
8+
auto_closeable :begin_transaction
99
sync :close, :begin_transaction, :run, :transaction
1010

1111
def initialize(session)

0 commit comments

Comments
 (0)