lib/attractor/calculators/base_calculator.rb in attractor-2.2.0 vs lib/attractor/calculators/base_calculator.rb in attractor-2.3.0

- old
+ new

@@ -24,11 +24,13 @@ minimum_churn_count: @minimum_churn_count, start_date: @start_date, ignores: @ignores ).report(false) - churn[:churn][:changes].map do |change| + puts "Calculating churn and complexity values for #{churn[:churn][:changes].size} #{type} files" + + values = churn[:churn][:changes].map do |change| history = git_history_for_file(file_path: change[:file_path]) commit = history&.first&.first cached_value = Cache.read(file_path: change[:file_path]) @@ -43,11 +45,18 @@ details: details, history: history) Cache.write(file_path: change[:file_path], value: value) end + print "." value end + + Cache.persist! + + print "\n\n" + + values end private def git_history_for_file(file_path:, limit: 10)