Class: Pronto::RubyCritic::Analyser
- Inherits:
-
Object
- Object
- Pronto::RubyCritic::Analyser
- Defined in:
- lib/pronto/rubycritic/analyser.rb
Overview
Thin wrapper around RubyCritic’s AnalysersRunner. Owns the side-effect of configuring RubyCritic’s global Config; no other class in this gem touches ::RubyCritic::Config.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(paths) ⇒ Analyser
constructor
A new instance of Analyser.
Constructor Details
#initialize(paths) ⇒ Analyser
Returns a new instance of Analyser.
12 13 14 |
# File 'lib/pronto/rubycritic/analyser.rb', line 12 def initialize(paths) @paths = Array(paths).map(&:to_s).uniq.reject(&:empty?) end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 |
# File 'lib/pronto/rubycritic/analyser.rb', line 16 def call return [] if @paths.empty? configure_rubycritic ::RubyCritic::AnalysersRunner.new(@paths).run end |