Permalink
Browse files

'rvm gems import/export' instead of 'rvm gems dump/load'

  • Loading branch information...
1 parent e010ad6 commit 6bc3847d30dc9000fcdc7fd844fe32f2fdc8d854 @wayneeseguin wayneeseguin committed Feb 17, 2010
Showing with 17 additions and 17 deletions.
  1. +2 −2 scripts/cli
  2. +14 −14 scripts/gems
  3. +1 −1 scripts/utility
View
4 scripts/cli
@@ -50,7 +50,7 @@ __rvm_parse_args() {
gems|gemset)
rvm_action="gems"
- if [[ "name" = "$1" ]] || [[ "dir" = "$1" ]] || [[ "list" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "dump" = "$1" ]] || [[ "load" = "$1" ]] || [[ "nuke" = "$1" ]] || [[ "copy" = "$1" ]] ; then
+ if [[ "name" = "$1" ]] || [[ "dir" = "$1" ]] || [[ "list" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "dump" = "$1" ]] || [[ "load" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "copy" = "$1" ]] || [[ "import" = "$1" ]] || [[ "export" = "$1" ]] ; then
export rvm_ruby_args="$*" ; export rvm_${1}_flag=1 ; shift
elif [[ "clear" = "$1" ]] ; then
unset rvm_gem_set_name ; shift
@@ -281,7 +281,7 @@ __rvm_parse_args() {
--disable-llvm|--disable-jit) export rvm_llvm_flag=0 ;;
--enable-llvm|--enable-jit) export rvm_llvm_flag=1 ;;
- --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--dump|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--load|--rvmrc|--passenger|--editor|--sticky_gems)
+ --self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--export|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--import|--rvmrc|--passenger|--editor|--sticky_gems)
export rvm_$(echo $rvm_token | sed 's#-##g')_flag=1
if [[ "--debug" = "$rvm_token" ]] ; then export rvm_debug_flag ; fi
;;
View
28 scripts/gems
@@ -63,7 +63,7 @@ __rvm_gems_delete() {
fi
}
-__rvm_gems_nuke() {
+__rvm_gems_empty() {
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
if [[ ! -z "$rvm_gem_set_name" ]] ; then
gemdir="$rvm_gems_path/$rvm_ruby_string%$rvm_gem_set_name"
@@ -113,7 +113,7 @@ __rvm_gems_copy() {
unset source_ruby destination_ruby source_path destination_path
}
-__rvm_gems_dump() {
+__rvm_gems_export() {
rvm_file_name="${rvm_file_name:-$gems_args}"
if [[ ! -z "$rvm_ruby_gem_home" ]] ; then
@@ -130,10 +130,10 @@ __rvm_gems_dump() {
fi
fi
- $rvm_scripts_path/log "info" "Dumping current environments gems to $rvm_file_name"
+ $rvm_scripts_path/log "info" "Exporting current environments gems to $rvm_file_name"
touch $rvm_file_name
- echo "# $rvm_file_name generated gem dump file. Note that any env variable settings will be missing. Append these after using a ';' field separator" > $rvm_file_name
+ echo "# $rvm_file_name generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator" > $rvm_file_name
for gem in $(gem list | sed 's#[\(|\)]##g' | sed 's#, #,#g' | tr ' ' ';') ; do
name="$(echo $gem | awk -F';' '{print $1}')"
if [[ -z "$rvm_latest_flag" ]] ; then
@@ -147,7 +147,7 @@ __rvm_gems_dump() {
done ; unset file_name
}
-__rvm_gems_load() {
+__rvm_gems_import() {
if [[ ! -z "$rvm_ruby_gem_home" ]] ; then
export GEM_HOME="$rvm_ruby_gem_home"
@@ -177,7 +177,7 @@ __rvm_gems_load() {
mkdir -p "$rvm_gems_path/cache" # Ensure the base cache dir is initialized.
if [[ -s "$rvm_file_name" ]] ; then
- echo "Loading $rvm_file_name file..."
+ echo "Importing $rvm_file_name file..."
rvm_ruby_gem_list=$(\ls $rvm_ruby_gem_home/specifications/ 2> /dev/null | sed 's#.gems.*$##' 2> /dev/null)
while read -r line
@@ -187,7 +187,7 @@ __rvm_gems_load() {
fi
done < <(awk '/^[^#]+/{print}' "${rvm_file_name}")
else
- $rvm_scripts_path/log "error" "${rvm_file_name} does not exist to load from."
+ $rvm_scripts_path/log "error" "${rvm_file_name} does not exist to import from."
fi
}
@@ -314,14 +314,14 @@ fi
action="$(echo $* | awk '{print $1}')"
gem_args=$(echo "$*" | awk '{$1="" ; print}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
-if [[ "load" = "$action" ]] ; then
- __rvm_gems_load
-elif [[ "dump" = "$action" ]] ; then
- __rvm_gems_dump
+if [[ "import" = "$action" ]] || [[ "load" = "$action" ]] ; then
+ __rvm_gems_import
+elif [[ "export" = "$action" ]] || [[ "dump" = "$action" ]] ; then
+ __rvm_gems_export
elif [[ "copy" = "$action" ]] ; then
__rvm_gems_copy
-elif [[ "nuke" = "$action" ]] ; then
- __rvm_gems_nuke
+elif [[ "empty" = "$action" ]] ; then
+ __rvm_gems_empty
elif [[ "delete" = "$action" ]] ; then
__rvm_gems_delete
elif [[ "name" = "$action" ]] ; then
@@ -338,7 +338,7 @@ elif [[ "clear" = "$action" ]] ; then
$rvm_scripts_path/log "info" "gems(et) cleared."
exit 0
else
- $rvm_scripts_path/log "error" "gems must be passed an action as the first parameter {load,dump,delete,name,list,gemdir,install}"
+ $rvm_scripts_path/log "error" "Unrecognized gems action '$action'.\ngems must be passed an action as the first parameter {import,export,copy,delete,empty,name,list,gemdir,install}"
fi
exit $?
View
2 scripts/utility
@@ -152,7 +152,7 @@ __rvm_cleanup_variables() {
if [[ "$rvm_sticky_gems" = "1" ]] ; then export rvm_gem_set_name ; else unset rvm_gem_set_name ; fi
- unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag rvm_llvm_flag rvm_ruby_bits rvm_ruby_patch rvm_sticky_gems
+ unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_import_flag rvm_export_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag rvm_llvm_flag rvm_ruby_bits rvm_ruby_patch rvm_sticky_gems
}
# Unset ruby-specific variables

0 comments on commit 6bc3847

Please sign in to comment.