TeapotSourceTeapotCommandSelection

class Selection

Base class for commands that work with selections.

Definitions

def targets

The set of target names to process, or nil if no targets were specified.

Signature

returns Set | Nil

The set of target names.

Implementation

def targets
	if @targets and @targets.any?
		Set.new(@targets)
	end
end

def selection(context)

Get the selection for the given context.

Signature

parameter context Context

The project context.

returns Select

The selection.

Implementation

def selection(context)
	if targets = self.targets
		context.select(targets)
	else
		context.select(context.configuration[:build])
	end
end

def call

Execute the selection command.

Implementation

def call
	context = parent.context
	
	self.process(selection(parent.context))
end