class Calib::Network::Util
Public Class Methods
ip_address?(str)
click to toggle source
# File lib/calib/network/util.rb, line 8 def self.ip_address?(str) self.match_ip_address(str) == 0 end
match_ip_address(str)
click to toggle source
# File lib/calib/network/util.rb, line 4 def self.match_ip_address(str) /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ =~ str end
match_url_direct_ip_address(str)
click to toggle source
# File lib/calib/network/util.rb, line 12 def self.match_url_direct_ip_address(str) /^https?\:\/\/(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/ =~ str end
url_with_direct_ip_address?(str)
click to toggle source
# File lib/calib/network/util.rb, line 16 def self.url_with_direct_ip_address?(str) self.match_url_direct_ip_address(str) == 0 end