Sha256: 3d99f0505f67fc4488e7bee1203de4383968ddcdfddb5be2c8a02fd816911232

Contents?: true

Size: 1.07 KB

Versions: 39

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_base0/core_ext'

module Avm
  module Tools
    class Runner
      class Instance < ::Avm::Instances::Runner
        class Entry
          runner_with :help, :output do
            desc 'Retorna valor de uma entrada de instância AVM.'
            bool_opt '-d', '--debug'
            pos_arg :envvar_suffix, repeat: true
          end

          def run
            debug
            run_output
          end

          def output_content
            parsed.envvar_suffix.map { |entry_key| "#{instance.entry(entry_key).value}\n" }.join
          end

          def debug
            return unless parsed.debug?

            parsed.envvar_suffix.map { |entry_key| debug_entry(entry_key) }
          end

          def debug_entry(entry_key)
            infov 'Entry key', entry_key
            e = instance.entry(entry_key)
            infov '  * Type', e.class
            infov '  * Full path', e.full_path
            infov '  * Found?', e.context_found?
            infov '  * Value', e.value
          end
        end
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
avm-tools-0.162.0 lib/avm/tools/runner/instance/entry.rb
eac_tools-0.94.0 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
avm-tools-0.161.0 lib/avm/tools/runner/instance/entry.rb
eac_tools-0.86.5 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
avm-tools-0.160.2 lib/avm/tools/runner/instance/entry.rb
eac_tools-0.86.4 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
eac_tools-0.86.3 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
avm-tools-0.160.1 lib/avm/tools/runner/instance/entry.rb
eac_tools-0.86.2 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
eac_tools-0.86.1 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
avm-tools-0.160.0 lib/avm/tools/runner/instance/entry.rb
eac_tools-0.86.0 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
eac_tools-0.85.1 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
avm-tools-0.159.1 lib/avm/tools/runner/instance/entry.rb
eac_tools-0.85.0 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
eac_tools-0.84.2 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
eac_tools-0.84.1 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
eac_tools-0.84.0 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
eac_tools-0.83.0 sub/avm-tools/lib/avm/tools/runner/instance/entry.rb
avm-tools-0.159.0 lib/avm/tools/runner/instance/entry.rb