Class: TLSChecker::LineOrientedSocket

Inherits:
TCPSocket
  • Object
show all
Defined in:
lib/tls_checker/line_oriented_socket.rb

Instance Method Summary collapse

Instance Method Details

#getsObject



13
14
15
16
17
18
19
# File 'lib/tls_checker/line_oriented_socket.rb', line 13

def gets
  line = ''

  line += timed_getbyte until line.end_with?("\r\n")

  line
end

#gets_until_match(pattern) ⇒ Object



21
22
23
24
25
26
# File 'lib/tls_checker/line_oriented_socket.rb', line 21

def gets_until_match(pattern)
  loop do
    line = gets
    break if line.match(pattern)
  end
end

#puts(data) ⇒ Object



28
29
30
# File 'lib/tls_checker/line_oriented_socket.rb', line 28

def puts(data)
  send("#{data}\r\n", 0)
end