lib/irrc/connecting.rb in irrc-0.1.0 vs lib/irrc/connecting.rb in irrc-0.2.0

- old
+ new

@@ -9,31 +9,24 @@ def connection=(connection) @connection = connection end def connect - @connection ||= logger.info("Connecting to #{@host}") && - Net::Telnet.new('Host' => @host, + @connection ||= logger.info("Connecting to #{@fqdn}") && + Net::Telnet.new('Host' => @fqdn, 'Port' => 43, 'Telnetmode' => false, 'Prompt' => return_code) end def close if established? - logger.info "Closing a connection to #{@host}" + logger.info "Closing a connection to #{@fqdn}" @connection.close end end def established? @connection && !@connection.sock.closed? - end - - def execute(command) - return if command.nil? || command == '' - - logger.debug "Executing: #{command}" - @connection.cmd(command).tap {|result| logger.debug "Returned: #{result}" } end end end