Sha256: 27e2d8ecfb03b063974af27aeb86a335c9eb2b52b3a55cb8f8232c3d1b793603

Contents?: true

Size: 1.04 KB

Versions: 5

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

require 'avm/tools/core_ext'

module Avm
  module Tools
    class Runner
      class AppSrc
        class Info
          runner_with :help do
            desc 'Show information about local project instance.'
          end

          def run
            show_instance
            show_source
            show_subs
          end

          private

          def show_instance
            infov 'Path', instance.path
            infov 'Stereotypes', instance.stereotypes.map(&:label).join(', ')
          end

          def show_source
            infov 'Stereotype', runner_context.call(:subject).stereotype
            infov 'SCM', runner_context.call(:subject).scm
          end

          def show_subs
            infov 'Sub applications', instance.avm_instance.subs.count
            instance.avm_instance.subs.each do |subapp|
              infov '  * ', subapp.relative_path
            end
          end

          def instance
            runner_context.call(:instance)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
avm-tools-0.112.0 lib/avm/tools/runner/app_src/info.rb
avm-tools-0.111.0 lib/avm/tools/runner/app_src/info.rb
avm-tools-0.110.0 lib/avm/tools/runner/app_src/info.rb
avm-tools-0.109.1 lib/avm/tools/runner/app_src/info.rb
avm-tools-0.109.0 lib/avm/tools/runner/app_src/info.rb