Class: Offrep::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/offrep/report.rb

Overview

of class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReport

Returns a new instance of Report.



20
21
22
23
24
25
# File 'lib/offrep/report.rb', line 20

def initialize
  @log = Logger.new
  @template="<% @vulns.each do |v| %>\n"+
            "<%= lineitem=v['pid']+';'+v['title']+';'+v['hosts'] %>"+
     "<% end %>"
end

Instance Attribute Details

#logObject

Returns the value of attribute log.



18
19
20
# File 'lib/offrep/report.rb', line 18

def log
  @log
end

#templateObject

Returns the value of attribute template.



18
19
20
# File 'lib/offrep/report.rb', line 18

def template
  @template
end

#xmlObject

Returns the value of attribute xml.



18
19
20
# File 'lib/offrep/report.rb', line 18

def xml
  @xml
end

Instance Method Details

#output(allvulns) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/offrep/report.rb', line 27

def output (allvulns)
  rhtml = ERB.new(@template)
  # Set up template data.
  gvuln = Reportvuln.new( allvulns )
  # vulns=allvulns
  # rhtml.result
  rhtml.run(gvuln.get_binding)
end

#readxml(trxml) ⇒ Object



36
37
38
39
40
# File 'lib/offrep/report.rb', line 36

def readxml(trxml)
  f=File.open(fn)
  @xml=Nokogiri::XML(trxml)
  f.close
end