Class: Ruumba::Analyzer
- Inherits:
-
Object
- Object
- Ruumba::Analyzer
- Defined in:
- lib/ruumba/analyzer.rb
Overview
Generates analyzer objects that, when run, delegate to RuboCop for linting (style, correctness, &c).
Instance Method Summary collapse
-
#initialize(opts = nil) ⇒ Analyzer
constructor
A new instance of Analyzer.
-
#run(files_or_dirs = ARGV) ⇒ Object
Performs static analysis on the provided directory.
Constructor Details
#initialize(opts = nil) ⇒ Analyzer
Returns a new instance of Analyzer.
20 21 22 |
# File 'lib/ruumba/analyzer.rb', line 20 def initialize(opts = nil) @options = opts || {} end |
Instance Method Details
#run(files_or_dirs = ARGV) ⇒ Object
Performs static analysis on the provided directory.
26 27 28 29 30 31 32 33 34 |
# File 'lib/ruumba/analyzer.rb', line 26 def run(files_or_dirs = ARGV) if [:tmp_folder] analyze(File.([:tmp_folder]), files_or_dirs) else Dir.mktmpdir do |dir| analyze(dir, files_or_dirs) end end end |