Sha256: 2996d933f69c44e121689b62f4202e5df91ea6476df14703e7d32214a9128397

Contents?: true

Size: 564 Bytes

Versions: 41

Compression:

Stored size: 564 Bytes

Contents

require 'rex/ui'

module Rex
module Ui
module Text

###
#
# This class implements output against standard out.
#
###
class Output::Stdio < Rex::Ui::Text::Output

	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

	#
	# Prints the supplied message to standard output.
	#
	def print_raw(msg = '')
		$stdout.print(msg)
		$stdout.flush

		msg
	end
end

end
end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
librex-0.0.54 lib/rex/ui/text/output/stdio.rb
librex-0.0.53 lib/rex/ui/text/output/stdio.rb
librex-0.0.52 lib/rex/ui/text/output/stdio.rb
librex-0.0.51 lib/rex/ui/text/output/stdio.rb
librex-0.0.50 lib/rex/ui/text/output/stdio.rb
librex-0.0.49 lib/rex/ui/text/output/stdio.rb
librex-0.0.48 lib/rex/ui/text/output/stdio.rb
librex-0.0.47 lib/rex/ui/text/output/stdio.rb
librex-0.0.46 lib/rex/ui/text/output/stdio.rb
librex-0.0.44 lib/rex/ui/text/output/stdio.rb
librex-0.0.43 lib/rex/ui/text/output/stdio.rb
librex-0.0.42 lib/rex/ui/text/output/stdio.rb
librex-0.0.41 lib/rex/ui/text/output/stdio.rb
librex-0.0.40 lib/rex/ui/text/output/stdio.rb
librex-0.0.39 lib/rex/ui/text/output/stdio.rb
librex-0.0.38 lib/rex/ui/text/output/stdio.rb
librex-0.0.37 lib/rex/ui/text/output/stdio.rb
librex-0.0.36 lib/rex/ui/text/output/stdio.rb
librex-0.0.35 lib/rex/ui/text/output/stdio.rb
librex-0.0.34 lib/rex/ui/text/output/stdio.rb