lib/netsoul/client.rb in netsoul-2.4.5 vs lib/netsoul/client.rb in netsoul-2.5.0
- old
+ new
@@ -15,22 +15,22 @@
@started = false
end
def auth_ag
send(Message.auth_ag)
- raise Netsoul::IdentificationError, 'Identification failed.'.freeze unless get.split(' '.freeze)[1] == '002'.freeze
+ raise Netsoul::IdentificationError, 'Identification failed.' unless get.split(' ')[1] == '002'
end
private :auth_ag
def auth_method
if @config.auth_method == :krb5
send(Message.kerberos_auth(@config))
else
send(Message.standard_auth(@config))
end
- raise Netsoul::AuthenticationError, 'Authentication failed. See your config file or environment variables'.freeze \
- unless get.split(' '.freeze)[1] == '002'.freeze
+ raise Netsoul::AuthenticationError, 'Authentication failed. See your config file or environment variables' \
+ unless get.split(' ')[1] == '002'
end
private :auth_method
def auth_status
send(Message.attach)
@@ -38,11 +38,11 @@
end
private :auth_status
def connect
@socket = TCPSocket.new(@config.server_host, @config.server_port)
- raise Netsoul::SocketError, 'Could not open a socket. Connection is unavailable.'.freeze unless @socket
+ raise Netsoul::SocketError, 'Could not open a socket. Connection is unavailable.' unless @socket
_cmd, _socket_num, md5_hash, client_ip, client_port, _server_timestamp = get.split
@config.build_user_connection_info md5_hash: md5_hash, client_ip: client_ip, client_port: client_port
auth_ag
@@ -60,23 +60,23 @@
end
def send(str)
_, sock = IO.select(nil, [@socket], nil, SOCKET_WRITE_TIMEOUT)
s = sock.first
- raise Netsoul::SocketError, 'Timeout or raise on write socket'.freeze unless s
+ raise Netsoul::SocketError, 'Timeout or raise on write socket' unless s
s.puts str
s.flush
end
def get
sock, = IO.select([@socket], nil, nil, SOCKET_READ_TIMEOUT)
s = sock.first
- raise Netsoul::SocketError, 'Timeout or raise on read socket'.freeze unless s
+ raise Netsoul::SocketError, 'Timeout or raise on read socket' unless s
res = s.gets.chomp
if !res.empty?
res
else
- 'nothing'.freeze # Send some string and permit IO.select to thrown exception if something goes wrong.
+ 'nothing' # Send some string and permit IO.select to thrown exception if something goes wrong.
end
end
private