Class: Cloudkeeper::Utils::URL

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudkeeper/utils/url.rb

Constant Summary collapse

URL_REGEXP =
/\A#{URI.regexp(%w[http https])}\z/.freeze

Class Method Summary collapse

Class Method Details

.check!(url) ⇒ Object



6
7
8
# File 'lib/cloudkeeper/utils/url.rb', line 6

def self.check!(url)
  raise Cloudkeeper::Errors::InvalidURLError, "#{url.inspect} is not a valid URL" unless url =~ URL_REGEXP
end