tide icon indicating copy to clipboard operation
tide copied to clipboard

Add Ruby support

Open calebmeyer opened this issue 3 years ago • 9 comments

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)

image

How Has This Been Tested

  • [ ] I have tested using Linux.
  • [x] I have tested using MacOS.

image

Checklist

  • [ ] I have updated the documentation accordingly.
  • [x] I have updated the tests accordingly.

calebmeyer avatar Dec 29 '21 18:12 calebmeyer

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.

calebmeyer avatar Dec 29 '21 18:12 calebmeyer

It appears the lint failure is unrelated to these changes.

calebmeyer avatar Dec 29 '21 18:12 calebmeyer

Thanks for the PR Caleb 😄

  1. I think we should do what we did for node here. I.E. instead of an item for each version manager, have a ruby item that prints ruby --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 👍

  2. Thanks for adding that Wiki page. I was going to do something similar eventually, I swear 😅

  3. 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 that printf %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.

IlanCosman avatar Dec 30 '21 18:12 IlanCosman

_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?): image

calebmeyer avatar Jan 03 '22 16:01 calebmeyer

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.

calebmeyer avatar Jan 03 '22 16:01 calebmeyer

I believe this should now also be removed? https://github.com/IlanCosman/tide/blob/main/functions/_tide_item_chruby.fish

pusewicz avatar Mar 01 '22 14:03 pusewicz

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.

IlanCosman avatar Apr 21 '22 04:04 IlanCosman

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?

rrevi avatar Aug 04 '22 20:08 rrevi

does it make sense to change chruby in the _tide_remove_unusable_items.fish file?

rrevi avatar Aug 05 '22 19:08 rrevi

Could we get this merged, @IlanCosman ?

cmer avatar Aug 30 '23 21:08 cmer

I have created a new version of this including test at #437. Inspired by the work in this PR. Would love feedback.

cmer avatar Sep 03 '23 15:09 cmer

@cmer Thanks for the PR, I'll take a look at it ~1 week from now when I have time :)

IlanCosman avatar Sep 03 '23 15:09 IlanCosman

Closing this in favor of #437

IlanCosman avatar Sep 09 '23 00:09 IlanCosman