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

Converted chruby to generic ruby #437

Merged
merged 12 commits into from
Sep 14, 2023
Prev Previous commit
Next Next commit
Only show the Ruby version if current directory has .rb files
  • Loading branch information
cmer committed Sep 7, 2023
commit f34097a6dfdf072b2cc38139dfe9bb1ca5628cbf
4 changes: 4 additions & 0 deletions functions/_tide_item_ruby.fish
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
function _tide_item_ruby
if test (count *.rb 2>/dev/null) -eq 0
return
end

if path is $_tide_parent_dirs/Gemfile || path is $_tide_parent_dirs/Rakefile || path is $_tide_parent_dirs/*.gemspec || path is $_tide_parent_dirs/.ruby-version || path is $_tide_parent_dirs/.tool-versions
_tide_print_item ruby $tide_ruby_icon' ' (ruby --version | string split ' ')[2]''
end
Expand Down
1 change: 1 addition & 0 deletions tests/_tide_item_ruby.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set -lx tide_ruby_icon 
_ruby # CHECK:

touch Gemfile
touch foo.rb

_ruby # CHECK:  3.2.0

Expand Down