Class: Offrep::Report
- Inherits:
-
Object
- Object
- Offrep::Report
- Defined in:
- lib/offrep/report.rb
Overview
of class
Instance Attribute Summary collapse
-
#log ⇒ Object
Returns the value of attribute log.
-
#template ⇒ Object
Returns the value of attribute template.
-
#xml ⇒ Object
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize ⇒ Report
constructor
A new instance of Report.
- #output(allvulns) ⇒ Object
- #readxml(trxml) ⇒ Object
Constructor Details
#initialize ⇒ Report
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
#log ⇒ Object
Returns the value of attribute log.
18 19 20 |
# File 'lib/offrep/report.rb', line 18 def log @log end |
#template ⇒ Object
Returns the value of attribute template.
18 19 20 |
# File 'lib/offrep/report.rb', line 18 def template @template end |
#xml ⇒ Object
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 |