Class: MetaCon::SelfInstall

Inherits:
Object
  • Object
show all
Includes:
CLIHelpers
Defined in:
lib/metacon/self_install.rb

Constant Summary collapse

EXP_GIT_V =
'1.7.4.1'
EXP_RVM_V =
'1.8.2'
EXP_PYB_V =
'1.1'

Constants included from CLIHelpers

CLIHelpers::ANSI, CLIHelpers::CONTEXT_OS, CLIHelpers::ESCS

Instance Method Summary collapse

Methods included from CLIHelpers

#best_profile_file, #cfail, #chd, #check_tool, #color_puts, #command_exists?, #cstr2, #cwarn, #darwin?, #fj, #included, #linux?, #mac?, #result, #shellescape, #status

Instance Method Details

#check_gitObject



22
23
24
25
26
# File 'lib/metacon/self_install.rb', line 22

def check_git
  status('Checking git')
  return check_tool('Git', 'git --version', 3, EXP_GIT_V,
                    'http://book.git-scm.com/2_installing_git.html')
end

#check_installObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/metacon/self_install.rb', line 9

def check_install
  exit 2 unless check_git
  result 'Looks good'

  exit 3 unless check_rvm
  result 'Looks good'

  exit 4 unless check_pythonbrew
  result 'Looks good'

  install_shelp
end

#check_pythonbrewObject



34
35
36
37
38
# File 'lib/metacon/self_install.rb', line 34

def check_pythonbrew
  status ('Checking pythonbrew')
  return check_tool('Python-brew','pythonbrew --version', 1, EXP_PYB_V,
                    'https://github.com/utahta/pythonbrew/blob/master/README.rst')
end

#check_rvmObject



28
29
30
31
32
# File 'lib/metacon/self_install.rb', line 28

def check_rvm
  status('Checking rvm')
  return check_tool('RVM', 'rvm --version', 2, EXP_RVM_V,
                    'http://beginrescueend.com/rvm/install/')
end

#install_shelpObject



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/metacon/self_install.rb', line 40

def install_shelp
  status "Checking shell helper functionality"
  
  shelp = File.join(File.dirname(__FILE__), '..','..', 'shelp','metacon.bashrc')
  if File.exists?(shelp)
    result "Not yet implemented- you're good to go"
  else
    cfail "Couldn't find shell helper files (metacon.bashrc) - installation broken somehow..."
    exit 5
  end
end