Class: Ladder::Cookbooks::GitCookbook

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

Direct Known Subclasses

GithubCookbook

Instance Attribute Summary

Attributes inherited from Cookbook

#name, #source

Instance Method Summary collapse

Methods inherited from Cookbook

create, #initialize

Constructor Details

This class inherits a constructor from Ladder::Cookbooks::Cookbook

Instance Method Details

#fetch(directory) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/chef/ladder/cookbooks.rb', line 27

def fetch(directory)
	path = File.join(directory, @name)

	if Dir.exists?(path)
		Git.open(path).pull()
	else
		Git.clone(@source, path)
	end
end