lib/fukuzatsu/formatters/json.rb in fukuzatsu-2.1.1 vs lib/fukuzatsu/formatters/json.rb in fukuzatsu-2.2.1
- old
+ new
@@ -4,12 +4,12 @@
class Json
include Formatters::Base
- def self.index(summaries)
- Fukuzatsu::Formatters::JsonIndex.new(summaries).export
+ def self.index(summaries, base_output_path)
+ Fukuzatsu::Formatters::JsonIndex.new(summaries, base_output_path).export
end
def as_json
result = {
source_file: summary.source_file,
@@ -17,10 +17,10 @@
name: summary.entity_name,
complexity: summary.complexity
}
if summary.is_class_or_module?
result[:average_complexity] = summary.average_complexity
- result[:methods] = summary.summaries.map { |s| Json.new(summary: s).as_json }
+ result[:methods] = summary.summaries.map { |s| Json.new(summary: s, base_output_path: self.base_output_path).as_json }
end
result
end
def content
\ No newline at end of file