Sha256: d81177be4642645bd9f233162c74a6ff4e7a07cebf057a322c52fad6e17f6a6c

Contents?: true

Size: 1.18 KB

Versions: 18

Compression:

Stored size: 1.18 KB

Contents

require 'rex/ui'

module Rex
module Ui
module Text

###
#
# This class implements text-based output but is not
# tied to an output medium.
#
###
class Output < Rex::Ui::Output

	require 'rex/ui/text/output/stdio'
	require 'rex/ui/text/output/socket'
	require 'rex/ui/text/output/buffer'
	require 'rex/ui/text/output/file'
	require 'rex/ui/text/output/tee'
	require 'rex/ui/text/color'

	include Rex::Ui::Text::Color

	def initialize
		@config = {
			:color => :auto, # true, false, :auto
		}
		super
	end
	attr_reader :config

	def disable_color
		@config[:color] = false
	end

	def enable_color
		@config[:color] = true
	end

	def auto_color
		@config[:color] = :auto
	end

	def update_prompt(prompt = nil)
		return if prompt.nil?
		substitute_colors(prompt, true)
	end

	def print_error(msg = '')
		print_line("%bld%red[-]%clr #{msg}")
	end

	def print_good(msg = '')
		print_line("%bld%grn[+]%clr #{msg}")
	end

	def print_debug(msg = '')
		print_line("%bld%cya[!]%clr #{msg}")
	end

	def print_status(msg = '')
		print_line("%bld%blu[*]%clr #{msg}")
	end

	def print_line(msg = '')
		print(msg + "\n")
	end

	def print(msg = '')
		print_raw(substitute_colors(msg))
	end

	def reset
	end

end

end
end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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