lib/metric_fu/reek.rb in p8-metric_fu-0.9.0 vs lib/metric_fu/reek.rb in p8-metric_fu-0.9.0.1
- old
+ new
@@ -9,9 +9,17 @@
def analyze
files_to_reek = MetricFu.reek[:dirs_to_reek].map{|dir| Dir[File.join(dir, "**/*.rb")] }
output = `reek #{files_to_reek.join(" ")}`
@matches = output.chomp.split("\n\n").map{|m| m.split("\n") }
+ @filenames = extract_filenames(@matches.map {|m| m.first})
end
+ private
+ def extract_filenames(names)
+ names.map do |name|
+ m = name.match(/^"(.*)"/)
+ m.size == 2 ? m[1] : nil
+ end
+ end
end
end
\ No newline at end of file