Class: Dhalang::UrlUtils
- Inherits:
-
Object
- Object
- Dhalang::UrlUtils
- Defined in:
- lib/Dhalang/url_utils.rb
Overview
Contains common logic for URL’s.
Class Method Summary collapse
-
.validate(url) ⇒ Object
Raises an error if the given URL cannot be used for navigation with Puppeteer.
Class Method Details
.validate(url) ⇒ Object
Raises an error if the given URL cannot be used for navigation with Puppeteer.
8 9 10 11 12 |
# File 'lib/Dhalang/url_utils.rb', line 8 def self.validate(url) if (url !~ URI::DEFAULT_PARSER.regexp[:ABS_URI]) raise URI::InvalidURIError, 'The given url was invalid, use format http://www.example.com' end end |