Sha256: 8022dd4694e91a2c113351e848b909d1b956eeae12772444c17667244aa6ce75

Contents?: true

Size: 1.14 KB

Versions: 90

Compression:

Stored size: 1.14 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.new.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

90 entries across 90 versions & 1 rubygems

Version Path
appmap-1.1.1 lib/appmap/command/agent_setup/status.rb
appmap-1.0.1 lib/appmap/command/agent_setup/status.rb
appmap-1.0.0 lib/appmap/command/agent_setup/status.rb
appmap-0.103.0 lib/appmap/command/agent_setup/status.rb
appmap-0.102.2 lib/appmap/command/agent_setup/status.rb
appmap-0.102.1 lib/appmap/command/agent_setup/status.rb
appmap-0.102.0 lib/appmap/command/agent_setup/status.rb
appmap-0.101.0 lib/appmap/command/agent_setup/status.rb
appmap-0.100.0 lib/appmap/command/agent_setup/status.rb
appmap-0.99.4 lib/appmap/command/agent_setup/status.rb
appmap-0.99.2 lib/appmap/command/agent_setup/status.rb
appmap-0.99.1 lib/appmap/command/agent_setup/status.rb
appmap-0.99.0 lib/appmap/command/agent_setup/status.rb
appmap-0.98.1 lib/appmap/command/agent_setup/status.rb
appmap-0.98.0 lib/appmap/command/agent_setup/status.rb
appmap-0.97.0 lib/appmap/command/agent_setup/status.rb
appmap-0.96.0 lib/appmap/command/agent_setup/status.rb
appmap-0.95.2 lib/appmap/command/agent_setup/status.rb
appmap-0.95.1 lib/appmap/command/agent_setup/status.rb
appmap-0.95.0 lib/appmap/command/agent_setup/status.rb