Class: Rucoa::Rubocop::Investigator
- Inherits:
-
RuboCop::Runner
- Object
- RuboCop::Runner
- Rucoa::Rubocop::Investigator
- Defined in:
- lib/rucoa/rubocop/investigator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Array<RuboCop::Cop::Offense>
-
#initialize(source:) ⇒ Investigator
constructor
A new instance of Investigator.
Constructor Details
#initialize(source:) ⇒ Investigator
Returns a new instance of Investigator.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rucoa/rubocop/investigator.rb', line 17 def initialize(source:) @source = source @offenses = [] super( ::RuboCop::Options.new.parse( %w[ --stderr --force-exclusion --format RuboCop::Formatter::BaseFormatter ] ).first, ::RuboCop::ConfigStore.new ) end |
Class Method Details
.call(source:) ⇒ Array<RuboCop::Cop::Offense>
11 12 13 |
# File 'lib/rucoa/rubocop/investigator.rb', line 11 def call(source:) new(source: source).call end |
Instance Method Details
#call ⇒ Array<RuboCop::Cop::Offense>
33 34 35 36 37 |
# File 'lib/rucoa/rubocop/investigator.rb', line 33 def call @options[:stdin] = @source.content run([path]) @offenses end |