Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move ruby discovery code into a function #493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kbrock
Copy link
Contributor

@kbrock kbrock commented Apr 26, 2023

When you install a new ruby in a different terminal shell, chruby does not pick up on the new ruby version.

The solution is to to source chruby.sh again.
Introducing chruby_discover which will allow any shell to pick up on the new ruby versions


Yes, I was trying to "optimize" this functionality in #492 - but this PR is not an optimization play.

I have had this function defined in my bashrc for a while and thought others may want it as well.

Copy link
Owner

@postmodern postmodern left a comment

Choose a reason for hiding this comment

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

Spotted a few stylistic things.

{
RUBIES=()
local dir
for dir in "$PREFIX/opt/rubies" "$HOME/.rubies"; do
Copy link
Owner

Choose a reason for hiding this comment

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

Shell script must be hard-tab indented.

done
}

chruby_discover
Copy link
Owner

Choose a reason for hiding this comment

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

I tend to put any non-function code at the end of the file.

@postmodern
Copy link
Owner

Since you're adding a new function, I would technically need to merge this into the 0.4.0 branch.

When you install a new ruby in a different terminal shell,
chruby does not pick up on the new ruby version.

The solution is to to source chruby.sh again.
Introducing chruby_discover which will allow any shell to pick up on the
new ruby versions
@kbrock
Copy link
Contributor Author

kbrock commented Apr 27, 2023

Fixed. Thanks for the feedback. I forgot all about tabs.

It is ok if you don't want to go this route and bump the major version.
If you like this route, do you need me to add documentation or changelog or anything?

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