Skip to content

Commit 0a437d3

Browse files
authored
Bump minimum required Ruby version to 3.1 (#347)
* Bump minimum required Ruby version to 3.1 Previous minimum was 2.7, which was end-of-life (EOL) 2023-03-31. 3.0 was EOL 2024-04-23 ([source][]). [source]: https://www.ruby-lang.org/en/downloads/branches/ * Bump Rubocop to get suppot for Ruby 3.1 * Jog CI
1 parent 1b72250 commit 0a437d3

File tree

6 files changed

+120
-26
lines changed

6 files changed

+120
-26
lines changed

.github/workflows/ci.yml

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717
strategy:
1818
matrix:
1919
ruby:
20-
- '2.7'
21-
- '3.0'
2220
- '3.1'
2321
- '3.2'
2422
steps:

.rubocop.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
# Disabling due to conflict with Ruby 2.7/3.1
2-
Layout/BlockAlignment:
3-
Enabled: false
1+
inherit_from: .rubocop_todo.yml
2+
43
Layout/DotPosition:
54
EnforcedStyle: trailing
65
Layout/EmptyLineAfterMagicComment:
76
Enabled: false
87
Layout/EmptyLines:
98
Enabled: false
109
Layout/LineLength:
11-
IgnoredPatterns:
10+
AllowedPatterns:
1211
- 'VCR\.use_cassette'
1312
- '(\A|\s)/.*?/'
1413
Metrics/BlockLength:
15-
ExcludedMethods: ['describe', 'context', 'before', 'it']
14+
AllowedMethods: ['describe', 'context', 'before', 'it']
1615
Metrics/MethodLength:
1716
Max: 30
1817
Metrics/ModuleLength:
@@ -28,4 +27,4 @@ Style/TrailingCommaInArguments:
2827
Style/TrailingCommaInHashLiteral:
2928
EnforcedStyleForMultiline: 'consistent_comma'
3029
AllCops:
31-
TargetRubyVersion: 2.7
30+
TargetRubyVersion: 3.1

.rubocop_todo.yml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2025-01-22 21:38:20 UTC using RuboCop version 1.71.0.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 1
10+
# This cop supports safe autocorrection (--autocorrect).
11+
# Configuration parameters: EnforcedStyleAlignWith.
12+
# SupportedStylesAlignWith: either, start_of_block, start_of_line
13+
Layout/BlockAlignment:
14+
Exclude:
15+
- 'spec/lib/workos/session_spec.rb'
16+
17+
# Offense count: 2
18+
# This cop supports safe autocorrection (--autocorrect).
19+
Layout/EmptyLinesAroundMethodBody:
20+
Exclude:
21+
- 'lib/workos/mfa.rb'
22+
- 'lib/workos/user_management.rb'
23+
24+
# Offense count: 1
25+
# This cop supports safe autocorrection (--autocorrect).
26+
Layout/SpaceAroundMethodCallOperator:
27+
Exclude:
28+
- 'spec/lib/workos/directory_sync_spec.rb'
29+
30+
# Offense count: 1
31+
# This cop supports unsafe autocorrection (--autocorrect-all).
32+
Lint/DuplicateRequire:
33+
Exclude:
34+
- 'lib/workos/session.rb'
35+
36+
# Offense count: 3
37+
# Configuration parameters: AllowedParentClasses.
38+
Lint/MissingSuper:
39+
Exclude:
40+
- 'lib/workos/directory_group.rb'
41+
- 'lib/workos/directory_user.rb'
42+
- 'lib/workos/errors.rb'
43+
44+
# Offense count: 5
45+
# Configuration parameters: CountComments, CountAsOne.
46+
Metrics/ClassLength:
47+
Max: 624
48+
49+
# Offense count: 8
50+
# This cop supports safe autocorrection (--autocorrect).
51+
# Configuration parameters: EnforcedStyle.
52+
# SupportedStyles: separated, grouped
53+
Style/AccessorGrouping:
54+
Exclude:
55+
- 'lib/workos/errors.rb'
56+
57+
# Offense count: 34
58+
# This cop supports safe autocorrection (--autocorrect).
59+
# Configuration parameters: EnforcedStyle.
60+
# SupportedStyles: braces, no_braces
61+
Style/HashAsLastArrayItem:
62+
Exclude:
63+
- 'spec/lib/workos/directory_sync_spec.rb'
64+
- 'spec/lib/workos/event_spec.rb'
65+
- 'spec/lib/workos/organizations_spec.rb'
66+
- 'spec/lib/workos/sso_spec.rb'
67+
- 'spec/lib/workos/user_management_spec.rb'
68+
69+
# Offense count: 2
70+
# This cop supports safe autocorrection (--autocorrect).
71+
Style/KeywordParametersOrder:
72+
Exclude:
73+
- 'lib/workos/organizations.rb'
74+
75+
# Offense count: 3
76+
# This cop supports unsafe autocorrection (--autocorrect-all).
77+
# Configuration parameters: SafeForConstants.
78+
Style/RedundantFetchBlock:
79+
Exclude:
80+
- 'spec/lib/workos/cache_spec.rb'
81+
82+
# Offense count: 1
83+
# This cop supports safe autocorrection (--autocorrect).
84+
# Configuration parameters: AllowMultipleReturnValues.
85+
Style/RedundantReturn:
86+
Exclude:
87+
- 'lib/workos/directory_user.rb'
88+
89+
# Offense count: 2
90+
# This cop supports unsafe autocorrection (--autocorrect-all).
91+
Style/SlicingWithRange:
92+
Exclude:
93+
- 'lib/workos/deprecated_hash_wrapper.rb'
94+
- 'lib/workos/session.rb'

Gemfile.lock

+19-14
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ GEM
1919
diff-lcs (1.5.1)
2020
encryptor (3.0.0)
2121
hashdiff (1.1.0)
22+
json (2.9.1)
2223
jwt (2.10.1)
2324
base64
24-
parallel (1.24.0)
25-
parser (3.3.0.5)
25+
language_server-protocol (3.17.0.3)
26+
parallel (1.26.3)
27+
parser (3.3.7.0)
2628
ast (~> 2.4.1)
2729
racc
2830
public_suffix (5.0.4)
29-
racc (1.7.3)
31+
racc (1.8.1)
3032
rainbow (3.1.1)
31-
regexp_parser (2.9.0)
33+
regexp_parser (2.10.0)
3234
rexml (3.2.6)
3335
rspec (3.9.0)
3436
rspec-core (~> 3.9.0)
@@ -43,19 +45,22 @@ GEM
4345
diff-lcs (>= 1.2.0, < 2.0)
4446
rspec-support (~> 3.9.0)
4547
rspec-support (3.9.4)
46-
rubocop (0.93.1)
48+
rubocop (1.71.0)
49+
json (~> 2.3)
50+
language_server-protocol (>= 3.17.0)
4751
parallel (~> 1.10)
48-
parser (>= 2.7.1.5)
52+
parser (>= 3.3.0.2)
4953
rainbow (>= 2.2.2, < 4.0)
50-
regexp_parser (>= 1.8)
51-
rexml
52-
rubocop-ast (>= 0.6.0)
54+
regexp_parser (>= 2.9.3, < 3.0)
55+
rubocop-ast (>= 1.36.2, < 2.0)
5356
ruby-progressbar (~> 1.7)
54-
unicode-display_width (>= 1.4.0, < 2.0)
55-
rubocop-ast (1.31.2)
56-
parser (>= 3.3.0.4)
57+
unicode-display_width (>= 2.4.0, < 4.0)
58+
rubocop-ast (1.37.0)
59+
parser (>= 3.3.1.0)
5760
ruby-progressbar (1.13.0)
58-
unicode-display_width (1.8.0)
61+
unicode-display_width (3.1.4)
62+
unicode-emoji (~> 4.0, >= 4.0.4)
63+
unicode-emoji (4.0.4)
5964
vcr (5.0.0)
6065
webmock (3.23.0)
6166
addressable (>= 2.8.0)
@@ -68,7 +73,7 @@ PLATFORMS
6873
DEPENDENCIES
6974
bundler (>= 2.0.1)
7075
rspec (~> 3.9.0)
71-
rubocop (~> 0.77)
76+
rubocop (~> 1.71)
7277
vcr (~> 5.0.0)
7378
webmock
7479
workos!

lib/workos/session.rb

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
module WorkOS
1212
# The Session class provides helper methods for working with WorkOS sessions
1313
# This class is not meant to be instantiated in a user space, and is instantiated internally but exposed.
14-
# rubocop:disable Metrics/ClassLength
1514
class Session
1615
attr_accessor :jwks, :jwks_algorithms, :user_management, :cookie_password, :session_data, :client_id
1716

@@ -180,5 +179,4 @@ def is_valid_jwt(token)
180179
end
181180
# rubocop:enable Naming/PredicateName
182181
end
183-
# rubocop:enable Metrics/ClassLength
184182
end

workos.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Gem::Specification.new do |spec|
2626

2727
spec.add_development_dependency 'bundler', '>= 2.0.1'
2828
spec.add_development_dependency 'rspec', '~> 3.9.0'
29-
spec.add_development_dependency 'rubocop', '~> 0.77'
29+
spec.add_development_dependency 'rubocop', '~> 1.71'
3030
spec.add_development_dependency 'vcr', '~> 5.0.0'
3131
spec.add_development_dependency 'webmock'
3232

33-
spec.required_ruby_version = '>= 2.7'
33+
spec.required_ruby_version = '>= 3.1'
3434
end

0 commit comments

Comments
 (0)