Skip to content

Commit 451ae05

Browse files
tas50claude
andcommitted
Require Ruby 3.1+ and modernize CI
- Set required_ruby_version to ">= 3.1" in the gemspec - Standardize .rubocop.yml on cookstyle/chefstyle with TargetRubyVersion 3.1 (the standalone `chefstyle` gem no longer loads, which broke linting) - Run unit tests on every Ruby release from 3.1 to 4.0 and run cookstyle --chefstyle on Ruby 3.1 - Add the cookstyle bundler group where it was missing so `bundle exec cookstyle` resolves in CI - Apply cookstyle --chefstyle autocorrections - Drop dead linters (cane, tailor, finstyle, standalone chefstyle) that are superseded by cookstyle and fail on modern Ruby Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Tim Smith <tsmith84@proton.me>
1 parent d8f108a commit 451ae05

30 files changed

Lines changed: 174 additions & 175 deletions

.github/workflows/lint.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: "Test"
3+
4+
"on":
5+
pull_request:
6+
7+
jobs:
8+
lint-unit:
9+
uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main

.rubocop.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
require:
3+
- cookstyle/chefstyle
4+
5+
AllCops:
6+
TargetRubyVersion: 3.1
7+
Include:
8+
- "**/*.rb"
9+
Exclude:
10+
- "vendor/**/*"
11+
- "spec/**/*"

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ group :guard do
77
gem 'guard-cucumber'
88
gem 'guard-cane'
99
end
10+
11+
group :cookstyle do
12+
gem "cookstyle"
13+
end

Rakefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require "bundler/gem_tasks"
22
require 'rake/testtask'
33
require 'cucumber/rake/task'
4-
require 'cane/rake_task'
54

65
Rake::TestTask.new(:unit) do |t|
76
t.libs.push "lib"
@@ -16,10 +15,6 @@ end
1615
desc "Run all test suites"
1716
task :test => [:unit, :features]
1817

19-
desc "Run cane to check quality metrics"
20-
Cane::RakeTask.new do |cane|
21-
cane.canefile = './.cane'
22-
end
2318

2419
desc "Display LOC stats"
2520
task :stats do
@@ -30,6 +25,6 @@ task :stats do
3025
end
3126

3227
desc "Run all quality tasks"
33-
task :quality => [:cane, :stats]
28+
task :quality => [:stats]
3429

3530
task :default => [:test, :quality]

bin/busser

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env ruby
2-
# -*- encoding: utf-8 -*-
3-
42
$:.unshift File.join(File.dirname(__FILE__), %w{.. lib})
5-
require 'rubygems' unless defined?(Gem)
6-
require 'busser/cli'
3+
require "rubygems" unless defined?(Gem)
4+
require "busser/cli"
75

86
Busser::CLI.start

busser.gemspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ Gem::Specification.new do |spec|
1818
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
1919
spec.require_paths = ["lib"]
2020

21-
spec.required_ruby_version = ">= 1.9.1"
21+
spec.required_ruby_version = ">= 3.1"
2222

2323
spec.add_dependency 'thor', '<= 1.1.0'
2424

2525
spec.add_development_dependency 'aruba', "0.7.4"
2626
spec.add_development_dependency "bundler"
27-
spec.add_development_dependency 'cane'
2827
spec.add_development_dependency 'countloc'
2928
spec.add_development_dependency 'fakefs'
3029
spec.add_development_dependency 'minitest'

features/support/env.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
require 'aruba/cucumber'
2-
require 'busser/cucumber'
1+
require "aruba/cucumber"
2+
require "busser/cucumber"
33

44
if ENV["COVERAGE"]
5-
require 'simplecov'
5+
require "simplecov"
66
SimpleCov.command_name "features"
77
end
88

lib/busser.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- encoding: utf-8 -*-
21
#
32
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
43
#
@@ -16,9 +15,9 @@
1615
# See the License for the specific language governing permissions and
1716
# limitations under the License.
1817

19-
require 'pathname' unless defined?(Pathname)
18+
require "pathname" unless defined?(Pathname)
2019

21-
require 'busser/version'
20+
require "busser/version"
2221

2322
# Busser - Runs tests for projects in Test Kitchen.
2423
#
@@ -30,6 +29,6 @@ module Busser
3029
#
3130
# @return [Pathname] root path of gem
3231
def self.source_root
33-
@source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
32+
@source_root ||= Pathname.new(File.expand_path("..", __dir__))
3433
end
3534
end

lib/busser/cli.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- encoding: utf-8 -*-
21
#
32
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
43
#
@@ -16,12 +15,12 @@
1615
# See the License for the specific language governing permissions and
1716
# limitations under the License.
1817

19-
require 'busser/thor'
20-
require 'busser/command/deserialize'
21-
require 'busser/command/plugin'
22-
require 'busser/command/setup'
23-
require 'busser/command/suite'
24-
require 'busser/command/test'
18+
require "busser/thor"
19+
require "busser/command/deserialize"
20+
require "busser/command/plugin"
21+
require "busser/command/setup"
22+
require "busser/command/suite"
23+
require "busser/command/test"
2524

2625
module Busser
2726

lib/busser/command/deserialize.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- encoding: utf-8 -*-
21
#
32
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
43
#
@@ -16,10 +15,10 @@
1615
# See the License for the specific language governing permissions and
1716
# limitations under the License.
1817

19-
require 'base64' unless defined?(Base64)
20-
require 'digest' unless defined?(Digest)
18+
require "base64" unless defined?(Base64)
19+
require "digest" unless defined?(Digest)
2120

22-
require 'busser/thor'
21+
require "busser/thor"
2322

2423
module Busser
2524

@@ -31,11 +30,11 @@ module Command
3130
#
3231
class Deserialize < Busser::Thor::BaseGroup
3332

34-
class_option :destination, :desc => "Destination file path"
33+
class_option :destination, desc: "Destination file path"
3534

36-
class_option :md5sum, :desc => "MD5 digest of original file"
35+
class_option :md5sum, desc: "MD5 digest of original file"
3736

38-
class_option :perms, :desc => "Unix permissions on destination file"
37+
class_option :perms, desc: "Unix permissions on destination file"
3938

4039
def perform
4140
file = File.expand_path(options[:destination])

0 commit comments

Comments
 (0)