Sha256: e8a0f73f078fcd35339be9afbe96f358eb2d45588f44e6fd52833941628f85ff

Contents?: true

Size: 713 Bytes

Versions: 24

Compression:

Stored size: 713 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.map(&:message)
      end

      private

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

Version data entries

24 entries across 24 versions & 1 rubygems

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