Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
Fix rbenv gems helper
Browse files Browse the repository at this point in the history
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 ohmyzsh#1579).
  • Loading branch information
jbhannah committed Feb 9, 2013
1 parent 6e6cf43 commit dace87a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/rbenv/rbenv.plugin.zsh
Expand Up @@ -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() {
Expand Down

0 comments on commit dace87a

Please sign in to comment.