Skip to content

Commit 299dea2

Browse files
committed
drop ruby 2.4 support
1 parent 5070467 commit 299dea2

5 files changed

Lines changed: 131 additions & 16 deletions

File tree

.github/workflows/prs.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
ruby:
19-
- '2.4'
2019
- '2.5'
2120
- '2.7'
2221
- '3.0'
@@ -25,8 +24,6 @@ jobs:
2524
- '5.2'
2625
- '6.0'
2726
exclude:
28-
- ruby: '2.4'
29-
activerecord: '6.0'
3027
- ruby: '3.0'
3128
activerecord: '5.1'
3229
- ruby: '3.0'

.rubocop.yml

Lines changed: 122 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,184 @@
11
AllCops:
2-
TargetRubyVersion: 2.4
2+
TargetRubyVersion: 2.5
33
SuggestExtensions: false
44
NewCops: disable
55
Exclude:
66
- '**/vendor/**/*'
77

8+
Gemspec/DateAssignment: # new in 1.10
9+
Enabled: true
10+
Gemspec/RequireMFA: # new in 1.23
11+
Enabled: true
12+
813
Layout/EmptyLinesAroundAttributeAccessor:
914
Enabled: true
10-
Layout/SpaceAroundMethodCallOperator:
15+
Layout/LineEndStringConcatenationIndentation: # new in 1.18
1116
Enabled: true
1217
Layout/LineLength:
1318
Exclude:
1419
- ar-multidb.gemspec
20+
Layout/SpaceAroundMethodCallOperator:
21+
Enabled: true
22+
Layout/SpaceBeforeBrackets: # new in 1.7
23+
Enabled: true
24+
25+
Lint/AmbiguousAssignment: # new in 1.7
26+
Enabled: true
27+
Lint/AmbiguousOperatorPrecedence: # new in 1.21
28+
Enabled: true
29+
Lint/AmbiguousRange: # new in 1.19
30+
Enabled: true
31+
Lint/DeprecatedConstants: # new in 1.8
32+
Enabled: true
1533
Lint/DeprecatedOpenSSLConstant:
1634
Enabled: true
35+
Lint/DuplicateBranch: # new in 1.3
36+
Enabled: true
1737
Lint/DuplicateElsifCondition:
1838
Enabled: true
39+
Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
40+
Enabled: true
41+
Lint/EmptyBlock: # new in 1.1
42+
Enabled: true
43+
Lint/EmptyClass: # new in 1.3
44+
Enabled: true
45+
Lint/EmptyInPattern: # new in 1.16
46+
Enabled: true
47+
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
48+
Enabled: true
49+
Lint/LambdaWithoutLiteralBlock: # new in 1.8
50+
Enabled: true
1951
Lint/MixedRegexpCaptureTypes:
2052
Enabled: true
53+
Lint/NoReturnInBeginEndBlocks: # new in 1.2
54+
Enabled: true
55+
Lint/NumberedParameterAssignment: # new in 1.9
56+
Enabled: true
57+
Lint/OrAssignmentToConstant: # new in 1.9
58+
Enabled: true
2159
Lint/RaiseException:
2260
Enabled: true
61+
Lint/RedundantDirGlobSort: # new in 1.8
62+
Enabled: true
63+
Lint/RefinementImportMethods: # new in 1.27
64+
Enabled: true
65+
Lint/RequireRelativeSelfPath: # new in 1.22
66+
Enabled: true
2367
Lint/StructNewOverride:
2468
Enabled: true
69+
Lint/SymbolConversion: # new in 1.9
70+
Enabled: true
71+
Lint/ToEnumArguments: # new in 1.1
72+
Enabled: true
73+
Lint/TripleQuotes: # new in 1.9
74+
Enabled: true
75+
Lint/UnexpectedBlockArity: # new in 1.5
76+
Enabled: true
77+
Lint/UnmodifiedReduceAccumulator: # new in 1.1
78+
Enabled: true
79+
Lint/UselessRuby2Keywords: # new in 1.23
80+
Enabled: true
81+
2582
Naming/FileName:
2683
Exclude:
2784
- lib/ar-multidb.rb
2885
- 'gemfiles/*'
86+
Naming/BlockForwarding: # new in 1.24
87+
Enabled: true
88+
2989
Metrics:
3090
Enabled: false
91+
92+
Security/CompoundHash: # new in 1.28
93+
Enabled: true
94+
Security/IoMethods: # new in 1.22
95+
Enabled: true
96+
3197
Style/AccessorGrouping:
3298
Enabled: true
99+
Style/ArgumentsForwarding: # new in 1.1
100+
Enabled: true
33101
Style/ArrayCoercion:
34102
Enabled: true
35103
Style/BisectedAttrAccessor:
36104
Enabled: true
37105
Style/CaseLikeIf:
38106
Enabled: true
107+
Style/CollectionCompact: # new in 1.2
108+
Enabled: true
39109
Style/Documentation:
40110
Enabled: false
111+
Style/DocumentDynamicEvalDefinition: # new in 1.1
112+
Enabled: true
113+
Style/EndlessMethod: # new in 1.8
114+
Enabled: true
41115
Style/ExponentialNotation:
42116
Enabled: true
117+
Style/FetchEnvVar: # new in 1.28
118+
Enabled: true
119+
Style/FileRead: # new in 1.24
120+
Enabled: true
121+
Style/FileWrite: # new in 1.24
122+
Enabled: true
43123
Style/HashAsLastArrayItem:
44124
Enabled: true
125+
Style/HashConversion: # new in 1.10
126+
Enabled: true
45127
Style/HashEachMethods:
46128
Enabled: true
129+
Style/HashExcept: # new in 1.7
130+
Enabled: true
47131
Style/HashLikeCase:
48132
Enabled: true
49133
Style/HashTransformKeys:
50134
Enabled: true
51135
Style/HashTransformValues:
52136
Enabled: true
137+
Style/IfWithBooleanLiteralBranches: # new in 1.9
138+
Enabled: true
139+
Style/InPatternThen: # new in 1.16
140+
Enabled: true
141+
Style/MapToHash: # new in 1.24
142+
Enabled: true
143+
Style/MultilineInPatternThen: # new in 1.16
144+
Enabled: true
145+
Style/NegatedIfElseCondition: # new in 1.2
146+
Enabled: true
147+
Style/NestedFileDirname: # new in 1.26
148+
Enabled: true
149+
Style/NilLambda: # new in 1.3
150+
Enabled: true
151+
Style/NumberedParameters: # new in 1.22
152+
Enabled: true
153+
Style/NumberedParametersLimit: # new in 1.22
154+
Enabled: true
155+
Style/ObjectThen: # new in 1.28
156+
Enabled: true
157+
Style/OpenStructUse: # new in 1.23
158+
Enabled: true
159+
Style/QuotedSymbols: # new in 1.16
160+
Enabled: true
161+
Style/RedundantArgument: # new in 1.4
162+
Enabled: true
53163
Style/RedundantAssignment:
54164
Enabled: true
55165
Style/RedundantFetchBlock:
56166
Enabled: true
57167
Style/RedundantFileExtensionInRequire:
58168
Enabled: true
169+
Style/RedundantInitialize: # new in 1.27
170+
Enabled: true
59171
Style/RedundantRegexpCharacterClass:
60172
Enabled: true
61173
Style/RedundantRegexpEscape:
62174
Enabled: true
175+
Style/RedundantSelfAssignmentBranch: # new in 1.19
176+
Enabled: true
177+
Style/SelectByRegexp: # new in 1.22
178+
Enabled: true
63179
Style/SlicingWithRange:
64180
Enabled: true
181+
Style/StringChars: # new in 1.12
182+
Enabled: true
183+
Style/SwapValues: # new in 1.1
184+
Enabled: true

README.markdown

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/atombender/multidb.png?branch=master)](https://travis-ci.org/atombender/multidb)
1+
[![Build Status](https://github.com/OutOfOrder/multidb/actions/workflows/prs.yml/badge.svg)](https://github.com/OutOfOrder/multidb/actions)
22

33
# Multidb
44

@@ -14,10 +14,11 @@ Randomized balancing of multiple connections within a group is supported. In the
1414

1515
## Requirements
1616

17-
* Ruby 2.4 or later.
17+
* Ruby 2.5 or later.
1818
* ActiveRecord 5.1 or later.
1919

2020
## Older releases
21+
For Ruby 2.4 use version 0.5.1
2122
For ActiveRecord 4. through 5.0 use version 0.3
2223
For ActiveRecord older than 4.0 use the gem version 0.1.13
2324
For ActiveRecord older than 3.0 use 0.1.10

ar-multidb.gemspec

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ Gem::Specification.new do |s|
1111
s.homepage = ''
1212
s.summary = s.description = 'Multidb is an ActiveRecord extension for switching between multiple database connections, such as primary/replica setups.'
1313
s.license = 'MIT'
14+
s.metadata['rubygems_mfa_required'] = 'true'
1415

1516
s.files = `git ls-files`.split("\n")
1617
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
1718
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
1819
s.require_paths = ['lib']
1920

20-
s.required_ruby_version = '>= 2.4.0'
21+
s.required_ruby_version = '>= 2.5.0'
2122

2223
s.add_runtime_dependency 'activerecord', '>= 5.1', '< 6.1'
2324
s.add_runtime_dependency 'activesupport', '>= 5.1', '< 6.1'
2425

25-
s.add_development_dependency 'rake', '~> 12.0'
26+
s.add_development_dependency 'rake', '~> 13.0'
2627
s.add_development_dependency 'rspec', '~> 3.8'
27-
s.add_development_dependency 'rubocop', '~> 1.12.1'
28+
s.add_development_dependency 'rubocop', '~> 1.12'
2829
s.add_development_dependency 'sqlite3', '~> 1.3'
2930
end

spec/balancer_spec.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
context 'undefined connection' do
6868
it 'raises exception' do
6969
lambda {
70-
Multidb.use(:something) do
71-
end
70+
Multidb.use(:something) { nil }
7271
}.should raise_error(ArgumentError)
7372
end
7473
end
@@ -151,10 +150,7 @@
151150
names.push(File.basename(list[0]['file']))
152151
end
153152
end
154-
names.sort.uniq.should eq [
155-
'test-replica3-1.sqlite',
156-
'test-replica3-2.sqlite'
157-
]
153+
names.sort.uniq.should eq %w[test-replica3-1.sqlite test-replica3-2.sqlite]
158154
end
159155
end
160156
end

0 commit comments

Comments
 (0)