feat(scripts): per-cycle ruby uninstall via RUBY_VERSION#109
Merged
Conversation
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>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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.
Summary
The three multi-version runtimes were asymmetric on uninstall: node has
NODE_VERSION=24 make uninstall-node, python hasUV_PYTHON_SPEC=3.12 make uninstall-python, butmake uninstall-rubyalways removed all of~/.rbenv(every version) plus apt ruby — there was no way to drop just an outdated cycle likeruby@3.3.RUBY_VERSION=3.3 make uninstall-rubynow:rbenv versions --bare(accepts3.3or3.3.6)rbenv globalto the newest remaining version first when it points into the removed cycleWithout
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 uninstallRUBY_VERSION=3.1 install_ruby.sh uninstall→ "not found" no-op, all installed versions untouched