Skip to content

Commit

Permalink
New API: 'rvm package {install,uninstall} {openssl,zlib,readline,icon…
Browse files Browse the repository at this point in the history
…v,etc...}'
  • Loading branch information
wayneeseguin committed Feb 27, 2010
1 parent ee9e3d6 commit e1e22a4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
27 changes: 17 additions & 10 deletions scripts/cli
Expand Up @@ -8,10 +8,16 @@ __rvm_parse_args() {
while [[ $# -gt 0 ]] ; do while [[ $# -gt 0 ]] ; do
rvm_token="$1" ; shift rvm_token="$1" ; shift
case "$rvm_token" in case "$rvm_token" in
fetch|version|srcdir|reset|debug|reload|implode|seppuku|readline|update|iconv|curl|openssl|ncurses|zlib|monitor|notes|mono) fetch|version|srcdir|reset|debug|reload|implode|seppuku|update|monitor|notes)
rvm_action=$rvm_token rvm_action=$rvm_token
;; ;;


package)
rvm_action="$rvm_token"
export rvm_ruby_args="$@"
rvm_parse_break=1
;;

use) use)
rvm_action=$rvm_token rvm_action=$rvm_token
export rvm_verbose_flag=1 export rvm_verbose_flag=1
Expand Down Expand Up @@ -392,19 +398,19 @@ rvm() {
inspect) __rvm_inspect ; result=$? ;; inspect) __rvm_inspect ; result=$? ;;
implode|seppuku) __rvm_implode ; result=$? ;; implode|seppuku) __rvm_implode ; result=$? ;;


gemdir) gemdir)
$rvm_scripts_path/gemsets gemdir $rvm_scripts_path/gemsets gemdir
result=$? result=$?
;; ;;


ruby|gem|rake) ruby|gem|rake)
$rvm_scripts_path/set $rvm_action $rvm_ruby_args $rvm_scripts_path/set $rvm_action $rvm_ruby_args
result=$? result=$?
;; ;;
gemset) gemset)
if [[ "$rvm_use_flag" -eq 1 ]] ; then if [[ "$rvm_use_flag" -eq 1 ]] ; then
__rvm_gemset_select __rvm_gemset_select
result=$? result=$?
if [[ $result -eq 0 ]] ; then if [[ $result -eq 0 ]] ; then
__rvm_gemset_use __rvm_gemset_use
fi fi
Expand All @@ -420,6 +426,7 @@ rvm() {
;; ;;
notes) $rvm_scripts_path/notes ; result=$? ;; notes) $rvm_scripts_path/notes ; result=$? ;;
reload) unset rvm_loaded_flag ; rvm_reload_flag=1 ;; reload) unset rvm_loaded_flag ; rvm_reload_flag=1 ;;

fetch|install|uninstall|remove) fetch|install|uninstall|remove)
if [[ ! -z "$rvm_ruby_string" ]] ; then if [[ ! -z "$rvm_ruby_string" ]] ; then
$rvm_scripts_path/manage "$rvm_action" "$rvm_ruby_string" $rvm_scripts_path/manage "$rvm_action" "$rvm_ruby_string"
Expand All @@ -432,8 +439,8 @@ rvm() {
;; ;;
tests|specs) rvm_action="rake" ; __rvm_do ; result=$? ;; tests|specs) rvm_action="rake" ; __rvm_do ; result=$? ;;


iconv|openssl|ncurses|zlib|readline|curl|mono) package)
$rvm_scripts_path/libraries $rvm_action $rvm_scripts_path/package $rvm_ruby_args
result=$? result=$?
;; ;;


Expand Down
2 changes: 1 addition & 1 deletion scripts/manage
Expand Up @@ -113,7 +113,7 @@ __rvm_install_ruby() {
if [[ "Darwin" = "$(uname)" ]] ; then if [[ "Darwin" = "$(uname)" ]] ; then
if [[ "$rvm_head_flag" = 1 ]] ; then if [[ "$rvm_head_flag" = 1 ]] ; then
if [[ ! -z "$rvm_llvm_flag" ]] ; then if [[ ! -z "$rvm_llvm_flag" ]] ; then
$rvm_scripts_path/libraries llvm install $rvm_scripts_path/package llvm install
fi fi
macruby_path="/usr/local/bin" macruby_path="/usr/local/bin"
# TODO: configure & make variables should be set here. # TODO: configure & make variables should be set here.
Expand Down
4 changes: 2 additions & 2 deletions scripts/libraries → scripts/package
@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash


# #
# ruby supporting libraries: # ruby dependency packages:
# #


source $rvm_scripts_path/initialize source $rvm_scripts_path/initialize
Expand All @@ -10,7 +10,7 @@ source $rvm_scripts_path/utility
action=$1 ; shift ; library=$1 ; shift ; args="$*" action=$1 ; shift ; library=$1 ; shift ; args="$*"


if [[ -z "$action" ]] ; then if [[ -z "$action" ]] ; then
echo "Usage: libraries {install,uninstall} {openssl,zlib,readline,iconv,ncurses}" echo "Usage: package {install,uninstall} {openssl,zlib,readline,iconv,ncurses}"
fi fi


install_package() { install_package() {
Expand Down

0 comments on commit e1e22a4

Please sign in to comment.