class Bake::Context

def recipe_for(command)

def recipe_for(command)
	path = command.split(":")
	
	# If the command is in the form `foo:bar`, we check two cases:
	#
	# (1) We check for an instance at path `foo:bar` and if it responds to `bar`.
	if instance = @instances[path] and instance.respond_to?(path.last)
		return instance.recipe_for(path.last)
	else
		# (2) We check for an instance at path `foo` and if it responds to `bar`.
		*path, name = *path
		
		if instance = @instances[path] and instance.respond_to?(name)
			return instance.recipe_for(name)
		end
	end
	
	return nil
end