Skip to content

Commit

Permalink
fix = to == - for #475
Browse files Browse the repository at this point in the history
  • Loading branch information
mpapis committed Oct 6, 2011
1 parent 85c4503 commit 3329fc8
Show file tree
Hide file tree
Showing 33 changed files with 107 additions and 107 deletions.
4 changes: 2 additions & 2 deletions binscripts/rvm-prompt
Expand Up @@ -9,7 +9,7 @@ add()

if [[ -n "$format" ]] ; then

[[ ${previous_is_format_var:-0} = 1 ]] && eval "${token}_prefix_flag=1"
[[ ${previous_is_format_var:-0} == 1 ]] && eval "${token}_prefix_flag=1"

format="${format}\$${token}"

Expand Down Expand Up @@ -93,7 +93,7 @@ if [[ -n "$ruby" && -n "$(echo "$ruby" | awk '/rvm/{print}')" ]] ; then
# Only people who explicitely ask for this will have the
# slight performance penalty associated.

if [[ "$(rvm tools identifier)" = "$(rvm alias show default)" ]] ; then
if [[ "$(rvm tools identifier)" == "$(rvm alias show default)" ]] ; then

exit 0

Expand Down
2 changes: 1 addition & 1 deletion scripts/alias
Expand Up @@ -100,7 +100,7 @@ alias_create() {
result=1
else

if [[ "default" = "$alias_name" ]] ; then
if [[ "default" == "$alias_name" ]] ; then
rvm_alias=""
fi

Expand Down
44 changes: 22 additions & 22 deletions scripts/cli
Expand Up @@ -53,7 +53,7 @@ __rvm_parse_args()
use)
rvm_action="$rvm_token"
rvm_verbose_flag=1
if [[ "ruby" = "$next_token" ]]
if [[ "ruby" == "$next_token" ]]
then
if (( $# > 0 ))
then
Expand Down Expand Up @@ -84,12 +84,12 @@ __rvm_parse_args()
then
rvm_ruby_args="help"

elif [[ "clear" = "$next_token" ]]
elif [[ "clear" == "$next_token" ]]
then
__rvm_gemset_clear
rvm_ruby_args="clear"

elif [[ "use" = "$next_token" ]]
elif [[ "use" == "$next_token" ]]
then
rvm_use_flag=1
rvm_ruby_args="$next_token $@"
Expand Down Expand Up @@ -117,7 +117,7 @@ __rvm_parse_args()
;;
esac

elif [[ "delete" = "$next_token" ]]
elif [[ "delete" == "$next_token" ]]
then
rvm_delete_flag=1
rvm_ruby_args="$next_token $@"
Expand Down Expand Up @@ -154,13 +154,13 @@ __rvm_parse_args()
rvm_action="gemset"
rvm_gemdir_flag=1

if [[ "system" = "$next_token" ]]
if [[ "system" == "$next_token" ]]
then
rvm_system_flag=1
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
fi

if [[ "user" = "$next_token" ]]
if [[ "user" == "$next_token" ]]
then
rvm_user_flag=1
if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
Expand All @@ -169,7 +169,7 @@ __rvm_parse_args()

pkg)
rvm_action="$rvm_token"
if [[ "$next_token" = "--only-path" ]]
if [[ "$next_token" == "--only-path" ]]
then
shift
rvm_only_path_flag=1
Expand All @@ -187,19 +187,19 @@ __rvm_parse_args()


do|ruby|rake|gem|rubydo|rakedo|gemdo)
if [[ "do" = "${rvm_action:-""}" ]] ; then rvm_action="ruby" ; fi
if [[ "do" == "${rvm_action:-""}" ]] ; then rvm_action="ruby" ; fi

rvm_action=${rvm_token//do}

if [[ "rake" = "${rvm_action:-""}" || "gem" = "${rvm_action:-""}" || "ruby" = "${rvm_action:-""}" ]] ; then
if [[ "rake" == "${rvm_action:-""}" || "gem" == "${rvm_action:-""}" || "ruby" == "${rvm_action:-""}" ]] ; then

if [[ -z "$next_token" ]]
then
if [[ "gem" = "${rvm_action:-""}" ]]
if [[ "gem" == "${rvm_action:-""}" ]]
then
rvm_action="error"
rvm_error_message="'rvm $rvm_action' must be followed by arguments."
elif [[ "ruby" = "${rvm_action:-""}" ]]
elif [[ "ruby" == "${rvm_action:-""}" ]]
then
if echo "${rvm_ruby_strings:-""}" | \grep ',' >/dev/null 2>&1
then
Expand All @@ -210,12 +210,12 @@ __rvm_parse_args()
rvm_error_message="rvm X,Y,Z '$rvm_action' must be followed by arguments."
fi
fi
elif [[ "-S" = "$next_token" ]]
elif [[ "-S" == "$next_token" ]]
then
rvm_action="ruby"
rvm_ruby_args="${flag:-""} $next_token $(__rvm_quote_args "$@")"
rvm_parse_break=1
elif [[ "-e" = "$next_token" ]]
elif [[ "-e" == "$next_token" ]]
then
rvm_action="ruby"
IFS="\n" ; rvm_ruby_args="${flag:-""} $next_token '$@'" ; IFS=" "
Expand Down Expand Up @@ -281,7 +281,7 @@ __rvm_parse_args()
;;

inspect|ls|list|info|strings|get|current)
if [[ "ls" = "$rvm_action" ]]; then rvm_action="list" ; fi
if [[ "ls" == "$rvm_action" ]]; then rvm_action="list" ; fi

rvm_action="$rvm_token"
rvm_ruby_args="$next_token $@"
Expand Down Expand Up @@ -375,7 +375,7 @@ __rvm_parse_args()
then
# TODO: Middle should be convertable to a case statement for further
# efficiency only have to deal with the first and last parts.
if [[ "gemset" = "$rvm_action" ]]
if [[ "gemset" == "$rvm_action" ]]
then
case "$rvm_token" in
*${rvm_gemset_separator:-"@"}*)
Expand Down Expand Up @@ -438,7 +438,7 @@ __rvm_parse_args()

jruby*|ree*|kiji*|macruby*|rbx*|rubinius*|goruby|ironruby*|default*|maglev*|all)
rvm_action="${rvm_action:-use}"
if [[ "rubinius" = "$rvm_token" ]] ; then rvm_token="rbx"; fi
if [[ "rubinius" == "$rvm_token" ]] ; then rvm_token="rbx"; fi
rvm_ruby_interpreter="$rvm_token"
rvm_ruby_string="$rvm_token"
rvm_ruby_strings="$rvm_token"
Expand All @@ -453,7 +453,7 @@ __rvm_parse_args()
rvm_ruby_args="$rvm_token"
rvm_ruby_file="$rvm_token"

if [[ -z "${rvm_action:-""}" || "$rvm_action" = "use" ]]; then
if [[ -z "${rvm_action:-""}" || "$rvm_action" == "use" ]]; then
rvm_action="ruby"
fi
;;
Expand All @@ -477,7 +477,7 @@ __rvm_parse_args()
rvm_error_message="Unrecognized command line argument(s): '$rvm_token $@'"
fi

if [[ "error" = "${rvm_action:-""}" ]] ; then break ; fi
if [[ "error" == "${rvm_action:-""}" ]] ; then break ; fi
;;
esac

Expand Down Expand Up @@ -559,7 +559,7 @@ __rvm_parse_args()
;;

--bin)
if [[ "update" = "${rvm_action:-""}" ]] ; then
if [[ "update" == "${rvm_action:-""}" ]] ; then
rvm_bin_flag=1
else
rvm_bin_path="$next_token"
Expand Down Expand Up @@ -739,7 +739,7 @@ __rvm_parse_args()
[[ -n "${ZSH_VERSION:-""}" ]] || set -o errtrace

# errexit pipefail
if [[ "$rvm_token" = "--trace" ]]
if [[ "$rvm_token" == "--trace" ]]
then
export rvm_trace_flag=1
set -o xtrace
Expand Down Expand Up @@ -879,7 +879,7 @@ rvm()
next_token=""
fi

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

if [[ "${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"
GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_gem_home${rvm_gemset_separator:-"@"}global"
Expand Down
2 changes: 1 addition & 1 deletion scripts/completion
Expand Up @@ -16,7 +16,7 @@ __rvm_subcommand()
while [[ $c -lt $COMP_CWORD ]] ; do
word="${COMP_WORDS[c]}"
for subcommand in $1; do
if [[ "$subcommand" = "$word" ]]; then
if [[ "$subcommand" == "$word" ]]; then
echo "$subcommand"
return
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/db
Expand Up @@ -47,7 +47,7 @@ else

value="$*"

if [[ "unset" = "$value" || "delete" = "$value" ]]
if [[ "unset" == "$value" || "delete" == "$value" ]]
then
\sed -e "s#^$escaped_key=.*\$##" -e '/^$/d' "$database_file" \
> "$database_file.new"
Expand Down
6 changes: 3 additions & 3 deletions scripts/default
Expand Up @@ -48,13 +48,13 @@ args=($*)
action="${args[0]}"
args=${args[@]:1}

if [[ "list" = "$action" ]] ; then
if [[ "list" == "$action" ]] ; then
default_list

elif [[ "clear" = "$action" ]] ; then
elif [[ "clear" == "$action" ]] ; then
default_clear

elif [[ "help" = "$action" ]] ; then
elif [[ "help" == "$action" ]] ; then
usage ; exit 0

else
Expand Down
2 changes: 1 addition & 1 deletion scripts/docs
Expand Up @@ -5,7 +5,7 @@ source "$rvm_scripts_path/base"

rvm_docs_ruby_string="$(__rvm_env_string | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')"

if [[ "$rvm_docs_ruby_string" = "system" || -z "$rvm_docs_ruby_string" ]]; then
if [[ "$rvm_docs_ruby_string" == "system" || -z "$rvm_docs_ruby_string" ]]; then

rvm_error "Currently 'rvm docs ...' does not work with non-rvm rubies."

Expand Down
2 changes: 1 addition & 1 deletion scripts/env
Expand Up @@ -24,7 +24,7 @@ fi
# Exit when we encounter an unknown environment name.
__rvm_become "$environment_name"

if [[ "$?" = 0 ]]; then
if [[ "$?" == 0 ]]; then
__rvm_use
environment_file_path="$rvm_environments_path/$(__rvm_env_string)"
# Echo the path or environment file.
Expand Down
6 changes: 3 additions & 3 deletions scripts/extras/rails
Expand Up @@ -122,7 +122,7 @@ rails_routes()
md5_cached=""
fi

if [[ -s "$cache_file" && $md5_current = $md5_cached ]]; then
if [[ -s "$cache_file" && $md5_current == $md5_cached ]]; then
routes=$(cat -v "$cache_file")
else
routes=$(rake routes 2>/dev/null)
Expand Down Expand Up @@ -155,7 +155,7 @@ rails_routes()
results=()
for condition in "${ands[@]}" ; do
for route in ${routes[@]} ; do
if [[ ${route} = ${condition} ]]; then
if [[ ${route} == ${condition} ]]; then
results=(${results[@]} ${route})
fi
done
Expand Down Expand Up @@ -226,7 +226,7 @@ r() {
rails_version=${rails_version%%.*}
if [[ $rails_version -ge 3 ]]; then
rails new $args
elif [[ $rails_version = 1 || $rails_version = 2 ]] ; then
elif [[ $rails_version == 1 || $rails_version == 2 ]] ; then
rails $args
fi
;;
Expand Down
10 changes: 5 additions & 5 deletions scripts/functions/build
Expand Up @@ -7,7 +7,7 @@ __rvm_setup_compile_environment()
export CC="/usr/bin/gcc-4.2"
fi

if [[ "Darwin" = "$(uname)" ]]
if [[ "Darwin" == "$(uname)" ]]
then
rvm_configure_env=()
local architectures="${rvm_architectures:-"-arch x86_64"}"
Expand All @@ -33,24 +33,24 @@ __rvm_setup_compile_environment()
__rvm_make_flags()
{
# This is only an issue with Darwin :/
if [[ "$MACHTYPE" = *darwin* ]]
if [[ "$MACHTYPE" == *darwin* ]]
then
# \ls /usr/lib/gcc/x86_64-apple-darwin10
# Set the build & host type
if [[ "Power Macintosh" = "$(/usr/sbin/sysctl -n hw.machine)" ]]
if [[ "Power Macintosh" == "$(/usr/sbin/sysctl -n hw.machine)" ]]
then
true # Do nothing ?
elif [[ "$(/usr/sbin/sysctl -n hw.cpu64bit_capable)" = 1 || \
"$(/usr/sbin/sysctl -n hw.optional.x86_64)" = 1 ]]
then
# 64 bit capable
if [[ "-arch x86_64" = "${rvm_archflags:-""}" ]]
if [[ "-arch x86_64" == "${rvm_archflags:-""}" ]]
then
rvm_configure_flags="${rvm_configure_flags} \
--build=x86_64-apple-darwin$(uname -r) \
--host=x86_64-apple-darwin$(uname -r)"

elif [[ "-arch i386" = "${rvm_archflags:-""}" ]]
elif [[ "-arch i386" == "${rvm_archflags:-""}" ]]
then
rvm_configure_flags="${rvm_configure_flags} \
--build=i386-apple-darwin$(uname -r) \
Expand Down
4 changes: 2 additions & 2 deletions scripts/functions/cleanup
Expand Up @@ -52,7 +52,7 @@ __rvm_reboot()

read response

if [[ "yes" = "$response" ]] ; then
if [[ "yes" == "$response" ]] ; then
builtin cd $rvm_path

command -v __rvm_reset >> /dev/null 2>&1 || \
Expand All @@ -61,7 +61,7 @@ __rvm_reboot()

mv "$rvm_archives_path" "$HOME/.archives"

if [[ "/" = "$rvm_path" ]] ; then
if [[ "/" == "$rvm_path" ]] ; then
rvm_error "remove '/' ?!... NO!"
else
if [[ -d "$rvm_path" ]] ; then __rvm_rm_rf "$rvm_path" ; fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/functions/gemset
Expand Up @@ -8,7 +8,7 @@ __rvm_current_gemset()
# We only care about the stuff to the right of the separator.
current_gemset="${current_gemset##*${rvm_gemset_separator:-@}}"

if [[ "${current_gemset}" = "${GEM_HOME:-}" ]] ; then
if [[ "${current_gemset}" == "${GEM_HOME:-}" ]] ; then
echo ''
else
echo "${current_gemset}"
Expand Down
10 changes: 5 additions & 5 deletions scripts/functions/implode
Expand Up @@ -14,7 +14,7 @@ __rvm_implode_binaries()

rvm_log "Removing rvm wrappers in $rvm_bin_path"
\find "$rvm_bin_path" -type l | while read symlinked_rvm_file; do
if [[ "$(readlink "$symlinked_rvm_file")" = "$rvm_wrappers_path/"* ]]; then
if [[ "$(readlink "$symlinked_rvm_file")" == "$rvm_wrappers_path/"* ]]; then
__rvm_rm_rf "$symlinked_rvm_file"
fi
done
Expand All @@ -33,9 +33,9 @@ __rvm_implode()

read response

if [[ "yes" = "$response" ]] ; then
if [[ "yes" == "$response" ]] ; then

if [[ "/" = "$rvm_path" ]] ; then
if [[ "/" == "$rvm_path" ]] ; then

rvm_error "remove '/' ?!... Ni!"

Expand All @@ -52,7 +52,7 @@ __rvm_implode()

echo "$rvm_path has been removed."

if [[ "$rvm_path" = "/usr/local/rvm"* && -f "/usr/local/lib/rvm" ]]; then
if [[ "$rvm_path" == "/usr/local/rvm"* && -f "/usr/local/lib/rvm" ]]; then
rvm_log "Removing the rvm loader at /usr/local/lib/rvm"
fi

Expand All @@ -66,7 +66,7 @@ __rvm_implode()
fi
break

elif [[ "no" = "$response" ]] ; then
elif [[ "no" == "$response" ]] ; then

rvm_log "Psycologist intervened, cancelling implosion, crisis avoided :)"
break
Expand Down

0 comments on commit 3329fc8

Please sign in to comment.