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 46
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.

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