Class: Bard::Provision::RVM

Inherits:
Bard::Provision show all
Defined in:
lib/bard/provision/rvm.rb

Overview

install rvm if missing

Instance Attribute Summary

Attributes inherited from Bard::Provision

#config, #ssh_url

Instance Method Summary collapse

Methods inherited from Bard::Provision

call

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/bard/provision/rvm.rb', line 4

def call
  print "RVM:"
  if !provision_server.run "[ -d ~/.rvm ]", quiet: true
    print " Installing RVM,"
    provision_server.run! [
      %(sed -i "1i[[ -s \\"$HOME/.rvm/scripts/rvm\\" ]] && source \\"$HOME/.rvm/scripts/rvm\\" # Load RVM into a shell session *as a function*" ~/.bashrc),
      "gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB",
      "curl -sSL https://get.rvm.io | bash -s stable",
    ].join("; ")
    version = File.read(".ruby-version").chomp
    print " Installing Ruby #{version},"
    provision_server.run! "rvm install #{version}"
  end

  puts ""
end