Chapter 09/circuit-oneops-1-master/components/cookbooks/hadoop-yarn-v1/recipes/yarn_helper.rb
# checks if given string is a valid url
checks if given string is a valid url
checks if given string is a valid url
def isValidUrl(url)
    require 'uri'
    if url =~ /\A#{URI::regexp(['http', 'https'])}\z/
        return true
    else
        return false
    end
end
def isValidUrl ( url ) require 'uri' if url =~ / \A #{ URI :: regexp ( [ 'http' , 'https' ] ) } \z / return true else return false end end
checks if given string is a valid url
checks if given string is a valid url
# require 'faraday' # if url =~ /\A#{URI::regexp(['http', 'https'])}\z/ and Faraday.get(url).status == 200
url
<not_specific>