Sha256: 3aef5e97b194267ec9c13074b24edf30cff23935fda69bb0146ef6e7e2b3b390

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

require 'json'
require 'appmap/service/config_analyzer'
require 'appmap/service/integration_test_path_finder'
require 'appmap/service/test_command_provider'

module AppMap
  module Command
    module AgentSetup
      StatusStruct = Struct.new(:config_file)

      class Status < StatusStruct
        def perform
          status = {
            test_commands: Service::TestCommandProvider.all,
            properties: {
              config: {
                app: config_analyzer.app_name,
                present: config_analyzer.present?,
                valid: config_analyzer.valid?
              },
              project: {
                agentVersion: AppMap::VERSION,
                language: 'ruby',
                remoteRecordingCapable: Gem.loaded_specs.has_key?('rails'),
                integrationTests: Service::IntegrationTestPathFinder.count_paths > 0
              }
            }
          }

          puts JSON.pretty_generate(status)
        end

        private

        def config_analyzer
          @config_analyzer ||= Service::ConfigAnalyzer.new(config_file)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
appmap-0.60.0 lib/appmap/command/agent_setup/status.rb
appmap-0.59.2 lib/appmap/command/agent_setup/status.rb
appmap-0.59.1 lib/appmap/command/agent_setup/status.rb
appmap-0.59.0 lib/appmap/command/agent_setup/status.rb
appmap-0.58.0 lib/appmap/command/agent_setup/status.rb