Sha256: 40796ae6ff47ae4ddbb2840689dd832b634a0fd67bc695dd3ebb42311ae2a97d
Contents?: true
Size: 526 Bytes
Versions: 9
Compression:
Stored size: 526 Bytes
Contents
module Katello module KatelloUrlHelper unless defined? CONSTANTS_DEFINED FILEPREFIX = 'file' PROTOCOLS = ['http', 'https', 'ftp', FILEPREFIX] CONSTANTS_DEFINED = true end def kurl_valid?(url) valid_for_prefixes(url, PROTOCOLS) end def file_prefix?(url) valid_for_prefixes(url, [FILEPREFIX]) end private def valid_for_prefixes(url, prefixes) prefixes.include?(URI.parse(url).scheme) rescue URI::InvalidURIError return false end end end
Version data entries
9 entries across 9 versions & 1 rubygems