Class: R19Cov::Report::HTML

Inherits:
Object
  • Object
show all
Defined in:
lib/r19cov.rb,
lib/r19cov/report/html.rb,
lib/r19cov/report/html/page.rb,
lib/r19cov/report/html/index_page.rb,
lib/r19cov/report/html/detail_page.rb

Defined Under Namespace

Modules: Page Classes: DetailPage, IndexPage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ HTML

Returns a new instance of HTML.



11
12
13
# File 'lib/r19cov/report/html.rb', line 11

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



15
16
17
# File 'lib/r19cov/report/html.rb', line 15

def options
  @options
end

Instance Method Details

#output(coverages) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/r19cov/report/html.rb', line 21

def output(coverages)
  create_output_dir
  copy_stylesheet
  summary = R19Cov::Coverage::Summary.new(coverages)
  page = IndexPage.new(summary, options)
  page.output
  coverages.each do |coverage|
    page = DetailPage.new(coverage, options)
    page.output
  end
end

#output_dirObject



17
18
19
# File 'lib/r19cov/report/html.rb', line 17

def output_dir
  options.output_dir
end