Check GEM_HOME to compare recency

This commit is contained in:
Zhao Cai 2013-04-28 21:15:56 -04:00
parent d2ce821cc8
commit d3a6d8fbcc
1 changed files with 11 additions and 1 deletions

View File

@ -509,8 +509,18 @@ _gem_which() {
}
_gem_extensions_caching_policy() {
if [[ -n $GEM_HOME ]]; then
gem_home=$GEM_HOME
else
gem_home=$(_call_program commands ${words[1]} env gemdir)
fi
# Rebuild if gems directory is more recent than cache.
[[ $gem_home/gems -nt "$1" ]] && return 0
# Rebuild if cache is older than one week.
local -a oldp
oldp=( "$1"(Nm+1) )
oldp=( "$1"(Nmw+1) )
(( $#oldp ))
}