Class: Flombe::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/flombe.rb

Constant Summary collapse

2206

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.runObject



21
22
23
# File 'lib/flombe.rb', line 21

def self.run
  new.run
end

.warn(msg) ⇒ Object



25
26
27
# File 'lib/flombe.rb', line 25

def self.warn(msg)
  $stderr.puts "\033[0;31m\033[1m==> \033[0m\033[1m" + msg + "\033[0m"
end

Instance Method Details

#runObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/flombe.rb', line 29

def run
  raise BadMacOSXVersionError, "You must have Snow Leopard for Flombe. Sorry bro." unless macosx?
  raise MissingXCodeError, "You must have xcode installed to run Flombe." unless xcode?
  raise NoFlombefileError, "There is no Flombefile here: #{Dir.pwd}" unless flombefile?
  raise RunningAsRootError, "Please do not run this command as root." if root?
  
  if `/usr/bin/xcode-select -print-path` + `/usr/bin/llvm-gcc-4.2 -v 2>&1` =~ /LLVM build (\d{4,})/
    if $1.to_i < RECOMMENDED_LLVM
      warn "You should really upgrade your xcode install for best performance."
    end
  end
  
  run_chef
end