class Rex::Ui::Text::Output::Tee
This class implements output against a file and stdout
Attributes
fd[RW]
Public Class Methods
new(path)
click to toggle source
Calls superclass method
Rex::Ui::Text::Output::new
# File lib/rex/ui/text/output/tee.rb, line 16 def initialize(path) self.fd = ::File.open(path, "ab") super() end
Public Instance Methods
close()
click to toggle source
# File lib/rex/ui/text/output/tee.rb, line 48 def close self.fd.close if self.fd self.fd = nil end
print_raw(msg = '')
click to toggle source
Prints the supplied message to file output.
# File lib/rex/ui/text/output/tee.rb, line 36 def print_raw(msg = '') $stdout.print(msg) $stdout.flush return if not self.fd self.fd.write(msg) self.fd.flush msg end
Also aliased as: write
supports_color?()
click to toggle source
# File lib/rex/ui/text/output/tee.rb, line 21 def supports_color? case config[:color] when true return true when false return false else # auto term = Rex::Compat.getenv('TERM') return (term and term.match(/(?:vt10[03]|xterm(?:-color)?|linux|screen|rxvt)/i) != nil) end end