Skip to content

Be friends with Claude by removing Arrays - #509

Open
kbrock wants to merge 1 commit into
postmodern:masterfrom
kbrock:discovery
Open

kbrock wants to merge 1 commit into
postmodern:masterfrom
kbrock:discovery

Conversation

@kbrock

@kbrock kbrock commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Goal

Claude doesn't work well with arrays. It keeps loosing my ruby version.

Also, when you install a ruby version, it is not available in terminals unless you rerun chruby.

Solution

It uses chruby_list() instead of RUBIES so the list of rubies is dynamic and not in a variable.

I tried to follow your direction for 1.0, just trimmed down so hopefully it can be closer to a 0.4.0 type change (0.3.10?)

Attribution

I asked Claude to push, but this is all my own code from a year or so ago. Sorry for the delay.

Thanks for the great project and avoiding the shims.

Drops the only array in the script, scanning for rubies dynamically
on each invocation instead of caching them into RUBIES at source time.
Uses `while IFS= read -r` to consume chruby_list() output rather than
unquoted command substitution, which word-splits and glob-expands and
behaves subtly differently between bash and zsh.
@kbrock kbrock changed the title Replace RUBIES array with chruby_list() function Be friends with Claude by removing Arrays Oct 8, 2026
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