Class: Ladder::Cookbooks::LocalCookbook
- Defined in:
- lib/chef/ladder/cookbooks.rb
Instance Attribute Summary
Attributes inherited from Cookbook
Instance Method Summary collapse
- #fetch(directory) ⇒ Object
-
#initialize(name, source) ⇒ LocalCookbook
constructor
A new instance of LocalCookbook.
Methods inherited from Cookbook
Constructor Details
#initialize(name, source) ⇒ LocalCookbook
Returns a new instance of LocalCookbook.
46 47 48 49 |
# File 'lib/chef/ladder/cookbooks.rb', line 46 def initialize(name, source) @name = name @source = File.absolute_path(source) end |
Instance Method Details
#fetch(directory) ⇒ Object
51 52 53 54 55 |
# File 'lib/chef/ladder/cookbooks.rb', line 51 def fetch(directory) dest = File.join(directory, @name) FileUtils.remove(dest, :force => true) FileUtils.symlink(@source, dest, :force => true) end |