Sha256: fa3f28e269c917c58595fe9e1a4ba352e802c7b195301179add11e808fe67890

Contents?: true

Size: 770 Bytes

Versions: 22

Compression:

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

22 entries across 22 versions & 1 rubygems

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