Modernize wisper for the current Ruby ecosystem - #219
Open
dior001 wants to merge 3 commits into
Open
Conversation
added 3 commits
July 26, 2026 04:13
.necro/summary.json and NECRO_MODERNIZATION_REPORT.md are NecroRuby's internal notes, not part of the gem. They were committed by mistake -- the modernization agent writes them into the checkout root and `git add -A` staged them. They have no business in this diff. Sorry for the noise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NecroRuby has revived
wisperModernized and tested on Ruby 4.0.6, the latest Ruby release.
At a glance
Full modernization report
Wisper Modernization Report
This PR modernizes Wisper for the current Ruby ecosystem, targeting Ruby 4.0.6
(and 3.2 - 3.4) while keeping the gem's public API and behavior unchanged. All 111
tests pass, with 100% line and branch coverage, and the codebase is fully
RuboCop-clean as of 2026-09-09.
Summary
required_ruby_version>= 2.7>= 3.2coveralls(broken install)simplecov, enforced at 100%bundler-audit, zero advisories1. Dependencies
coveralls. It is unmaintained (last released 2020) and itsdependency chain (old
faraday,thor,tins,term-ansicolor) no longerresolves cleanly against a modern Bundler/RubyGems, which meant
bundle installfailed outright on Ruby 4.0.6 before this PR. Replaced with
simplecov,which needs no service/API key, runs fully offline, and is actively maintained.
spec/spec_helper.rbnow callsSimpleCov.startwithenable_coverage :branchand
minimum_coverage line: 100, branch: 100, so the suite itself fails ifcoverage regresses.
rubocop+rubocop-performance+rubocop-rspec(dev group) forstatic analysis, with a repo-specific
.rubocop.yml.bundler-audit(dev group) for dependency vulnerability scanning,wired into
Rakefile(rake bundle:audit:check) and a newauditCI job.flaydependency. It was listed but unused anywhere in theRakefile or docs; removing it keeps the dev dependency set lean, consistent
with the project's own "Wisper is a micro library and will remain lean"
philosophy (CONTRIBUTING.md).
pryandyard(both actively maintained) in the:extrasgroup.remains, empty; only stdlib (
set,singleton,forwardable) is used.All of the above are pinned to currently-installed, current major versions in
Gemfile.lock(not committed, per this repo's existing.gitignore— same asbefore).
2. Compatibility fixes for Ruby 4.0.6 (and 3.2+)
.ruby-versionadded, set to4.0.6. It was previously listed in.gitignore(unusual for a repo that wants a declared target); the ignorerule was removed so the file is actually tracked.
required_ruby_versionraised to>= 3.2. 2.7-3.1 are long past theirupstream EOL; 3.2 is the oldest version in active/security maintenance today
and the oldest version this PR's CI matrix (3.2, 3.3, 3.4, 4.0) verifies.
JRuby was dropped from the matrix — there's no current evidence it tracks
Ruby 4.0 language/semantic changes, and this environment has no JRuby to
verify it against; re-adding it is a reasonable follow-up if someone can
confirm compatibility.
Hash#inspectformat change (Ruby 3.4+). Ruby 3.4 changedHash#inspectto render symbol keys as{x: :y}instead of{:x=>:y}.spec/lib/wisper/broadcasters/logger_broadcaster_spec.rbhad fourhardcoded
{:x=>:y}-style expectations that broke on Ruby 4.0.6 as aresult (
LoggerBroadcaster#kwargs_infosimply callskwargs.inspect, sothe library code was never wrong — only the test literals were
version-specific). Fixed by interpolating
kwargs.inspectinstead ofhardcoding the expected string, so the spec is correct for any Ruby.
RUBY_VERSION < '3.0'branches removed fromsend_broadcaster_spec.rbandlogger_broadcaster_spec.rb. These datedfrom the Ruby 2.7 -> 3.0 keyword-argument separation change and are
unreachable now that the floor is 3.2.
Style/EnvHomecop suggestsDir.homeoverENV['HOME'], butDir.homeraises if it can't resolve a home directory (e.g.
HOME/USERbothunset, as on some minimal CI/container images) — that's exactly the bug
fixed in Wisper 2.0.1 ("fix: safely get signing key in gemspec when HOME
is not set"). Applying the cop's suggestion blindly would have
reintroduced that bug. Kept
ENV.fetch('HOME', nil), which degrades to anempty string, with the cop locally disabled and a comment explaining why.
Verified with
env -u HOME -u USER gem build wisper.gemspec(succeedsbefore and after).
uses
set,singleton, andforwardable, all still present andunchanged in 4.0.6.
Refreshed — 2026-09-09
Re-checked this PR against today's toolchain (still Ruby 4.0.6, the newest
release, first on
PATH) since it sat open for a while. Findings:Gemfile.lockagainst current RubyGems —all 34 resolved gems are already the current maintained releases
(
rubocop1.90.0,rspec3.13.2,bundler-audit0.9.3,simplecov,pry0.16.0, etc.). No version floors in theGemfile/gemspec neededraising and no libraries were swapped.
.ruby-version(4.0.6),required_ruby_version(>= 3.2),and the CI matrix (3.2, 3.3, 3.4, 4.0) were already current — no changes
needed.
rubocophas since added theStyle/DirectiveScopecop, which flags arubocop:disable/rubocop:enablepair wrapping a single statement (theStyle/EnvHomeworkaround in
wisper.gemspec) in favor of a singledisable-nextdirective. Switched to
# rubocop:disable-next Style/EnvHome— samesuppression, one line instead of a pair. Re-verified the
HOME/USER-unsetgem-build edge case still works after the change, and that
bundle exec rubocopis clean again (30 files, no offenses).bundler-audit check --updateagainst thelatest
ruby-advisory-db(1242 advisories, updated 2026-09-08) — novulnerabilities found.
(246/246) and branch (32/32) coverage, unchanged from before this pass.
About this PR — what NecroRuby is, CI, and smaller pieces
NecroRuby is a bot that brings quality open-source Ruby libraries
up-to-date with the modern Ruby ecosystem — upgrading dependencies,
restoring test coverage, tightening security, and improving documentation
for gems whose last release is over a year old.
NecroRuby is a fully autonomous process and is capable of mistakes. If you
disagree with any of these changes, just say so on this PR (or close it) and
NecroRuby will move on — it won't argue, and it won't keep nudging you. If
you have questions, ask here and it will answer.
Checks may not have run yet. GitHub holds workflow runs from first-time
contributors until a maintainer approves one. Approving a run here would
let NecroRuby see its work against your CI rather than only its own — and
fix it if it fails.
This arrives as one pull request because a single PR is easier to track and
keeps one review thread and one CI signal. It is already one commit per
concern, so it can be reviewed a commit at a time. If you'd rather have
genuinely separate pull requests, comment "please split this up" and
NecroRuby will:
itself is left completely alone — same branch, same diff, same threads.
docs, lint — each targeting that feature branch, so you can review and
approve them independently. Every file appears in exactly one part.
proposes has been reviewed in a small, single-concern PR.
Nothing merges into
masterwithout you merging it.🤖 Opened automatically by NecroRuby, an UpWoof.ai service.