Sha256: 24e16d2d25f949108ceb1bc9fdaf8ef9965e4dbd0eeb2ab8815630d245bbb95f

Contents?: true

Size: 790 Bytes

Versions: 124

Compression:

Stored size: 790 Bytes

Contents

# frozen_string_literal: true

require 'eac_cli/core_ext'

module Avm
  module Sources
    class Runner
      runner_with :help, :subcommands do
        desc 'Root command for sources.'
        arg_opt '-C', '--path', 'Path to the source.', default: '.'
        subcommands
      end

      def extra_available_subcommands
        optional_source.if_present({}, &:extra_available_subcommands)
      end

      def source_banner
        infov 'Source', source
      end

      # @return [Pathname]
      def source_path
        parsed.path.to_pathname
      end

      private

      def source_uncached
        ::Avm::Registry.sources.detect(source_path)
      end

      def optional_source_uncached
        ::Avm::Registry.sources.detect_optional(source_path)
      end
    end
  end
end

Version data entries

124 entries across 124 versions & 2 rubygems

Version Path
eac_tools-0.59.0 sub/avm/lib/avm/sources/runner.rb
avm-0.66.1 lib/avm/sources/runner.rb
eac_tools-0.58.0 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.57.0 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.56.1 sub/avm/lib/avm/sources/runner.rb
avm-0.66.0 lib/avm/sources/runner.rb
eac_tools-0.56.0 sub/avm/lib/avm/sources/runner.rb
avm-0.65.0 lib/avm/sources/runner.rb
eac_tools-0.55.7 sub/avm/lib/avm/sources/runner.rb
avm-0.64.2 lib/avm/sources/runner.rb
eac_tools-0.55.6 sub/avm/lib/avm/sources/runner.rb
avm-0.64.1 lib/avm/sources/runner.rb
eac_tools-0.55.5 sub/avm/lib/avm/sources/runner.rb
avm-0.64.0 lib/avm/sources/runner.rb
eac_tools-0.55.4 sub/avm/lib/avm/sources/runner.rb
avm-0.63.0 lib/avm/sources/runner.rb
eac_tools-0.55.3 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.55.2 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.55.1 sub/avm/lib/avm/sources/runner.rb
avm-0.62.0 lib/avm/sources/runner.rb