Class: LogicalConstruct::UnpackCookbook
- Inherits:
-
Mattock::TaskLib
- Object
- Mattock::TaskLib
- LogicalConstruct::UnpackCookbook
- Defined in:
- lib/logical-construct/target/unpack-cookbook.rb
Instance Method Summary collapse
- #default_namespace ⇒ Object
- #default_settings(provision) ⇒ Object
- #define ⇒ Object
- #resolve_settings ⇒ Object
- #untar_command ⇒ Object
Instance Method Details
#default_namespace ⇒ Object
3 4 5 |
# File 'lib/logical-construct/target/unpack-cookbook.rb', line 3 def default_namespace :cookbook end |
#default_settings(provision) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/logical-construct/target/unpack-cookbook.rb', line 7 def default_settings(provision) settings( :construct_dir => provision.construct_dir, :cookbook_metadata => nil, :cookbook_dir => nil, :cookbook_name => "cookbook", :cookbook_archive => nil ) end |
#define ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/logical-construct/target/unpack-cookbook.rb', line 30 def define in_namespace do file cookbook_archive file => cookbook_archive do untar_command.run end task :unpack => end end |
#resolve_settings ⇒ Object
17 18 19 20 21 22 |
# File 'lib/logical-construct/target/unpack-cookbook.rb', line 17 def resolve_settings self.cookbook_archive ||= File::join(construct_dir, "cookbook.tbz") self.cookbook_dir ||= File::join(construct_dir, cookbook_name) self. ||= File::join(cookbook_dir, "metadata.rb") end |
#untar_command ⇒ Object
24 25 26 27 28 |
# File 'lib/logical-construct/target/unpack-cookbook.rb', line 24 def untar_command Mattock::CommandLine.new("tar", "-xjf") do |cmd| cmd. << cookbook_archive end end |