Skip to content

feat(scripts): per-cycle ruby uninstall via RUBY_VERSION#109

Merged
CybotTM merged 1 commit into
mainfrom
feat/ruby-per-cycle-uninstall
Jul 16, 2026
Merged

feat(scripts): per-cycle ruby uninstall via RUBY_VERSION#109
CybotTM merged 1 commit into
mainfrom
feat/ruby-per-cycle-uninstall

Conversation

@CybotTM

@CybotTM CybotTM commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

The three multi-version runtimes were asymmetric on uninstall: node has NODE_VERSION=24 make uninstall-node, python has UV_PYTHON_SPEC=3.12 make uninstall-python, but make uninstall-ruby always removed all of ~/.rbenv (every version) plus apt ruby — there was no way to drop just an outdated cycle like ruby@3.3.

RUBY_VERSION=3.3 make uninstall-ruby now:

  • resolves the cycle against rbenv versions --bare (accepts 3.3 or 3.3.6)
  • switches rbenv global to the newest remaining version first when it points into the removed cycle
  • keeps rbenv and all other versions intact
  • no-ops with a clear message when the cycle isn't installed

Without RUBY_VERSION, the full uninstall behaves exactly as before.

Also splits four pre-existing SC2155 local x="$(…)" declarations — they blocked the shellcheck pre-commit hook on any change to this file.

Tests

  • tests/test_ruby_uninstall.py (5 tests, red→green, rbenv/sudo/dpkg/apt-get PATH-stubbed, HOME sandboxed): cycle-only removal, full-version spec, global-switch ordering, missing-cycle no-op, unchanged full uninstall
  • Full suite: 678 passed, 1 skipped; shellcheck clean; smoke tests pass
  • E2E on real system: RUBY_VERSION=3.1 install_ruby.sh uninstall → "not found" no-op, all installed versions untouched

RUBY_VERSION=3.3 make uninstall-ruby now removes only that cycle's
rbenv versions (switching rbenv global first when it points at the
removed cycle), matching NODE_VERSION and UV_PYTHON_SPEC semantics.
Without RUBY_VERSION the full uninstall (rm -rf ~/.rbenv + apt ruby)
is unchanged. Also splits pre-existing SC2155 declare/assigns that
blocked the shellcheck hook on this file.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Copilot AI review requested due to automatic review settings July 16, 2026 22:24
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@CybotTM
CybotTM merged commit a02aa4b into main Jul 16, 2026
19 of 20 checks passed
@CybotTM
CybotTM deleted the feat/ruby-per-cycle-uninstall branch July 16, 2026 22:28
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.

2 participants