Class: Cuporter::Formatter::NameReport::Html

Inherits:
Writer
  • Object
show all
Includes:
HtmlMethods
Defined in:
lib/cuporter/formatter/name_report/html.rb

Instance Attribute Summary

Attributes inherited from Writer

#number_scenarios

Instance Method Summary collapse

Methods included from HtmlMethods

#body, #document, #head, #html, #inline_file, #inline_jquery, #inline_js_content, #label, #write, #write_report_node

Methods inherited from Writer

create, #initialize, writer_class

Constructor Details

This class inherits a constructor from Cuporter::Formatter::Writer

Instance Method Details

#filter_summary(builder) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/cuporter/formatter/name_report/html.rb', line 30

def filter_summary(builder)
  return if @report.filter.empty?
  builder.div(:id => :filter_summary) do |div|
    div.p("Filtering:")
    div.p("Include: #{@report.filter.all.join(' AND ')}") unless @report.filter.all.empty?
    div.p("Include: #{@report.filter.any.join(' OR ')}") unless @report.filter.any.empty?
    div.p("Exclude: #{@report.filter.none.join(', ')}") unless @report.filter.none.empty?
  end
end

#header(body) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/cuporter/formatter/name_report/html.rb', line 16

def header(body)
  body.div(:class => :cuporter_header) do |header|
    label(header)
    filter_summary(header)
    header.div(:id => :summary) do |div|
      div.p("#{@report.report_node.total} Scenarios", :id => :total)
      div.div(:id => "expand-collapse") do |exp_col|
        exp_col.p("Expand All", :id => :expand_features)
        exp_col.p("Collapse All", :id => :collapse_features)
      end
    end
  end
end

#inline_styleObject



40
41
42
# File 'lib/cuporter/formatter/name_report/html.rb', line 40

def inline_style
  "name_report/style.css"
end

#report_node_writerObject



8
9
10
# File 'lib/cuporter/formatter/name_report/html.rb', line 8

def report_node_writer
  Cuporter::Formatter::NameReport::HtmlNodeWriter
end

#titleObject



12
13
14
# File 'lib/cuporter/formatter/name_report/html.rb', line 12

def title
  @report.title
end