Update Sunzi (server provisioning tool) from 2018-era dependencies to modern Ruby ecosystem.
Verified minimum Ruby version for net-ssh ~> 7 and thor ~> 1.3 is 2.6.
Set spec.required_ruby_version accordingly.
File: sunzi.gemspec
| Dependency | Current | New |
|---|---|---|
thor |
unrestricted | ~> 1.3 |
net-ssh |
< 5 |
~> 7.0 |
rainbow |
~> 3.0 |
(keep) |
hashugar |
unrestricted | (keep) |
minitest |
unrestricted | ~> 6.0 |
Also add:
spec.required_ruby_version = '>= 2.6'
File: README.md
Leave YAML.load(ERB.new(File.read('sunzi.yml')).result) as-is for maximum compatibility.
Add a short README note that sunzi.yml must be fully trusted because ERB executes Ruby
and YAML.load can instantiate arbitrary objects.
Delete: .travis.yml
Create: .github/workflows/test.yml
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['3.1', '3.2', '3.3']
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake testFile: README.md
- Replace Travis badge with GitHub Actions badge (ensure workflow name/branch match the badge URL).
- Add a short Requirements note for the minimum supported Ruby (from step 1).
Create: .ruby-version with content 3.2
File: templates/create/sunzi.yml
Update ruby_version: 2.5 to match the modern baseline (e.g., 3.2).
File: CHANGELOG.md
Add a 3.0.0 entry with the breaking changes (Ruby requirement, dependency bumps, CI migration).
File: sunzi.gemspec:5
Update version from 2.1.0 to 3.0.0 (major bump due to Ruby version requirement change).
If a version constant exists (e.g., lib/sunzi/version.rb), update it too.
| Action | File |
|---|---|
| Edit | sunzi.gemspec |
| Edit | README.md |
| Edit | templates/create/sunzi.yml |
| Edit | CHANGELOG.md |
| Delete | .travis.yml |
| Create | .github/workflows/test.yml |
| Create | .ruby-version |
- Run
bundle installto update Gemfile.lock - Run
bundle exec rake testto verify tests pass - Run
bundle exec sunzi versionandbundle exec sunzi create test_projectto verify CLI works