Class: AppMap::Service::ConfigAnalyzer
- Defined in:
- lib/appmap/service/config_analyzer.rb
Instance Attribute Summary collapse
-
#config_error ⇒ Object
readonly
Returns the value of attribute config_error.
Instance Method Summary collapse
- #app_name ⇒ Object
- #errors ⇒ Object
-
#initialize(config_file) ⇒ ConfigAnalyzer
constructor
A new instance of ConfigAnalyzer.
- #present? ⇒ Boolean
- #valid? ⇒ Boolean
- #warnings ⇒ Object
Constructor Details
#initialize(config_file) ⇒ ConfigAnalyzer
Returns a new instance of ConfigAnalyzer.
10 11 12 |
# File 'lib/appmap/service/config_analyzer.rb', line 10 def initialize(config_file) @config_file = config_file end |
Instance Attribute Details
#config_error ⇒ Object (readonly)
Returns the value of attribute config_error.
8 9 10 |
# File 'lib/appmap/service/config_analyzer.rb', line 8 def config_error @config_error end |
Instance Method Details
#app_name ⇒ Object
14 15 16 |
# File 'lib/appmap/service/config_analyzer.rb', line 14 def app_name config_validator.config.to_h['name'] if present? end |
#errors ⇒ Object
26 27 28 29 |
# File 'lib/appmap/service/config_analyzer.rb', line 26 def errors valid? config_validator.violations.filter(&:error?).map(&:message) end |
#present? ⇒ Boolean
18 19 20 |
# File 'lib/appmap/service/config_analyzer.rb', line 18 def present? File.exist?(@config_file) end |
#valid? ⇒ Boolean
22 23 24 |
# File 'lib/appmap/service/config_analyzer.rb', line 22 def valid? config_validator.valid? end |
#warnings ⇒ Object
31 32 33 |
# File 'lib/appmap/service/config_analyzer.rb', line 31 def warnings config_validator.violations.filter(&:warning?).map(&:message) end |