gets (sample/psql.rb)

    # File sample/psql.rb, line 113
    def gets(prompt, source)
      if source == STDIN
        if ($readline_ok)
          line = Readline.readline(prompt,source)
        else
          STDOUT.print(prompt)
          STDOUT.flush()
          line = source.gets
        end
      end

      if line == nil
          return nil
      else
        if line.length > MAX_QUERY_BUFFER
          printf(STDERR, "line read exceeds maximum length.  Truncating at %d\n",
                 MAX_QUERY_BUFFER)
          return line[0..MAX_QUERY_BUFFER-1]
        else
          return line
        end
      end
    end