From 29bb57d7cd164da38095f2af75caa49c02a99af0 Mon Sep 17 00:00:00 2001 From: Ilan Cosman Date: Fri, 8 Sep 2023 15:18:08 -0700 Subject: [PATCH] Refactor --- functions/_tide_item_ruby.fish | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions/_tide_item_ruby.fish b/functions/_tide_item_ruby.fish index 5135be8e..b88f27d5 100644 --- a/functions/_tide_item_ruby.fish +++ b/functions/_tide_item_ruby.fish @@ -1,5 +1,6 @@ function _tide_item_ruby - 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]'' + if path is $_tide_parent_dirs/{*.gemspec,Gemfile,Rakefile,.ruby-version,.tool-versions} + ruby --version | string match -qr "(?[\d.]+)" + _tide_print_item ruby $tide_ruby_icon' ' $v end end