Sha256: e9f717ade3b9425c8e012b6ef162b4f2ff1e3fe741fb5e2a5f2e505c2c5d0b91

Contents?: true

Size: 830 Bytes

Versions: 23

Compression:

Stored size: 830 Bytes

Contents

# frozen_string_literal: true

require 'appmap/service/validator/config_validator'

module AppMap
  module Service
    class ConfigAnalyzer
      attr_reader :config_error

      def initialize(config_file)
        @config_file = config_file
      end

      def app_name
        config_validator.config.to_h['name'] if present?
      end

      def present?
        File.exist?(@config_file)
      end

      def valid?
        config_validator.valid?
      end

      def errors
        valid?
        config_validator.violations.filter(&:error?).map(&:message)
      end

      def warnings
        config_validator.violations.filter(&:warning?).map(&:message)
      end

      private

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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
appmap-0.94.1 lib/appmap/service/config_analyzer.rb
appmap-0.94.0 lib/appmap/service/config_analyzer.rb
appmap-0.93.5 lib/appmap/service/config_analyzer.rb