Sha256: ec9cd411ae87bad23264eec5cd403ef68db55ef9cb919d2145b98cd120a3eb83

Contents?: true

Size: 526 Bytes

Versions: 2

Compression:

Stored size: 526 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)
		self.fd = ::File.open(path, "wb")
	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

2 entries across 2 versions & 1 rubygems

Version Path
librex-0.0.68 lib/rex/ui/text/output/file.rb
librex-0.0.66 lib/rex/ui/text/output/file.rb