Class: Roasted::Provider::Brew
- Inherits:
-
Object
- Object
- Roasted::Provider::Brew
- Defined in:
- lib/roasted/provider/brew.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#formula ⇒ Object
Returns the value of attribute formula.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Brew
constructor
A new instance of Brew.
- #install ⇒ Object
- #install_brew ⇒ Object
Constructor Details
#initialize(options) ⇒ Brew
Returns a new instance of Brew.
12 13 14 15 16 17 |
# File 'lib/roasted/provider/brew.rb', line 12 def initialize() @action = .delete(:action) @formula = .delete(:formula) @options = end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
5 6 7 |
# File 'lib/roasted/provider/brew.rb', line 5 def action @action end |
#formula ⇒ Object
Returns the value of attribute formula.
4 5 6 |
# File 'lib/roasted/provider/brew.rb', line 4 def formula @formula end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/roasted/provider/brew.rb', line 6 def @options end |
Class Method Details
.create(options) ⇒ Object
8 9 10 |
# File 'lib/roasted/provider/brew.rb', line 8 def self.create() return new() end |
Instance Method Details
#install ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/roasted/provider/brew.rb', line 19 def install # Simple, check if we have brew installed install_brew unless File.executable?("/usr/local/bin/brew") unless File.directory?("/usr/local/Cellar/#{@formula}") system("/usr/local/bin/brew install #{@formula}") end end |
#install_brew ⇒ Object
28 29 30 |
# File 'lib/roasted/provider/brew.rb', line 28 def install_brew system '/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"' end |