Class: Kibou::Package
- Inherits:
-
Object
- Object
- Kibou::Package
- Includes:
- Utility::Helpers
- Defined in:
- lib/kibou/package.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #completed? ⇒ Boolean
-
#initialize(name, options = {}) ⇒ Package
constructor
A new instance of Package.
- #perform ⇒ Object
Methods included from Utility::Helpers
#brew, #brew_installed?, #capture, #info, #outdated, #package_included?, #package_install, #package_installed?, #package_outdated?, #package_upgrade, #run, #search, #update!
Constructor Details
#initialize(name, options = {}) ⇒ Package
Returns a new instance of Package.
8 9 10 11 12 13 14 |
# File 'lib/kibou/package.rb', line 8 def initialize(name, = {}) @name = name.to_s = @dependencies = ([:require] || []).map {|dep| Kibou::Dependency.new(self, dep) } @completed = false @outdated = false end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
6 7 8 |
# File 'lib/kibou/package.rb', line 6 def dependencies @dependencies end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/kibou/package.rb', line 6 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/kibou/package.rb', line 6 def end |
Instance Method Details
#completed? ⇒ Boolean
24 25 26 |
# File 'lib/kibou/package.rb', line 24 def completed? !!@completed end |
#perform ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/kibou/package.rb', line 16 def perform return invoke_proc if [:proc].present? return install if [:via].present? return unless package_included?(name) return install unless package_installed?(name) outdated? ? upgrade : end |