Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 45acf5c

Browse files
authored
Update to support ruby 3.2 (#9)
1 parent d2cf0df commit 45acf5c

File tree

7 files changed

+24
-12
lines changed

7 files changed

+24
-12
lines changed

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
ruby:
16-
- 2.7
16+
- 3.2
1717
name: Ruby-${{matrix.ruby}}
1818
steps:
1919
- name: Check out

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
ruby:
21-
- 2.6
2221
- 2.7
2322
- 3.0
23+
- 3.2
2424
name: Ruby-${{matrix.ruby}}
2525
continue-on-error: ${{matrix.ruby == 'head'}}
2626
steps:

.rubocop.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ require:
22
- rubocop-performance
33

44
AllCops:
5+
TargetRubyVersion: 3.2
56
DisabledByDefault: true
67
Exclude:
78
- 'bin/{bundle,bundle-audit,bundler-audit,rackup,rake,rspec,rubocop}'
@@ -648,7 +649,7 @@ Style/GlobalVars:
648649
Style/GuardClause:
649650
Enabled: true
650651
Style/HashSyntax:
651-
Enabled: true
652+
Enabled: false
652653
Style/IdenticalConditionalBranches:
653654
Enabled: true
654655
Style/IfInsideElse:

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruby-2.6
1+
ruby-3.2

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66

77
# 0.2.0
88
- Update version of thor to have a broader availability ([#6](https://github.com/cerner/codeowner_validator/pull/6))
9+
10+
# 0.3.0
11+
- Update to support ruby 3.2 ([#9](https://github.com/cerner/codeowner_validator/pull/9))

codeowner_validator.gemspec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ Gem::Specification.new do |spec|
2727
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
2828
spec.require_paths = ['lib']
2929

30-
spec.required_ruby_version = '>= 2.6.2'
30+
# rubocop:disable Gemspec/RequiredRubyVersion
31+
# The intent is for supportability from ruby 2.7 and greater
32+
spec.required_ruby_version = '>= 2.7.6'
33+
# rubocop:enable Gemspec/RequiredRubyVersion
3134

3235
spec.add_dependency 'rainbow', '>= 2.0', '< 4.0.0'
3336
spec.add_dependency 'thor', '>= 0.19'

lib/codeowner_validator/helpers/utility_helper.rb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,23 @@ module UtilityHelper
1313
def in_folder(folder)
1414
raise "The folder location '#{folder}' does not exists" unless File.directory?(folder)
1515

16-
if defined?(Bundler)
17-
Bundler.with_clean_env do
18-
Dir.chdir folder do
19-
yield
20-
end
21-
end
22-
else
16+
with_clean_env do
2317
Dir.chdir folder do
2418
yield
2519
end
2620
end
2721
end
22+
23+
def with_clean_env
24+
return yield unless defined?(Bundler)
25+
26+
if Bundler.respond_to?(:with_unbundled_env)
27+
Bundler.with_unbundled_env { yield }
28+
else
29+
# Deprecated on Bundler 2.1
30+
Bundler.with_clean_env { yield }
31+
end
32+
end
2833
end
2934
end
3035
# rubocop:enable Style/ImplicitRuntimeError

0 commit comments

Comments
 (0)