Sha256: f0832cd6593ca0caa21f196cca5ba5e060f54b50f29bc908b02a953a9d21c12b

Contents?: true

Size: 814 Bytes

Versions: 8

Compression:

Stored size: 814 Bytes

Contents

# frozen_string_literal: true

require 'eac_cli/default_runner'
require 'eac_ruby_utils/core_ext'

module EacRubyBase0
  module Runner
    require_sub __FILE__
    common_concern do
      include ::EacCli::DefaultRunner
      runner_definition do
        bool_opt '-q', '--quiet', 'Quiet mode.'
        subcommands
        alt do
          bool_opt '-V', '--version', 'Show version.'
        end
      end
    end

    def run
      on_speaker_node do |node|
        node.stderr = ::StringIO.new if options.fetch('--quiet')
        if options.fetch('--version')
          show_version
        else
          run_with_subcommand
        end
      end
    end

    def application_version
      context(:application).version.to_s
    end

    def show_version
      out("#{application_version}\n")
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
avm-tools-0.72.0 vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb
avm-tools-0.71.0 vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb
avm-tools-0.70.2 vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb
avm-tools-0.70.1 vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb
avm-tools-0.70.0 vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb
avm-tools-0.69.3 vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb
eac_ruby_base0-0.1.1 lib/eac_ruby_base0/runner.rb
avm-tools-0.69.2 vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb