Module: Showroom::Core::StoreUrl
- Defined in:
- lib/showroom/core/store_url.rb
Overview
Resolves a raw store identifier into a canonical HTTPS base URL.
Class Method Summary collapse
-
.resolve(store) ⇒ String
Resolves
storeto a base URL string.
Class Method Details
.resolve(store) ⇒ String
Resolves store to a base URL string.
19 20 21 22 23 24 25 26 27 |
# File 'lib/showroom/core/store_url.rb', line 19 def self.resolve(store) raise ConfigurationError, 'store must not be blank' if store.nil? || store.strip.empty? uri = parse_uri(store.strip) validate_path!(uri, store.strip) normalise(uri) rescue URI::InvalidURIError => e raise ConfigurationError, "invalid store URL: #{e.}" end |