Class: AdLint::Analyzer
- Inherits:
-
Object
- Object
- AdLint::Analyzer
- Defined in:
- lib/adlint/analyzer.rb
Direct Known Subclasses
ConfigurationValidator, CrossModuleAnalyzer, SingleModuleAnalyzer
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#message_catalog ⇒ Object
readonly
Returns the value of attribute message_catalog.
-
#traits ⇒ Object
readonly
Returns the value of attribute traits.
Instance Method Summary collapse
-
#initialize(name, traits, msg_catalog, target_name, output_dpath, log_basename, verbose) ⇒ Analyzer
constructor
A new instance of Analyzer.
- #run ⇒ Object
Constructor Details
#initialize(name, traits, msg_catalog, target_name, output_dpath, log_basename, verbose) ⇒ Analyzer
Returns a new instance of Analyzer.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/adlint/analyzer.rb', line 48 def initialize(name, traits, msg_catalog, target_name, output_dpath, log_basename, verbose) @name = name @traits = traits @message_catalog = msg_catalog @target_name = target_name @output_dpath = output_dpath @log_basename = log_basename @verbose = verbose @logger = nil end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
62 63 64 |
# File 'lib/adlint/analyzer.rb', line 62 def logger @logger end |
#message_catalog ⇒ Object (readonly)
Returns the value of attribute message_catalog.
61 62 63 |
# File 'lib/adlint/analyzer.rb', line 61 def @message_catalog end |
#traits ⇒ Object (readonly)
Returns the value of attribute traits.
60 61 62 |
# File 'lib/adlint/analyzer.rb', line 60 def traits @traits end |
Instance Method Details
#run ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/adlint/analyzer.rb', line 64 def run File.open(log_fpath, "w") do |log_io| @logger = Logger.new(log_io).tap { |logger| logger.progname = @name logger.datetime_format = "%F %T " } begin log_start_analysis execute(ProgressMonitor.new(@target_name, phases.size, @verbose)) rescue => ex @logger.fatal(ex) return false end end true end |