ar-multidb 0.8.0 → 0.8.2

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: f198d581e4d1d0641b91ec64b79472987f90c8c69f717adc568caffbcaad148f
4
- data.tar.gz: 33f6126cef8968a360f84fda234548687507f988beade03da58f092b8166cb13
3
+ metadata.gz: 37f2049af9bc23016efa9b8e7276c110f329156ebcca7a9980d51be33d9deb6f
4
+ data.tar.gz: a739bce0f6b79c685c80e513bafbdfb8e7395621ab65af798b1cd180e88d4f3f
5
5
  SHA512:
6
- metadata.gz: ba852c8001cb41bd738f2fae94268b5c37c9ebf5e549dcf326243dbfbff4c7c00a76641c2500dcfb96b37469543fc370a362cecec9c04134c031c0e40cc0fc90
7
- data.tar.gz: 041f8e4d3fdb4559b764c4189a81801d60c96ad71f71a431970a62a06cd6e603b96bf20b223ff7032180a149329ffad76ed4da70090658d241909332255f13e2
6
+ metadata.gz: 0f87d07d31dca7f9ea63c9797fa2e4ad0c3d8f723bb087a65e575df63dc4199ca91190cf6f6fba1ea918e2952bc13fd1cc03e29d52457cf0902f3b788e1ce859
7
+ data.tar.gz: b9926b36d54da536864fd95341601cdaa1eea66c3eb1d42230cc36d143db2c29ff420aa31439b5ecf5477e6a27bc52f576a765174d64f99519ff21033ffdae04
@@ -25,13 +25,18 @@ jobs:
25
25
  - '7.1'
26
26
  - '7.2'
27
27
  - '8.0'
28
+ - '8.1'
28
29
  exclude:
29
30
  - ruby: '3.0'
30
31
  activerecord: '7.2'
31
32
  - ruby: '3.0'
32
33
  activerecord: '8.0'
34
+ - ruby: '3.0'
35
+ activerecord: '8.1'
33
36
  - ruby: '3.1'
34
37
  activerecord: '8.0'
38
+ - ruby: '3.1'
39
+ activerecord: '8.1'
35
40
  env:
36
41
  BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}.gemfile"
37
42
  steps:
data/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html)
6
6
 
7
+ ## [0.8.2]
8
+ ### Changed
9
+ - add support for Rails 8.1
10
+
11
+ ## [0.8.1]
12
+ ### Changes
13
+ - Updated Log subscriber mixin to utilize Rails 7.1's contract for "color"
14
+ - Removed old backward compat path for Rails < 6.1
15
+
7
16
  ## [0.8.0]
8
17
  ### Changed
9
18
  - dropped support for Ruby < 3.0
data/ar-multidb.gemspec CHANGED
@@ -21,8 +21,8 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.required_ruby_version = '>= 3.0.0'
23
23
 
24
- s.add_runtime_dependency 'activerecord', '>= 7.1', '< 8.1'
25
- s.add_runtime_dependency 'activesupport', '>= 7.1', '< 8.1'
24
+ s.add_runtime_dependency 'activerecord', '>= 7.1', '< 8.2'
25
+ s.add_runtime_dependency 'activesupport', '>= 7.1', '< 8.2'
26
26
 
27
27
  s.add_development_dependency 'rake', '~> 13.0'
28
28
  s.add_development_dependency 'rspec', '~> 3.8'
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'activerecord', '~> 8.1.0'
6
+
7
+ gemspec path: '..'
@@ -11,7 +11,7 @@ module Multidb
11
11
  def debug(msg = nil)
12
12
  name = Multidb.balancer.current_connection_name
13
13
  if name
14
- db = color("[DB: #{name}]", ActiveSupport::LogSubscriber::GREEN, true)
14
+ db = color("[DB: #{name}]", ActiveSupport::LogSubscriber::GREEN, bold: true)
15
15
  super(db + msg.to_s)
16
16
  else
17
17
  super
@@ -6,11 +6,7 @@ module Multidb
6
6
  module Connection
7
7
  def establish_connection(spec = nil)
8
8
  super(spec)
9
- config = if connection_pool.respond_to?(:db_config)
10
- connection_pool.db_config.configuration_hash
11
- else
12
- connection_pool.spec.config
13
- end
9
+ config = connection_pool.db_config.configuration_hash
14
10
 
15
11
  Multidb.init(config)
16
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Multidb
4
- VERSION = '0.8.0'
4
+ VERSION = '0.8.2'
5
5
  end
@@ -17,8 +17,12 @@ RSpec.describe Multidb::LogSubscriberExtension do
17
17
  msg
18
18
  end
19
19
 
20
- def color(text, _color, _bold)
21
- text
20
+ def color(text, color, options = {})
21
+ if options[:bold]
22
+ "Bold: Color #{color}: #{text}"
23
+ else
24
+ "Color #{color}: #{text}"
25
+ end
22
26
  end
23
27
  end
24
28
 
@@ -65,13 +69,13 @@ RSpec.describe Multidb::LogSubscriberExtension do
65
69
  subject { instance.debug('message') }
66
70
 
67
71
  it 'prepends the db name to the message' do
68
- is_expected.to include('[DB: default]')
72
+ is_expected.to start_with "Bold: Color \e[32m: [DB: default]"
69
73
  end
70
74
 
71
75
  context 'when a replica is active' do
72
76
  it 'prepends the replica dbname to the message' do
73
77
  Multidb.use(:replica1) {
74
- is_expected.to include('[DB: replica1')
78
+ is_expected.to start_with "Bold: Color \e[32m: [DB: replica1"
75
79
  }
76
80
  end
77
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar-multidb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Staubo
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '7.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '8.1'
22
+ version: '8.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '7.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '8.1'
32
+ version: '8.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activesupport
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '7.1'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '8.1'
42
+ version: '8.2'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '7.1'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '8.1'
52
+ version: '8.2'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rake
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -170,6 +170,7 @@ files:
170
170
  - gemfiles/activerecord-7.1.gemfile
171
171
  - gemfiles/activerecord-7.2.gemfile
172
172
  - gemfiles/activerecord-8.0.gemfile
173
+ - gemfiles/activerecord-8.1.gemfile
173
174
  - lib/ar-multidb.rb
174
175
  - lib/multidb.rb
175
176
  - lib/multidb/balancer.rb