tide
tide copied to clipboard
Add Ruby support
Description
Add a new prompt section (Tide Item) for Ruby. This should support package manager installs and Rbenv/RVM, though I've only tested with RVM
Screenshots (if appropriate)
How Has This Been Tested
- [ ] I have tested using Linux.
- [x] I have tested using MacOS.
Checklist
- [ ] I have updated the documentation accordingly.
- [x] I have updated the tests accordingly.
I didn't check the documentation box because the docs are a wiki and I figured it would be better to update after the PR is merged.
It appears the lint failure is unrelated to these changes.
Thanks for the PR Caleb 😄
-
I think we should do what we did for
node
here. I.E. instead of an item for each version manager, have aruby
item that printsruby --version
. Assuming your version manager is set up correctly, this should do the same thing. You can code that up if you wish, or I can 👍 -
Thanks for adding that Wiki page. I was going to do something similar eventually, I swear 😅
-
Correcting a small misconception (I think?):
_tide_print_item
has no knowledge about icons. Instead we take advantage of Fish's cartesian expansion system, which makes it so thatprintf %s $var_that_is_empty_or_unset"hello"
prints nothing. So_tide_print_item
doesn't ever ever consider icons, it just sees text or nothing.
_tide_print_item
has no knowledge about icons
That definitely was a misconception for me. I wondered about the syntax. It almost looked like a mistake to have $icon' '
, but it worked, and it stopped working if I added a space between them so I assumed it was something print item was doing for me.
I've changed it over to ruby (https://github.com/calebmeyer/tide/commit/c7b674b63935e9c497e9a56699512b2fac3d8634), but locally all my tests (make
) are failing with some indecipherable unicode stuff (apparently we're getting an extra character somehow?):
Okay, looks like the tests (other than the linter) are happy again. Not sure why they stopped working for me locally. I may have to uninstall/reinstall to be able to use them.
I believe this should now also be removed? https://github.com/IlanCosman/tide/blob/main/functions/_tide_item_chruby.fish
Yah sorry for not moving on this. It has been my intention to wait for 6.0 on this because it is a breaking change in that it will involve removing chruby
.
Thanks @calebmeyer for this MR!
You motivated me to create a PR to add Crystal support.
However, I am having a little of bit of trouble testing live. I was trying to re-create the screenshots you have here, but after running make
, I exit my Fish shell, get back in to Fish, move to a directory with a Crystal project file and my tide prompt for Crystal doesn't show. This is all despite that the make test
for Crystal passes. Maybe you can help me test?
does it make sense to change chruby
in the _tide_remove_unusable_items.fish file?
Could we get this merged, @IlanCosman ?
I have created a new version of this including test at #437. Inspired by the work in this PR. Would love feedback.
@cmer Thanks for the PR, I'll take a look at it ~1 week from now when I have time :)
Closing this in favor of #437