def to_substituted_uri
      url = pattern
      substitutions.each_pair { |slug, value| url = url.sub(slug, value) }
      begin
        Addressable::URI.parse(url)
      rescue Addressable::URI::InvalidURIError
        SitePrism.logger.warn("Ensure you don't use templated port numbers.")
        raise SitePrism::InvalidUrlMatcherError
      end
    end
def to_substituted_uri
      url = pattern
      substitutions.each_pair { |slug, value| url = url.sub(slug, value) }
      begin
        Addressable::URI.parse(url)
      rescue Addressable::URI::InvalidURIError
        SitePrism.logger.warn("Ensure you don't use templated port numbers.")
        raise SitePrism::InvalidUrlMatcherError
      end
    end
Convert the pattern into an Addressable URI by substituting
 the template slugs with nonsense strings.