|
|
|
@ -16,22 +16,23 @@ local version_formatted
|
|
|
|
|
unset ruby_info
|
|
|
|
|
typeset -gA ruby_info
|
|
|
|
|
|
|
|
|
|
# Grab formatting for anything we might have to do
|
|
|
|
|
zstyle -s ':prezto:module:ruby:info:version' format 'version_format'
|
|
|
|
|
|
|
|
|
|
if [[ -n "$version_format" ]]; then
|
|
|
|
|
if (( $+commands[rvm-prompt] )); then
|
|
|
|
|
version="$(rvm-prompt)"
|
|
|
|
|
elif (( $+commands[rbenv] )); then
|
|
|
|
|
version="$(rbenv version-name)"
|
|
|
|
|
if [[ $version == "system" ]]; then
|
|
|
|
|
version=""
|
|
|
|
|
fi
|
|
|
|
|
elif (( $+commands[ruby] )); then
|
|
|
|
|
version="${${$(ruby --version)[(w)1,(w)2]}/ /-}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Format version.
|
|
|
|
|
if [[ -n "$version" ]]; then
|
|
|
|
|
zstyle -s ':prezto:module:ruby:info:version' format 'version_format'
|
|
|
|
|
if [[ -n "$version" && "$version" != "system" ]]; then
|
|
|
|
|
zformat -f version_formatted "$version_format" "v:$version"
|
|
|
|
|
ruby_info[version]="$version_formatted"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# }
|
|
|
|
|