From dace87ae361722c0332c18e5470ca10f16720f7f Mon Sep 17 00:00:00 2001 From: "Jesse B. Hannah" Date: Fri, 8 Feb 2013 19:11:40 -0700 Subject: [PATCH] Fix rbenv gems helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes gem versions with words (beta, pre) in the version or with multiple installed versions not being highlighted, and compatibility with GNU sed (related to robbyrussell/oh-my-zsh#1579). --- plugins/rbenv/rbenv.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index d855c2445..fb9df4bdd 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -32,11 +32,11 @@ for rbenvdir in "${rbenvdirs[@]}" ; do function gems { local rbenv_path=$(rbenv prefix) - gem list $@ | sed \ - -Ee "s/\([0-9\.]+( .+)?\)/$fg[blue]&$reset_color/g" \ - -Ee "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \ - -Ee "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ - -Ee "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" + gem list $@ | sed -E \ + -e "s/\([0-9a-z, \.]+( .+)?\)/$fg[blue]&$reset_color/g" \ + -e "s|$(echo $rbenv_path)|$fg[magenta]\$rbenv_path$reset_color|g" \ + -e "s/$current_ruby@global/$fg[yellow]&$reset_color/g" \ + -e "s/$current_ruby$current_gemset$/$fg[green]&$reset_color/g" } function rbenv_prompt_info() {