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.45.1 sub/avm/lib/avm/sources/runner.rb
avm-0.56.0 lib/avm/sources/runner.rb
eac_tools-0.45.0 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.44.0 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.43.0 sub/avm/lib/avm/sources/runner.rb
avm-0.55.0 lib/avm/sources/runner.rb
eac_tools-0.42.0 sub/avm/lib/avm/sources/runner.rb
eac_tools-0.41.0 sub/avm/lib/avm/sources/runner.rb
avm-0.54.0 lib/avm/sources/runner.rb
eac_tools-0.40.0 sub/avm/lib/avm/sources/runner.rb
avm-0.53.0 lib/avm/sources/runner.rb
eac_tools-0.39.0 sub/avm/lib/avm/sources/runner.rb
avm-0.52.0 lib/avm/sources/runner.rb
eac_tools-0.38.0 sub/avm/lib/avm/sources/runner.rb
avm-0.51.0 lib/avm/sources/runner.rb
eac_tools-0.37.2 sub/avm/lib/avm/sources/runner.rb
avm-0.50.0 lib/avm/sources/runner.rb
eac_tools-0.37.1 sub/avm/lib/avm/sources/runner.rb
avm-0.49.0 lib/avm/sources/runner.rb
eac_tools-0.37.0 sub/avm/lib/avm/sources/runner.rb