Sha256: cb18219808d3198893d2e775311c30b92cf7b2d0f290acd9daf22652850acee6

Contents?: true

Size: 616 Bytes

Versions: 15

Compression:

Stored size: 616 Bytes

Contents

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

module Rex
module Ui
module Text

###
#
# This class implements input against standard in.
#
###
class Input::Stdio < Rex::Ui::Text::Input

  #
  # Reads text from standard input.
  #
  def sysread(len = 1)
    $stdin.sysread(len)
  end

  #
  # Wait for a line of input to be read from standard input.
  #
  def gets
    return $stdin.gets
  end

  #
  # Returns whether or not EOF has been reached on stdin.
  #
  def eof?
    $stdin.closed?
  end

  #
  # Returns the file descriptor associated with standard input.
  #
  def fd
    return $stdin
  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/input/stdio.rb
rex-2.0.12 lib/rex/ui/text/input/stdio.rb
rex-2.0.11 lib/rex/ui/text/input/stdio.rb
rex-2.0.10 lib/rex/ui/text/input/stdio.rb
rex-2.0.9 lib/rex/ui/text/input/stdio.rb
rex-2.0.8 lib/rex/ui/text/input/stdio.rb
rex-2.0.7 lib/rex/ui/text/input/stdio.rb
rex-2.0.5 lib/rex/ui/text/input/stdio.rb
rex-2.0.4 lib/rex/ui/text/input/stdio.rb
dstruct-0.0.1 lib/rex/ui/text/input/stdio.rb
rex-2.0.3 lib/rex/ui/text/input/stdio.rb
librex-0.0.999 lib/rex/ui/text/input/stdio.rb
rex-2.0.2 lib/rex/ui/text/input/stdio.rb
librex-0.0.71 lib/rex/ui/text/input/stdio.rb
librex-0.0.70 lib/rex/ui/text/input/stdio.rb