class DependencyCheck

Public Class Methods

carthage?() click to toggle source
# File lib/ENV/DependencyCheck.rb, line 4
def self.carthage?
  checkComponent 'carthage'
end
checkComponent(name) click to toggle source
# File lib/ENV/DependencyCheck.rb, line 12
def self.checkComponent(name)

  exts = ENV['PATH'] ? ENV['PATH'].split(':') : ['']

  exts.each do |path|

    ext = "#{path}/#{name}"
    if File.executable?(ext) && !File.directory?(ext)
      return true
    end

  end

  return false

end
checkEnv() click to toggle source
# File lib/ENV/DependencyCheck.rb, line 29
def self.checkEnv

  if !DependencyCheck.carthage?
    pastel =  Pastel.new
    puts pastel.red('[Error] Please install the Carhage. Use commend') + pastel.green(" [sudo] brew install carthage")
  end

  if !DependencyCheck.cocoapods?
    pastel =  Pastel.new
    puts pastel.red('[Error] Please install the Cocoapods. Use commend') + pastel.green(" [sudo] gem install cocoapods")
  end

end
cocoapods?() click to toggle source
# File lib/ENV/DependencyCheck.rb, line 8
def self.cocoapods?
  checkComponent 'pod'
end