scripts/list in rvm-1.0.7 vs scripts/list in rvm-1.0.8

- old
+ new

@@ -30,26 +30,26 @@ all_rubies="$(list_strings)" printf "\nrvm gemsets\n" - versions=($(builtin cd "$rvm_gems_path/" ; find . -maxdepth 1 -mindepth 1 -type d -print 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}')) + versions=($(builtin cd "${rvm_gems_path:-"$rvm_path/gems"}/" ; find . -maxdepth 1 -mindepth 1 -type d -print 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}')) for version in "${versions[@]//.\/}" ; do ruby_version_name="$(echo "$version" | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')" [[ "$all_rubies" != *"$ruby_version_name"* ]] && continue if echo "$version" | grep -q '^jruby-' ; then - string="[ $("$rvm_rubies_path/$ruby_version_name/bin/ruby" -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]" + string="[ $("$rvm_path/rubies/$ruby_version_name/bin/ruby" -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]" elif [[ -n "$(echo "$version" | awk '/^maglev-|^macruby-/')" ]] ; then string="[ x86_64 ]" else - string="[ $(file "$rvm_rubies_path/$ruby_version_name/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]" + string="[ $(file "$rvm_path/rubies/$ruby_version_name/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]" fi printf "\n" if [[ "$version" = "$current_ruby" ]]; then @@ -65,19 +65,19 @@ printf "$version $string" fi done - if [[ -f "$rvm_config_path/default" && -s "$rvm_config_path/default" ]] ; then + if [[ -f "$rvm_path/config/default" && -s "$rvm_path/config/default" ]] ; then - version=$(grep 'MY_RUBY_HOME' "$rvm_config_path/default" | head -n1 | awk -F"'" '{print $2}' | xargs basename --) + version=$(grep 'MY_RUBY_HOME' "$rvm_path/config/default" | head -n1 | awk -F"'" '{print $2}' | xargs basename --) if [[ -n "$version" ]] ; then printf "\nDefault Ruby (for new shells)\n" - string="[ $(file "$rvm_rubies_path/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]" + string="[ $(file "$rvm_path/rubies/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]" if [[ ${rvm_pretty_print_flag:-0} -eq 1 ]] ; then printf "\n $(tput setaf 2)$version$(tput sgr0) $string\n" else @@ -100,19 +100,19 @@ if [[ "${args[0]:-""}" = "string" ]] ; then "$rvm_path/scripts/alias" show default 2>/dev/null | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}' | xargs basename -- else - if [[ -L "$rvm_rubies_path/default" ]]; then + if [[ -L "$rvm_path/rubies/default" ]]; then version=$("$rvm_path/scripts/alias" show default 2>/dev/null | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}' | xargs basename --) if [[ -n "$version" ]] ; then printf "\nDefault Ruby (for new shells)\n" - string="[ $(file "$rvm_rubies_path/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]" + string="[ $(file "$rvm_path/rubies/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]" if [[ ${rvm_pretty_print_flag:-0} -eq 1 ]] ; then printf "\n $(tput setaf 2)$version$(tput sgr0) $string\n" @@ -146,11 +146,11 @@ # Query for valid rvm ruby strings # This is meant to be used with scripting. list_strings() { ( - cd "$rvm_rubies_path" + cd "$rvm_path/rubies" find . -maxdepth 1 -mindepth 1 -type d | sed -e 's#./##g' ) return $? @@ -161,11 +161,11 @@ local all_rubies ruby_name gemset gemsets all_rubies="$(list_strings)" - gemsets=($(builtin cd "$rvm_gems_path" ; find . -maxdepth 1 -mindepth 1 -type d 2>/dev/null | xargs -n1 basename -- | \grep -v '^\(@\|doc$\|cache$\|system$\)' | sort)) + gemsets=($(builtin cd "${rvm_gems_path:-"$rvm_path/gems"}" ; find . -maxdepth 1 -mindepth 1 -type d 2>/dev/null | xargs -n1 basename -- | \grep -v '^\(@\|doc$\|cache$\|system$\)' | sort)) for gemset in "${gemsets[@]//.\/}" ; do ruby_name="${gemset//${rvm_gemset_separator:-"@"}*}" @@ -178,11 +178,11 @@ } # This is meant to be used with scripting. list_known_strings() { - sed -e 's/#.*$//g' -e 's#\[##g' -e 's#\]##g' < "$rvm_config_path/known" | sort -r | uniq + sed -e 's/#.*$//g' -e 's#\[##g' -e 's#\]##g' < "$rvm_path/config/known" | sort -r | uniq return $? } list_known() { @@ -194,24 +194,24 @@ return 0 fi if [[ ${rvm_interactive_flag:-0} -eq 0 ]] ; then - cat "$rvm_config_path/known" + cat "$rvm_path/config/known" else - less "$rvm_config_path/known" + less "$rvm_path/config/known" fi return $? } list_rubies_strings() { - ( builtin cd "$rvm_rubies_path" ; find -maxdepth 0 -type d | tail -n+2 | xargs -n1 basename -- | __rvm_strip ) + ( builtin cd "$rvm_path/rubies" ; find -maxdepth 0 -type d | tail -n+2 | xargs -n1 basename -- | __rvm_strip ) return $? } list_rubies() { @@ -222,27 +222,27 @@ current_ruby="$(__rvm_environment_identifier | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')" printf "\nrvm rubies\n" - rubies=($(builtin cd "$rvm_rubies_path/" ; find . -maxdepth 1 -mindepth 1 -type d 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}')) + rubies=($(builtin cd "$rvm_path/rubies/" ; find . -maxdepth 1 -mindepth 1 -type d 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}')) for version in "${rubies[@]//.\/}" ; do - [[ ! -x "$rvm_rubies_path/$version/bin/ruby" ]] && continue + [[ ! -x "$rvm_path/rubies/$version/bin/ruby" ]] && continue if echo "$version" | grep -q '^jruby-' ; then - string="[ $("$rvm_rubies_path/$version/bin/ruby" -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]" + string="[ $("$rvm_path/rubies/$version/bin/ruby" -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]" elif [[ ! -z "$(echo "$version" | awk '/^maglev-|^macruby-/')" ]] ; then string="[ x86_64 ]" else - string="[ $(file "$rvm_rubies_path/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]" + string="[ $(file "$rvm_path/rubies/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]" fi printf "\n" if [[ "$version" = "$current_ruby" ]]; then @@ -259,18 +259,18 @@ printf "$version $string" fi done - if [[ -f "$rvm_config_path/default" ]] && [[ -s "$rvm_config_path/default" ]] ; then + if [[ -f "$rvm_path/config/default" ]] && [[ -s "$rvm_path/config/default" ]] ; then - version=$(grep 'MY_RUBY_HOME' "$rvm_config_path/default" | head -n 1 | awk -F"'" '{print $2}' | xargs basename --) + version=$(grep 'MY_RUBY_HOME' "$rvm_path/config/default" | head -n 1 | awk -F"'" '{print $2}' | xargs basename --) if [[ -n "$version" ]] ; then printf "Default Ruby (for new shells)\n" - string="[ $(file "$rvm_rubies_path/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]" + string="[ $(file "$rvm_path/rubies/$version/bin/ruby" | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | \tr "\n" ' ')]" if [[ ${rvm_pretty_print_flag:-0} -eq 1 ]] ; then printf " $(tput setaf 2)$version$(tput sgr0) $string\n" else printf " $version $string\n"