Sha256: 9ef5c4321d7f03fe4484822ea9135e335db7e33207bc7982846537a708bd3825

Contents?: true

Size: 758 Bytes

Versions: 15

Compression:

Stored size: 758 Bytes

Contents

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

module Rex
module Ui
module Text

###
#
# This class implements output against a buffer.
#
###
class Output::Buffer < Rex::Ui::Text::Output

  #
  # Initializes an output buffer.
  #
  def initialize
    self.buf = ''
  end

  def supports_color?
    false
  end

  #
  # Appends the supplied message to the output buffer.
  #
  def print_raw(msg = '')
    self.buf += msg || ''

    msg
  end


  #
  # Read everything out of the buffer and reset it
  #
  def dump_buffer
    self.buf ||= ''
    buffer = self.buf.dup
    reset()
    buffer
  end

  #
  # Reset the buffer to an empty string.
  #
  def reset
    self.buf = ''
  end

  #
  # The underlying buffer state.
  #
  attr_accessor :buf

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/buffer.rb
rex-2.0.12 lib/rex/ui/text/output/buffer.rb
rex-2.0.11 lib/rex/ui/text/output/buffer.rb
rex-2.0.10 lib/rex/ui/text/output/buffer.rb
rex-2.0.9 lib/rex/ui/text/output/buffer.rb
rex-2.0.8 lib/rex/ui/text/output/buffer.rb
rex-2.0.7 lib/rex/ui/text/output/buffer.rb
rex-2.0.5 lib/rex/ui/text/output/buffer.rb
rex-2.0.4 lib/rex/ui/text/output/buffer.rb
dstruct-0.0.1 lib/rex/ui/text/output/buffer.rb
rex-2.0.3 lib/rex/ui/text/output/buffer.rb
librex-0.0.999 lib/rex/ui/text/output/buffer.rb
rex-2.0.2 lib/rex/ui/text/output/buffer.rb
librex-0.0.71 lib/rex/ui/text/output/buffer.rb
librex-0.0.70 lib/rex/ui/text/output/buffer.rb