Skip to content

Commit

Permalink
Returns are now through utility and some of gemsets
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Sep 5, 2010
1 parent 70ccfa6 commit fb1f49e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
17 changes: 14 additions & 3 deletions scripts/gemsets
Expand Up @@ -385,6 +385,7 @@ gemset_info() {
else
gem env $action
fi
return $?
}

gemset_prune() {
Expand All @@ -399,18 +400,25 @@ gemset_prune() {
cached_gem_name="${gem_name}-${version}.gem"
cached_file_path="${live_cache_path}/${cached_gem_name}"
if [[ -f "$cached_file_path" ]]; then
mv "$cached_file_path" "${temporary_cache_path}/${cached_gem_name}"
\mv "$cached_file_path" "${temporary_cache_path}/${cached_gem_name}"
fi
done
done < <(gem list --versions)
"$rvm_scripts_path/log" "info" "Removing live cache and restoring temporary cache..."
# Switch the cache back.
\rm -rf "$live_cache_path"
mv "$temporary_cache_path" "$live_cache_path"
\mv "$temporary_cache_path" "$live_cache_path"
return 0
}

gemset_pristine() {
gem pristine --all
if command -v gem > /dev/null ; then
gem pristine --all
return $?
else
"$rvm_scripts_path/log" "error" "'gem' command not found in PATH"
return 1
fi
}

# Loads the default gemsets for the current interpreter and gemset.
Expand All @@ -431,7 +439,10 @@ gemset_initial() {
fi
fi
done

"$rvm_scripts_path/log" "info" "Installation of gems for $(__rvm_environment_identifier) is complete."

return 0
}

unset GEM_PATH
Expand Down
6 changes: 5 additions & 1 deletion scripts/info
Expand Up @@ -5,7 +5,9 @@ source "$rvm_scripts_path/version"

rvm_ruby_gem_home="${rvm_ruby_gem_home:-$GEM_HOME}"

if [[ ! -d "$rvm_ruby_gem_home" ]] && command -v gem > /dev/null 2>&1; then rvm_ruby_gem_home="$(gem env home)" ; fi
if [[ ! -d "$rvm_ruby_gem_home" ]] && command -v gem > /dev/null 2>&1; then
rvm_ruby_gem_home="$(gem env home)"
fi

version_for() {
local binary=$1
Expand Down Expand Up @@ -142,3 +144,5 @@ else
info_sections
done
fi

exit 0
9 changes: 9 additions & 0 deletions scripts/utility
Expand Up @@ -818,23 +818,27 @@ __rvm_rvmrc_key() {
__rvm_reset_rvmrc_trust() {
touch "$rvm_config_path/rvmrcs"
"$rvm_scripts_path/db" "$rvm_config_path/rvmrcs" "$(__rvm_rvmrc_key "$1")" "delete" >/dev/null 2>&1
return $?
}

__rvm_trust_rvmrc() {
touch "$rvm_config_path/rvmrcs"
__rvm_reset_rvmrc_trust "$1"
"$rvm_scripts_path/db" "$rvm_config_path/rvmrcs" "$(__rvm_rvmrc_key "$1")" "1" >/dev/null 2>&1
return $?
}

__rvm_untrust_rvmrc() {
touch "$rvm_config_path/rvmrcs"
__rvm_reset_rvmrc_trust "$1"
"$rvm_scripts_path/db" "$rvm_config_path/rvmrcs" "$(__rvm_rvmrc_key "$1")" "0" >/dev/null 2>&1
return $?
}

__rvm_rvmrc_stored_trust() {
touch "$rvm_config_path/rvmrcs"
"$rvm_scripts_path/db" "$rvm_config_path/rvmrcs" "$(__rvm_rvmrc_key "$1")"
return $?
}

__rvm_rvmrc_tools() {
Expand Down Expand Up @@ -872,6 +876,7 @@ __rvm_rvmrc_tools() {
return 1
;;
esac
return $?
}

__rvm_check_rvmrc_trustworthiness() {
Expand All @@ -883,6 +888,7 @@ __rvm_check_rvmrc_trustworthiness() {
else
[[ "$value" = "1" ]]
fi
return $?
}

__rvm_ask_to_trust() {
Expand Down Expand Up @@ -960,6 +966,7 @@ __rvm_project_rvmrc() {
fi
fi
done
return $?
}

__rvm_record_install() {
Expand All @@ -983,6 +990,7 @@ __rvm_remove_install_record() {
\grep -v "^$recorded_ruby_name " < "$rvm_install_record_file.tmp" > "$rvm_install_record_file"
\rm -f "$rvm_install_record_file.tmp"
fi
return 0
}

__rvm_recorded_install_command() {
Expand All @@ -994,6 +1002,7 @@ __rvm_recorded_install_command() {
else
return 1
fi
return $?
}

__rvm_environment_identifier() {
Expand Down

0 comments on commit fb1f49e

Please sign in to comment.