Class: Ladder::Command

Inherits:
Escort::ActionCommand::Base
  • Object
show all
Defined in:
lib/chef/ladder.rb

Direct Known Subclasses

Fetch, Upload

Instance Method Summary collapse

Instance Method Details

#executeObject



21
22
23
24
25
26
27
# File 'lib/chef/ladder.rb', line 21

def execute
	# Load Chef configuration
	@@chef_config ||= Chef::Config.from_file(global_options[:knife])

	# Load Ladderfile configuration
	@sources = Ladder::Sources.from_file(global_options[:config])
end

#selected_cookbooksObject

A list of Ladder::Cookbook objects If the arguments list is empty, all cookbooks are used



31
32
33
34
# File 'lib/chef/ladder.rb', line 31

def selected_cookbooks
	names = arguments.empty? ? @sources.keys : arguments
	names.map { |name| @sources[name] }
end