Class: RubocopDirector::RubocopStats

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop_director/rubocop_stats.rb

Constant Summary collapse

TEMP_CONFIG_PATH =
"./.temp_rubocop.yml"

Instance Method Summary collapse

Constructor Details

#initialize(rubocop_path) ⇒ RubocopStats

Returns a new instance of RubocopStats.



14
15
16
# File 'lib/rubocop_director/rubocop_stats.rb', line 14

def initialize(rubocop_path)
  @rubocop_path = rubocop_path
end

Instance Method Details

#fetch {|generate_temp_rubocop_config_without_todo(initial_config: config)| ... } ⇒ Object

Yields:

  • (generate_temp_rubocop_config_without_todo(initial_config: config))


18
19
20
21
22
23
24
25
26
# File 'lib/rubocop_director/rubocop_stats.rb', line 18

def fetch
  config = yield load_config
  yield generate_temp_rubocop_config_without_todo(initial_config: config)

  stats = yield generate_stats
  yield remove_temp_config

  Success(stats)
end