VSimpl Helper - Ruby

by agustinus_ap
0 deployments · 0 still active · last rev. 28 days ago

Compatible with: Ubuntu 16.04 LTS
						#!/bin/bash
#
# Install Ruby
#
# * chruby
# * ruby-install
#

function get_tmp_dir {
  USERNAME="$1"

  mkdir -p /home/$USERNAME/tmp
  return "/home/$USERNAME/tmp/"
}

function install_ruby_install {
  VERSION="$1"

  cd get_tmp_dir() && \
  wget -O ruby-install-$VERSION.tar.gz https://github.com/postmodern/ruby-install/archive/v$VERSION.tar.gz && \
  tar -xzvf ruby-install-$VERSION.tar.gz && \
  cd ruby-install-$VERSION/ && \
  sudo make install
}

function install_ruby {
  VERSION="$1"

  ruby-install ruby $VERSION
}

function install_chruby {
  VERSION="$1"

  cd get_tmp_dir() && \
  wget -O chruby-$VERSION.tar.gz https://github.com/postmodern/chruby/archive/v$VERSION.tar.gz && \
  tar -xzvf chruby-$VERSION.tar.gz && \
  cd chruby-$VERSION/ && \
  sudo make install
}