#! /bin/sh


function install() {
 if alert "This will install ruby in $TARGETDIR (It will take a while...) -- Proceed?" NO OK ; then
  alert "ruby will not be installed"
  exit ; fi
  unzip -o -d $TARGETDIR ruby184_beos_x86.zip;
 mv Install Uninstall
 alert "Install Help docs as well?" "No, thanks" OK ||
   unzip -o -d $TARGETDIR ruby_18_help.zip;
 alert "OK... Installation complete"
}

function remove() {
 if alert "Really uninstall ruby from $TARGETDIR?" NO "Yes, please" ; then
	alert "ruby will not be removed"
  exit ; fi
  (cd $TARGETDIR/bin; rm -f ruby irb erb rdoc testrb ri)
  rm -fr $TARGETDIR/lib/ruby $TARGETDIR/lib/libruby* $TARGETDIR/share/ri
 mv Uninstall Install
 alert "ruby has been removed"
}

wdir=$(dirname "$0")
cd "$wdir"
TARGETDIR="/boot/home/config"
if [ $(basename "$0") = "Uninstall" ] ; then remove;
else install; fi

