Class: Shoestring::Homebrew
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#brew_cmd ⇒ Object
readonly
Returns the value of attribute brew_cmd.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(name, url, brew_cmd, &block) ⇒ Homebrew
constructor
A new instance of Homebrew.
Methods inherited from Base
Constructor Details
#initialize(name, url, brew_cmd, &block) ⇒ Homebrew
Returns a new instance of Homebrew.
5 6 7 8 9 10 |
# File 'lib/shoestring/homebrew.rb', line 5 def initialize(name, url, brew_cmd, &block) @name = name @url = url @brew_cmd = brew_cmd @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
3 4 5 |
# File 'lib/shoestring/homebrew.rb', line 3 def block @block end |
#brew_cmd ⇒ Object (readonly)
Returns the value of attribute brew_cmd.
3 4 5 |
# File 'lib/shoestring/homebrew.rb', line 3 def brew_cmd @brew_cmd end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/shoestring/homebrew.rb', line 3 def name @name end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/shoestring/homebrew.rb', line 3 def url @url end |
Instance Method Details
#check ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/shoestring/homebrew.rb', line 12 def check if block.call puts "#{name}: check!" else puts "You need to setup #{name} #{url}" homebrew_installed = %x(brew -v) if homebrew_installed install_with_homebrew else install_homebrew install_with_homebrew end end end |