Module: Avm::Launcher::Instances::RunnerHelper

Defined in:
lib/avm/launcher/instances/runner_helper.rb

Instance Method Summary collapse

Instance Method Details

#contextObject



21
22
23
# File 'lib/avm/launcher/instances/runner_helper.rb', line 21

def context
  @context ||= ::Avm::Launcher::Context.current
end

#instance_label(instance) ⇒ Object



37
38
39
# File 'lib/avm/launcher/instances/runner_helper.rb', line 37

def instance_label(instance)
  "#{instance.name} [#{instance_stereotypes(instance)}]"
end

#instance_stereotypes(instance) ⇒ Object



33
34
35
# File 'lib/avm/launcher/instances/runner_helper.rb', line 33

def instance_stereotypes(instance)
  instance.stereotypes.map(&:label).join(', ')
end

#instancesObject



25
26
27
28
29
30
31
# File 'lib/avm/launcher/instances/runner_helper.rb', line 25

def instances
  collector = ::Avm::Launcher::Context::InstanceCollector.new(context)
  collector.add_all if parsed.all?
  collector.add_pending if parsed.pending?
  parsed.instance_path.flat_map { |p| collector.add_path(p) }
  collector.instances
end

#setup_cacheObject



41
42
43
# File 'lib/avm/launcher/instances/runner_helper.rb', line 41

def setup_cache
  ::Avm::Launcher::Context.current.recache = parsed.recache?
end