> +    def self.title_patterns
> +      [
> +        # we have two title_patterns "name" and "name:protocol". We won't
> use
> +        # one pattern (that will eventually set :protocol to nil) because
> we
> +        # want to use a default value for :protocol. And that does only
> work
> +        # if :protocol is not put in the parameter hash while initialising
> +        [
> +          /^(.*?)\/(tcp|udp)$/, # Set name and protocol
> +          [
> +            # We don't need a lot of post-parsing
> +            [ :name, lambda{|x| x} ],
> +            [ :protocol, lambda{ |x| x.intern unless x.nil? } ]
> +          ]
> +        ],
>

Two thoughts here:

1) The "?" in the regular expression is unneeded, since it's anchored by the
"^", "\/", and "$"
2) The "unless x.nil?" in unneeded, since x can't be nil.

-- M
-----------------------------------------------------------
When in trouble or in doubt, run in circles,
scream and shout. -- 1920's parody of the
maritime general prudential rule
------------------------------------------------------------

-- 
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