Sha256: c82d2f73b10649ba6acb1c0dbd6f8c729f579e8e07ea0328324b8fcdf9b00c23

Contents?: true

Size: 801 Bytes

Versions: 55

Compression:

Stored size: 801 Bytes

Contents

# frozen_string_literal: true

require 'json'
require 'appmap/service/validator/config_validator'

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

      class Validate < ValidateStruct
        def perform
          schema_path = File.expand_path('../../../../../config-schema.yml', __FILE__)
          schema = YAML.safe_load(File.read(schema_path))
          result = {
            version: 2,
            errors: config_validator.valid? ? [] : config_validator.violations.map(&:to_h),
            schema: schema
          }
          puts JSON.pretty_generate(result)
        end

        private

        def config_validator
          @validator ||= Service::Validator::ConfigValidator.new(config_file)
        end
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
appmap-0.93.4 lib/appmap/command/agent_setup/validate.rb
appmap-0.93.3 lib/appmap/command/agent_setup/validate.rb
appmap-0.93.2 lib/appmap/command/agent_setup/validate.rb
appmap-0.93.1 lib/appmap/command/agent_setup/validate.rb
appmap-0.93.0 lib/appmap/command/agent_setup/validate.rb
appmap-0.92.1 lib/appmap/command/agent_setup/validate.rb
appmap-0.92.0 lib/appmap/command/agent_setup/validate.rb
appmap-0.91.0 lib/appmap/command/agent_setup/validate.rb
appmap-0.90.1 lib/appmap/command/agent_setup/validate.rb
appmap-0.90.0 lib/appmap/command/agent_setup/validate.rb
appmap-0.89.0 lib/appmap/command/agent_setup/validate.rb
appmap-0.88.0 lib/appmap/command/agent_setup/validate.rb
appmap-0.87.0 lib/appmap/command/agent_setup/validate.rb
appmap-0.86.0 lib/appmap/command/agent_setup/validate.rb
appmap-0.85.0 lib/appmap/command/agent_setup/validate.rb
appmap-0.84.0 lib/appmap/command/agent_setup/validate.rb
appmap-0.83.6 lib/appmap/command/agent_setup/validate.rb
appmap-0.83.5 lib/appmap/command/agent_setup/validate.rb
appmap-0.83.4 lib/appmap/command/agent_setup/validate.rb
appmap-0.83.3 lib/appmap/command/agent_setup/validate.rb