On Sep 23, 2009, at 10:33 AM, Markus Roberts wrote:

> Huh?
>
> It looks to me like all that was needed was to add the _ back in to  
> the character class.  Special casing regexp is a bad idea because it  
> means we now have distinct (and thus potentially different)  
> allowable character rule.
>
> Also, I see that the A-Z got retained; it's clutter since the string  
> is being downcased right before that.
>
> I'd suggest:
>
>         def to_classname
> -            to_s.downcase.gsub(/[^-a-zA-Z0-9:.]/,'').sub(/^\.+/,'')
> +           to_s.downcase.gsub(/[^-a-z_0-9:.]/,'').sub(/^\.+/,'')
>         end

That looks right, although more like:

   /[^-\w:.]/

-- 
It is a mistake to think you can solve any major problems just with
potatoes. --Douglas Adams
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to