Class: Wright::Resource::Package
- Inherits:
-
Wright::Resource
- Object
- Wright::Resource
- Wright::Resource::Package
- Defined in:
- lib/wright/resource/package.rb
Overview
Package resource, represents a package.
Instance Attribute Summary collapse
-
#version ⇒ String
The package version to install or remove.
Attributes inherited from Wright::Resource
#action, #ignore_failure, #name, #resource_name
Instance Method Summary collapse
-
#initialize(name) ⇒ Package
constructor
Initializes a Package.
-
#install ⇒ Bool
Installs the Package.
-
#installed_versions ⇒ Array<String>
The installed package versions.
-
#remove ⇒ Bool
(also: #uninstall)
Removes the Package.
Methods inherited from Wright::Resource
Constructor Details
#initialize(name) ⇒ Package
Initializes a Package.
29 30 31 32 33 |
# File 'lib/wright/resource/package.rb', line 29 def initialize(name) super @version = nil @action = :install end |
Instance Attribute Details
#version ⇒ String
Returns the package version to install or remove.
24 25 26 |
# File 'lib/wright/resource/package.rb', line 24 def version @version end |
Instance Method Details
#install ⇒ Bool
Installs the Package.
44 45 46 47 48 |
# File 'lib/wright/resource/package.rb', line 44 def install might_update_resource do @provider.install end end |
#installed_versions ⇒ Array<String>
Returns the installed package versions.
36 37 38 |
# File 'lib/wright/resource/package.rb', line 36 def installed_versions @provider.installed_versions end |
#remove ⇒ Bool Also known as: uninstall
Removes the Package.
54 55 56 57 58 |
# File 'lib/wright/resource/package.rb', line 54 def remove might_update_resource do @provider.remove end end |