[katello-devel] Katello Url Format Validator

Adam Price adprice at redhat.com
Fri Jul 1 19:59:14 UTC 2011


On 07/01/2011 02:54 PM, Jason Rist wrote:
> On 07/01/2011 12:15 PM, Adam Price wrote:
>> I came up with a little validator for checking URLs in the provider,
>> then decided to make it a little more generic so that other things can
>> use it as well.
>>
>> Right now the only thing using it is the Provider model, but hopefully
>> we can get it hooked up to Repositories also.
>>
>> |validates :repository_url, :katello_url_format =>  {:protocol =>
>> ["https"]}, :allow_nil =>  false, :if =>  :rh_repo?|
>>
>> The line above is what is in Provider.rb. KatelloUrlFormatValidator
>> takes an option specifying a list of protocols you want it to accept
>> ("https", "http", "ftp", "ssh", or whatever...) and it builds the
>> regular expression. The regular expression accepts port numbers,
>> subdomains, file paths after the domain, and also parameters.
>>
>> Wanted to let you know so that hopefully it will get used elsewhere.
>> Thanks.
>>
>>
>>
>> _______________________________________________
>> katello-devel mailing list
>> katello-devel at redhat.com
>> https://www.redhat.com/mailman/listinfo/katello-devel
> Adam - this is great.  Mind adding it to the fedora hosted wiki?  Very
> helpful.
>
> -J
>
Wiki page can be found here 
<https://fedorahosted.org/katello/wiki/katelloUrlFormatValidator>

Functionality is pretty small now, but I'll probably add more. Anything 
else people would like to see in it?

-- 
Adam Price

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/katello-devel/attachments/20110701/4dca22be/attachment.htm>


More information about the katello-devel mailing list