class EacLauncher::Instances::RunnerHelper

Public Instance Methods

context() click to toggle source
# File lib/eac_launcher/instances/runner_helper.rb, line 11
def context
  @context ||= ::EacLauncher::Context.current
end
find_instances(instance_name) click to toggle source
# File lib/eac_launcher/instances/runner_helper.rb, line 15
def find_instances(instance_name)
  context.instances.select { |instance| instance_match?(instance, instance_name) }
end
instance_label(instance) click to toggle source
# File lib/eac_launcher/instances/runner_helper.rb, line 37
def instance_label(instance)
  "#{instance.name} [#{instance_stereotypes(instance)}]"
end
instance_match?(instance, instance_name) click to toggle source
# File lib/eac_launcher/instances/runner_helper.rb, line 19
def instance_match?(instance, instance_name)
  ::File.fnmatch?(instance_name, instance.name)
end
instance_stereotypes(instance) click to toggle source
# File lib/eac_launcher/instances/runner_helper.rb, line 33
def instance_stereotypes(instance)
  instance.stereotypes.map(&:stereotype_name_in_color).join(', ')
end
instances() click to toggle source
# File lib/eac_launcher/instances/runner_helper.rb, line 23
def instances
  if options['--all']
    context.instances
  elsif options['--pending']
    context.pending_instances
  else
    options['<instance_path>'].flat_map { |p| find_instances(p) }
  end
end