class Velcro::Installer::Mac

OSX Specific installations

Private Instance Methods

brew() click to toggle source
# File lib/velcro/installer/mac.rb, line 8
def brew
  `ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
  `brew install caskroom/cask/brew-cask`
  `brew tap phinze/homebrew-cask`
  `brew install brew-cask`
  `brew tap caskroom/versions`
  `brew tap caskroom/fonts`
end
brew?(name) click to toggle source
# File lib/velcro/installer/mac.rb, line 27
def brew?(name)
  begin
    JSON.parse `brew info #{name} --json=v1`
  rescue JSON::ParserError
    return false
  end
  true
end
brew_install(target) click to toggle source
# File lib/velcro/installer/mac.rb, line 17
def brew_install(target)
  puts 'Formula found via brew'
  `brew install #{target}`
end
cask?(name) click to toggle source
# File lib/velcro/installer/mac.rb, line 36
def cask?(name)
  `brew cask info #{name}`.match(/No available Cask/).nil?
end
cask_install(target) click to toggle source
# File lib/velcro/installer/mac.rb, line 22
def cask_install(target)
  puts 'Formula found via cask'
  `brew cask install --appdir=/Applications #{target}`
end