lib/nmap/xml.rb in ruby-nmap-0.8.0 vs lib/nmap/xml.rb in ruby-nmap-0.9.0
- old
+ new
@@ -1,10 +1,12 @@
require 'nmap/scanner'
require 'nmap/scan_task'
require 'nmap/scan'
require 'nmap/host'
require 'nmap/run_stat'
+require 'nmap/prescript'
+require 'nmap/postscript'
require 'nokogiri'
module Nmap
#
@@ -235,9 +237,37 @@
#
# @since 0.1.2
#
def tasks
each_task.to_a
+ end
+
+ #
+ # The NSE scripts ran before the scan.
+ #
+ # @return [Prescript]
+ # Contains the script output and data.
+ #
+ # @since 0.9.0
+ #
+ def prescript
+ @prescript ||= if (prescript = @doc.at('prescript'))
+ Prescript.new(prescript)
+ end
+ end
+
+ #
+ # The NSE scripts ran after the scan.
+ #
+ # @return [Postscript]
+ # Contains the script output and data.
+ #
+ # @since 0.9.0
+ #
+ def postscript
+ @postscript ||= if (postscript = @doc.at('postscript'))
+ Postscript.new(postscript)
+ end
end
#
# Parses the hosts in the scan.
#