Class: Brewdler::BrewInstaller

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

Class Method Summary collapse

Class Method Details

.install(name, options = {}) ⇒ Object


3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/brewdler/brew_installer.rb', line 3

def self.install(name, options = {})
  if `which brew`; $?.success?
    command = "brew install #{name}"
    unless options[:args].nil?
      options[:args].each do |arg|
        command << " --#{arg}"
      end
    end

    `#{command}`
  else
    raise "Unable to install #{name}. Homebrew is not currently installed on your system"
  end
end