Class: Ladder::Cookbooks::LocalCookbook

Inherits:
Cookbook
  • Object
show all
Defined in:
lib/chef/ladder/cookbooks.rb

Instance Attribute Summary

Attributes inherited from Cookbook

#name, #source

Instance Method Summary collapse

Methods inherited from Cookbook

create

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