Skip to content

Modernize wisper for the current Ruby ecosystem - #219

Open
dior001 wants to merge 3 commits into
krisleech:masterfrom
dior001:necro-ruby/modernize
Open

Modernize wisper for the current Ruby ecosystem#219
dior001 wants to merge 3 commits into
krisleech:masterfrom
dior001:necro-ruby/modernize

Conversation

@dior001

@dior001 dior001 commented Jul 26, 2026

Copy link
Copy Markdown

NecroRuby

NecroRuby has revived wisper

Modernized and tested on Ruby 4.0.6, the latest Ruby release.

At a glance

  • Test coverage: 0.0% → 100.0%
  • Dependencies: 10 updated or replaced
  • Security: 4 findings resolved
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

Before After
required_ruby_version >= 2.7 >= 3.2
CI Ruby matrix 2.7, 3.0, 3.1, 3.2, jruby 3.2, 3.3, 3.4, 4.0
Coverage tooling coveralls (broken install) simplecov, enforced at 100%
Lint none RuboCop + rubocop-performance + rubocop-rspec, zero offenses
Security scanning none bundler-audit, zero advisories
Line coverage unknown (suite could not install) 100% (246/246)
Branch coverage unknown 100% (32/32)
Test count 110 111

1. Dependencies

  • Removed coveralls. It is unmaintained (last released 2020) and its
    dependency chain (old faraday, thor, tins, term-ansicolor) no longer
    resolves cleanly against a modern Bundler/RubyGems, which meant bundle install
    failed 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.rb now calls SimpleCov.start with enable_coverage :branch
    and minimum_coverage line: 100, branch: 100, so the suite itself fails if
    coverage regresses.
  • Added rubocop + rubocop-performance + rubocop-rspec (dev group) for
    static analysis, with a repo-specific .rubocop.yml.
  • Added bundler-audit (dev group) for dependency vulnerability scanning,
    wired into Rakefile (rake bundle:audit:check) and a new audit CI job.
  • Dropped the flay dependency. It was listed but unused anywhere in the
    Rakefile 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).
  • Kept pry and yard (both actively maintained) in the :extras group.
  • No runtime dependencies changed — Wisper's runtime dependency list was, and
    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 as
before).

2. Compatibility fixes for Ruby 4.0.6 (and 3.2+)

  • .ruby-version added, set to 4.0.6. It was previously listed in
    .gitignore (unusual for a repo that wants a declared target); the ignore
    rule was removed so the file is actually tracked.
  • required_ruby_version raised to >= 3.2. 2.7-3.1 are long past their
    upstream 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#inspect format change (Ruby 3.4+). Ruby 3.4 changed
    Hash#inspect to render symbol keys as {x: :y} instead of {:x=>:y}.
    spec/lib/wisper/broadcasters/logger_broadcaster_spec.rb had four
    hardcoded {:x=>:y}-style expectations that broke on Ruby 4.0.6 as a
    result (LoggerBroadcaster#kwargs_info simply calls kwargs.inspect, so
    the library code was never wrong — only the test literals were
    version-specific). Fixed by interpolating kwargs.inspect instead of
    hardcoding the expected string, so the spec is correct for any Ruby.
  • Dead RUBY_VERSION < '3.0' branches removed from
    send_broadcaster_spec.rb and logger_broadcaster_spec.rb. These dated
    from the Ruby 2.7 -> 3.0 keyword-argument separation change and are
    unreachable now that the floor is 3.2.
  • Gemspec HOME-directory handling preserved correctly. RuboCop's
    Style/EnvHome cop suggests Dir.home over ENV['HOME'], but Dir.home
    raises if it can't resolve a home directory (e.g. HOME/USER both
    unset, 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 an
    empty string, with the cop locally disabled and a comment explaining why.
    Verified with env -u HOME -u USER gem build wisper.gemspec (succeeds
    before and after).
  • No other stdlib removals/deprecations affected this codebase — it only
    uses set, singleton, and forwardable, all still present and
    unchanged 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:

  • Dependencies: re-resolved Gemfile.lock against current RubyGems —
    all 34 resolved gems are already the current maintained releases
    (rubocop 1.90.0, rspec 3.13.2, bundler-audit 0.9.3, simplecov,
    pry 0.16.0, etc.). No version floors in the Gemfile/gemspec needed
    raising and no libraries were swapped.
  • Ruby/CI: .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.
  • New lint failure from a newer RuboCop: rubocop has since added the
    Style/DirectiveScope cop, which flags a rubocop:disable /
    rubocop:enable pair wrapping a single statement (the Style/EnvHome
    workaround in wisper.gemspec) in favor of a single disable-next
    directive. Switched to # rubocop:disable-next Style/EnvHome — same
    suppression, one line instead of a pair. Re-verified the HOME/USER-unset
    gem-build edge case still works after the change, and that bundle exec rubocop is clean again (30 files, no offenses).
  • Security audit: re-ran bundler-audit check --update against the
    latest ruby-advisory-db (1242 advisories, updated 2026-09-08) — no
    vulnerabilities found.
  • Tests: full suite still passes, 111 examples / 0 failures, 100% line
    (246/246) and branch (32/32) coverage, unchanged from before this pass.
  • Nothing else in this PR's scope or design changed.
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:

  1. Cut a feature branch from the commit this PR branched from. This PR
    itself is left completely alone — same branch, same diff, same threads.
  2. Open one sub-PR per concern — dependencies, CI, library code, tests,
    docs, lint — each targeting that feature branch, so you can review and
    approve them independently. Every file appears in exactly one part.
  3. Merge each part into the feature branch as you approve it.
  4. Tell you when every part has landed, at which point everything this PR
    proposes has been reviewed in a small, single-concern PR.

Nothing merges into master without you merging it.


🤖 Opened automatically by NecroRuby, an UpWoof.ai service.

NecroRuby 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant