Class: Teapot::Command::Selection

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/teapot/command/selection.rb

Direct Known Subclasses

Build, List, Status, Visualize

Instance Method Summary collapse

Instance Method Details

#callObject



44
45
46
47
48
# File 'lib/teapot/command/selection.rb', line 44

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

#selection(context) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/teapot/command/selection.rb', line 36

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

#targetsObject



30
31
32
33
34
# File 'lib/teapot/command/selection.rb', line 30

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