Skip to content

Commit

Permalink
Still working on fixing initial gemset import, commented out while de…
Browse files Browse the repository at this point in the history
…bugging.
  • Loading branch information
wayneeseguin committed Sep 15, 2010
1 parent f8e2dcb commit 0699be9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
4 changes: 2 additions & 2 deletions scripts/cli
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ __rvm_parse_args() {
gemset)
rvm_action=$rvm_token

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

if [[ -z "$next_token" ]] ; then
rvm_ruby_args="help"
Expand Down Expand Up @@ -700,7 +700,7 @@ rvm() {
if [[ ${rvm_delete_flag:-0} -eq 1 ]] ; then
gem_prefix="$(echo "${GEM_HOME:-""}" | sed 's/'${rvm_gemset_separator:-"@"}'.*$//')"

if [[ -n "${GEM_HOME:-""}" && "$GEM_HOME" = "${gem_prefix}${rvm_gemset_separator:-"@"}${rvm_gemset_name}" ]] ; then
if [[ "${GEM_HOME:-""}" = "${gem_prefix}${rvm_gemset_separator:-"@"}${rvm_gemset_name}" ]] ; then
rvm_ruby_gem_home="$gem_prefix"
GEM_HOME="$rvm_ruby_gem_home"
BUNDLE_PATH="$rvm_ruby_gem_home"
Expand Down
24 changes: 18 additions & 6 deletions scripts/gemsets
Original file line number Diff line number Diff line change
Expand Up @@ -454,16 +454,20 @@ gemset_export() {

gemset_import() {

unset -f gem

if [[ -n "${rvm_ruby_gem_home:-""}" ]] ; then
export GEM_HOME="$rvm_ruby_gem_home"
export GEM_PATH="$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin"
export BUNDLE_PATH="$rvm_ruby_gem_home"
else
rvm_ruby_gem_home=${GEM_HOME:-$(gem env gemdir)}
fi

rvm_gemset_name="${gems_args//.gem*/}"
rvm_gemset_name="${gems_args// /}"
#rvm_gemset_name="${gems_args//.gem*/}"
#rvm_gemset_name="${gems_args// /}"

rvm_file_name="${gems_args}"
rvm_file_name="${gems_args// /}"

# TODO: this could likely be better with find
if [[ -s "${rvm_file_name%.gems*}.gems" ]] ; then
Expand All @@ -486,7 +490,13 @@ gemset_import() {
return 1
fi

mkdir -p "$rvm_gems_cache_path" # Ensure the base cache dir is initialized.
if [[ ! -d "$rvm_ruby_gem_home/specifications/" ]] ; then
mkdir -p "$rvm_ruby_gem_home/specifications/"
fi

if [[ ! -d "$rvm_gems_cache_path" ]] ; then
mkdir -p "$rvm_gems_cache_path" # Ensure the base cache dir is initialized.
fi

if [[ -s "$rvm_file_name" ]] ; then

Expand Down Expand Up @@ -626,15 +636,17 @@ gem_install() {

if [[ -n "$rvm_ruby_gem_home" && "$rvm_ruby_gem_home" != "${rvm_gems_path:-"$rvm_path/gems"}" ]] ; then

command="GEM_HOME='$rvm_ruby_gem_home' GEM_PATH='$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin' BUNDLE_PATH='${rvm_ruby_gem_home}' ${gem_prefix} command gem install $gems_args $rvm_gem_options $gem_postfix $vars"
command="GEM_HOME='$rvm_ruby_gem_home' GEM_PATH='$rvm_ruby_gem_home' BUNDLE_PATH='${rvm_ruby_gem_home}' $gem_prefix gem install $gems_args $rvm_gem_options $gem_postfix $vars"

else

#--ignore-dependencies
command="$gem_prefix command gem install --ignore-dependencies $gems_args $rvm_gem_options -q $gem $gem_postfix $vars"
command="$gem_prefix gem install --ignore-dependencies $gems_args $rvm_gem_options -q $gem $gem_postfix $vars"

fi

unset -f gem

__rvm_run "gem.install" "$command" "installing ${gem_name} ${gem_version}..."
result=$?

Expand Down
2 changes: 1 addition & 1 deletion scripts/manage
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,7 @@ __rvm_post_install() {
fi

# Import the initial gemsets.
__rvm_run_with_env "gemsets.initial" "$rvm_ruby_string" "'$rvm_path/scripts/gemsets' initial" "$rvm_ruby_string - #importing default gemsets ($rvm_path/gemsets/)"
#__rvm_run_with_env "gemsets.initial" "$rvm_ruby_string" "'$rvm_path/scripts/gemsets' initial" "$rvm_ruby_string - #importing default gemsets ($rvm_path/gemsets/)"

__rvm_irbrc

Expand Down

0 comments on commit 0699be9

Please sign in to comment.