class ChefCLI::Policyfile::SourceURI
def parse(uri)
-
(ChefCLI::Policyfile::SourceURI)
-
Raises:
-
(ChefCLI::InvalidPolicyfileSourceURI)
-
Parameters:
-
uri
(String, Addressable::URI, #to_str
) -- The URI
def parse(uri) parsed_uri = super(uri) parsed_uri.send(:validate) parsed_uri rescue TypeError, ArgumentError => ex raise ChefCLI::InvalidPolicyfileSourceURI.new(uri, ex) end
def validate
-
(ChefCLI::InvalidPolicyfileSourceURI)
-
def validate super unless VALID_SCHEMES.include?(scheme) raise InvalidPolicyfileSourceURI.new(self, "invalid URI scheme '#{scheme}'. Valid schemes: #{VALID_SCHEMES}") end rescue Addressable::URI::InvalidURIError => ex raise InvalidPolicyfileSourceURI.new(self, ex) end