Class: Resource::Package
- Inherits:
-
Base
- Object
- Base
- Resource::Package
show all
- Defined in:
- lib/resource/package.rb
Instance Method Summary
collapse
Methods inherited from Base
inherited, #not_if, #set_base_defaults, #should_skip?, #unix_mode
Methods included from ClassAttr
included
Methods included from BlockAttr
included
Constructor Details
#initialize(package_name, &block) ⇒ Package
7
8
9
10
11
|
# File 'lib/resource/package.rb', line 7
def initialize package_name, &block
set_base_defaults
@package_name = package_name
self.instance_eval(&block)
end
|
Instance Method Details
#run ⇒ Object
13
14
15
16
17
18
|
# File 'lib/resource/package.rb', line 13
def run
Execution.block 'Installing Package', @package_name, @owner do |b|
b.always_run @always_run
b.run "apt-get install -y #{@package_name}"
end
end
|
20
21
22
|
# File 'lib/resource/package.rb', line 20
def value_for_platform *args
@package_name
end
|