Class: Cuporter::TagReport

Inherits:
ReportBase show all
Defined in:
lib/cuporter/report/tag_report.rb

Instance Attribute Summary

Attributes inherited from ReportBase

#doc, #filter, #root_dir, #view

Instance Method Summary collapse

Methods inherited from ReportBase

create, #files, #initialize, #no_leaves?, #number?, #show_files?, #show_tags?, #sort?, #total?

Constructor Details

This class inherits a constructor from Cuporter::ReportBase

Instance Method Details

#buildObject



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cuporter/report/tag_report.rb', line 24

def build
  build_report_node
  report.sort_all_descendants!                             if sort?
  report.search(:tag).each {|f| f.number_all_descendants } if number?
  report.total                                             if total?
  report.move_tagless_node_to_bottom
  report.defoliate!                                        if no_leaves?
  report.remove_files!                                     unless show_files?
  report.remove_tags!                                      unless show_tags?
  self
end

#build_report_nodeObject



5
6
7
8
9
# File 'lib/cuporter/report/tag_report.rb', line 5

def build_report_node
  files.each do |file|
    FeatureParser.tag_nodes(file, report, @filter, root_dir)
  end
end

#reportObject



11
12
13
14
15
16
17
18
# File 'lib/cuporter/report/tag_report.rb', line 11

def report
  @report ||= begin
                r = Cuporter::Node.new_node(:Report, doc, :title => title, :view => view)
                doc.add_filter_summary(@filter)
                doc.add_report r
                r
              end
end

#titleObject



20
21
22
# File 'lib/cuporter/report/tag_report.rb', line 20

def title
  @title || "Cucumber Tags"
end