Sha256: d880c37891efb1a30b7e0ab9b291a5a60399e12c05827c6ba8cd06f664dd7178
Contents?: true
Size: 1.07 KB
Versions: 57
Compression:
Stored size: 1.07 KB
Contents
# frozen_string_literal: true require 'eac_ruby_utils/console/docopt_runner' require 'eac_ruby_utils/console/speaker' module EacLauncher module Instances class RunnerHelper < ::EacRubyUtils::Console::DocoptRunner include ::EacRubyUtils::Console::Speaker def context @context ||= ::EacLauncher::Context.current end def find_instances(instance_name) context.instances.select { |instance| instance_match?(instance, instance_name) } end def instance_match?(instance, instance_name) ::File.fnmatch?(instance_name, instance.name) end 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 def instance_stereotypes(instance) instance.stereotypes.map(&:label).join(', ') end def instance_label(instance) "#{instance.name} [#{instance_stereotypes(instance)}]" end end end end
Version data entries
57 entries across 57 versions & 1 rubygems