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
avm-0.72.0 lib/avm/sources/runner.rb
eac_tools-0.66.0 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.65.1 sub/avm/lib/avm/sources/runner.rb
avm-0.71.0 lib/avm/sources/runner.rb
eac_tools-0.65.0 sub/avm/lib/avm/sources/runner.rb
avm-0.70.0 lib/avm/sources/runner.rb
eac_tools-0.64.0 sub/avm/lib/avm/sources/runner.rb
avm-0.69.0 lib/avm/sources/runner.rb
eac_tools-0.63.0 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.62.1 sub/avm/lib/avm/sources/runner.rb
avm-0.68.0 lib/avm/sources/runner.rb
eac_tools-0.62.0 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.61.1 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.61.0 sub/avm/lib/avm/sources/runner.rb
avm-0.67.1 lib/avm/sources/runner.rb
eac_tools-0.60.3 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.60.2 sub/avm/lib/avm/sources/runner.rb
avm-0.67.0 lib/avm/sources/runner.rb
eac_tools-0.60.1 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.60.0 sub/avm/lib/avm/sources/runner.rb