File tree Expand file tree Collapse file tree 10 files changed +17
-13
lines changed Expand file tree Collapse file tree 10 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 19
19
strategy :
20
20
fail-fast : false
21
21
matrix :
22
- ruby : ["3.0 ", "3.1", "3.2 "]
22
+ ruby : ["3.2 ", "3.3 "]
23
23
gemfile :
24
24
- Gemfile
25
25
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ inherit_gem:
4
4
5
5
AllCops :
6
6
NewCops : enable
7
- TargetRubyVersion : 3.0
7
+ TargetRubyVersion : 3.2
8
8
9
9
Metrics/MethodLength :
10
10
Enabled : false
@@ -15,3 +15,6 @@ Metrics/AbcSize:
15
15
Style/OpenStructUse :
16
16
Exclude :
17
17
- test/**/*.rb
18
+
19
+ Minitest/UnspecifiedException :
20
+ Enabled : false
Original file line number Diff line number Diff line change 1
1
# SQLRunner
2
2
3
+ [ ![ ruby-tests] ( https://github.com/fnando/sql_runner/actions/workflows/test.yml/badge.svg )] ( https://github.com/fnando/sql_runner/actions/workflows/test.yml )
3
4
[ ![ Gem] ( https://img.shields.io/gem/v/sql_runner.svg )] ( https://rubygems.org/gems/sql_runner )
4
5
[ ![ Gem] ( https://img.shields.io/gem/dt/sql_runner.svg )] ( https://rubygems.org/gems/sql_runner )
5
6
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def disconnect(*)
42
42
class ConnectionPool
43
43
def with
44
44
::ActiveRecord ::Base . connection_pool . with_connection do |connection |
45
- connection = connection . instance_variable_get ( :@connection )
45
+ connection = connection . raw_connection
46
46
47
47
adapter = case connection . class . name
48
48
when "PG::Connection"
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ def self.load
12
12
end
13
13
14
14
def self . create_connection_pool ( timeout :, size :, connection_string :)
15
- ConnectionPool . new ( timeout : timeout , size : size ) do
15
+ ConnectionPool . new ( timeout :, size :) do
16
16
new ( connection_string )
17
17
end
18
18
end
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ def self.load
12
12
end
13
13
14
14
def self . create_connection_pool ( timeout :, size :, connection_string :)
15
- ConnectionPool . new ( timeout : timeout , size : size ) do
15
+ ConnectionPool . new ( timeout :, size :) do
16
16
new ( connection_string )
17
17
end
18
18
end
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ def self.load
12
12
end
13
13
14
14
def self . create_connection_pool ( timeout :, size :, connection_string :)
15
- ConnectionPool . new ( timeout : timeout , size : size ) do
15
+ ConnectionPool . new ( timeout :, size :) do
16
16
new ( connection_string )
17
17
end
18
18
end
Original file line number Diff line number Diff line change @@ -9,12 +9,12 @@ def self.call(connection_string)
9
9
adapter . create_connection_pool (
10
10
timeout : SQLRunner . timeout ,
11
11
size : SQLRunner . pool ,
12
- connection_string : connection_string
12
+ connection_string :
13
13
)
14
14
end
15
15
16
- def with_connection ( &block )
17
- connection_pool . with ( &block )
16
+ def with_connection ( &)
17
+ connection_pool . with ( &)
18
18
end
19
19
20
20
def connect ( connection_string )
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
spec . version = SQLRunner ::VERSION
8
8
spec . authors = [ "Nando Vieira" ]
9
9
spec . email = [ "me@fnando.com" ]
10
- spec . required_ruby_version = Gem ::Requirement . new ( ">= 3.0 .0" )
10
+ spec . required_ruby_version = Gem ::Requirement . new ( ">= 3.2 .0" )
11
11
spec . metadata = { "rubygems_mfa_required" => "true" }
12
12
13
13
spec . summary = <<~TEXT . tr ( "\n " , " " )
@@ -34,10 +34,9 @@ Gem::Specification.new do |spec|
34
34
spec . add_development_dependency "mocha"
35
35
spec . add_development_dependency "mysql2"
36
36
spec . add_development_dependency "pg"
37
- spec . add_development_dependency "pry-meta"
38
37
spec . add_development_dependency "rake"
39
38
spec . add_development_dependency "rubocop"
40
39
spec . add_development_dependency "rubocop-fnando"
41
40
spec . add_development_dependency "simplecov"
42
- spec . add_development_dependency "sqlite3"
41
+ spec . add_development_dependency "sqlite3" , "~> 1.7"
43
42
end
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def assert_adapter(options)
22
22
23
23
tests = options [ :tests ] || DEFAULT_TESTS
24
24
tests . each do |test |
25
- send ( "#{ test } _tests" , options )
25
+ send ( : "#{ test } _tests", options )
26
26
end
27
27
end
28
28
@@ -218,6 +218,7 @@ def connection_tests(options)
218
218
219
219
test "returns database connection" do
220
220
options [ :setup ] . call ( options )
221
+
221
222
SQLRunner . with_connection do |conn |
222
223
assert conn . active?
223
224
end
You can’t perform that action at this time.
0 commit comments