Sha256: cc943834828a5713cdd4d4a368b8e9657bbfd5392230a692e449b89380472e67

Contents?: true

Size: 565 Bytes

Versions: 3

Compression:

Stored size: 565 Bytes

Contents

# -*- coding: binary -*-
require 'rex/ui'

module Rex
module Ui
module Text

###
#
# This class implements output against a file
#
###
class Output::File < Rex::Ui::Text::Output

  attr_accessor :fd

  def initialize(path, mode='wb')
    self.fd = ::File.open(path, mode)
  end

  def supports_color?
    false
  end

  #
  # Prints the supplied message to file output.
  #
  def print_raw(msg = '')
    return if not self.fd
    self.fd.write(msg)
    self.fd.flush
    msg
  end

  def close
    self.fd.close if self.fd
    self.fd = nil
  end
end

end
end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rex-2.0.8 lib/rex/ui/text/output/file.rb
rex-2.0.7 lib/rex/ui/text/output/file.rb
rex-2.0.5 lib/rex/ui/text/output/file.rb