Sha256: 414d8d02b97ea4f309267fbd647c5989bc7f89ab39b56b6257aa4aa50385d201

Contents?: true

Size: 1.05 KB

Versions: 16

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require 'eac_launcher/context'
require 'eac_launcher/instances/runner_helper'

module EacLauncher
  class Runner < ::EacRubyUtils::Console::DocoptRunner
    class Projects < ::EacLauncher::Instances::RunnerHelper
      DOC = <<~DOCOPT
        Shows available projects.

        Usage:
          __PROGRAM__ [options]
          __PROGRAM__ -h | --help

        Options:
          -h --help        Show this screen.
          -i --instances   Show instances.
          --recache        Rewrite instances cache.

      DOCOPT

      def run
        ::EacLauncher::Context.current.recache = options['--recache']
        ::EacLauncher::Context.current.projects.each do |p|
          show_project(p)
        end
      end

      private

      def show_project(project)
        puts project_label(project)
        return unless options['--instances']

        project.instances.each do |i|
          puts "  * #{instance_label(i)}"
        end
      end

      def project_label(project)
        project.to_s.cyan.to_s
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
avm-tools-0.58.1 lib/eac_launcher/runner/projects.rb
avm-tools-0.58.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.57.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.56.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.55.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.54.2 lib/eac_launcher/runner/projects.rb
avm-tools-0.54.1 lib/eac_launcher/runner/projects.rb
avm-tools-0.54.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.53.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.52.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.51.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.50.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.49.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.48.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.47.0 lib/eac_launcher/runner/projects.rb
avm-tools-0.46.0 lib/eac_launcher/runner/projects.rb