lib/netchk/ip_verifier.rb in netchk-0.0.1.beta vs lib/netchk/ip_verifier.rb in netchk-0.0.1

- old
+ new

@@ -4,15 +4,15 @@ module Netchk class IpVerifier def verify socket = Socket.ip_address_list addresses = socket.reject(&:ipv4_loopback?) - .reject(&:ipv6_loopback?) - .filter(&:ipv4?) - .map(&:inspect_sockaddr) + addresses.reject!(&:ipv6_loopback?) + addresses.filter!(&:ipv4?) + addresses.map!(&:inspect_sockaddr) if addresses.empty? - $stderr.puts "No IPv4 address found. Verify your connection to your router." + $stderr.puts 'No IPv4 address found. Verify your connection to your router.' else puts "Found IP addresses #{addresses.join(', ')}." end end end