Class: Brew::HomeBrew
- Inherits:
-
Object
- Object
- Brew::HomeBrew
- Defined in:
- lib/brew/home_brew.rb
Constant Summary collapse
- DEFAULT_BREW_PATH =
'/usr/local/bin/brew'
Instance Method Summary collapse
- #info(formula = [], **kwargs) ⇒ Object
-
#initialize(brew_path: nil) ⇒ HomeBrew
constructor
A new instance of HomeBrew.
- #install(formula, **kwargs) ⇒ Object
- #list(formulae = [], **kwargs) ⇒ Object (also: #ls)
- #search(text = nil, **kwargs) ⇒ Object
- #uninstall(formula, **kwargs) ⇒ Object (also: #rm, #remove)
- #update(**kwargs) ⇒ Object (also: #up)
- #upgrade(formula = [], **kwargs) ⇒ Object
Constructor Details
#initialize(brew_path: nil) ⇒ HomeBrew
Returns a new instance of HomeBrew.
18 19 20 21 |
# File 'lib/brew/home_brew.rb', line 18 def initialize(brew_path: nil) @brew_path = brew_path || DEFAULT_BREW_PATH raise HomeBrewNotInstalled unless File.executable?(@brew_path) end |
Instance Method Details
#info(formula = [], **kwargs) ⇒ Object
23 24 25 |
# File 'lib/brew/home_brew.rb', line 23 def info(formula = [], **kwargs) Commands::Info.new(brew_path, formula, **kwargs).execute! end |
#install(formula, **kwargs) ⇒ Object
27 28 29 |
# File 'lib/brew/home_brew.rb', line 27 def install(formula, **kwargs) Commands::Install.new(brew_path, formula, **kwargs).execute! end |
#list(formulae = [], **kwargs) ⇒ Object Also known as: ls
31 32 33 |
# File 'lib/brew/home_brew.rb', line 31 def list(formulae = [], **kwargs) Commands::List.new(brew_path, formulae, **kwargs).execute! end |
#search(text = nil, **kwargs) ⇒ Object
36 37 38 |
# File 'lib/brew/home_brew.rb', line 36 def search(text = nil, **kwargs) Commands::Search.new(brew_path, text, **kwargs).execute! end |
#uninstall(formula, **kwargs) ⇒ Object Also known as: rm, remove
40 41 42 |
# File 'lib/brew/home_brew.rb', line 40 def uninstall(formula, **kwargs) Commands::Uninstall.new(brew_path, formula, **kwargs).execute! end |