Sha256: bdee2c97fd3500c68827cbee4ffb0b52d947fb2571240b41fe40af80e8ca279c

Contents?: true

Size: 567 Bytes

Versions: 15

Compression:

Stored size: 567 Bytes

Contents

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

module Rex
module Ui
module Text

###
#
# This class implements the output interface against a socket.
#
###
class Output::Socket < Rex::Ui::Text::Output

  def initialize(sock)
    @sock = sock
    super()
  end

  def supports_color?
    case config[:color]
    when true
      # Allow color if the user forces it on
      return true
    else
      false
    end
  end

  #
  # Prints the supplied message to the socket.
  #
  def print_raw(msg = '')
    @sock.write(msg)
    @sock.flush

    msg
  end
end

end
end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
rex-2.0.13 lib/rex/ui/text/output/socket.rb
rex-2.0.12 lib/rex/ui/text/output/socket.rb
rex-2.0.11 lib/rex/ui/text/output/socket.rb
rex-2.0.10 lib/rex/ui/text/output/socket.rb
rex-2.0.9 lib/rex/ui/text/output/socket.rb
rex-2.0.8 lib/rex/ui/text/output/socket.rb
rex-2.0.7 lib/rex/ui/text/output/socket.rb
rex-2.0.5 lib/rex/ui/text/output/socket.rb
rex-2.0.4 lib/rex/ui/text/output/socket.rb
dstruct-0.0.1 lib/rex/ui/text/output/socket.rb
rex-2.0.3 lib/rex/ui/text/output/socket.rb
librex-0.0.999 lib/rex/ui/text/output/socket.rb
rex-2.0.2 lib/rex/ui/text/output/socket.rb
librex-0.0.71 lib/rex/ui/text/output/socket.rb
librex-0.0.70 lib/rex/ui/text/output/socket.rb