Hi Rob, Thanks for posting that, this is probably the best practical example that I've seen so far.
Trevor On Mon, Feb 1, 2016 at 9:27 PM, Rob Nelson <[email protected]> wrote: > Those three types will be the majority of what you use, sure, but Optional > and Enum are awesome. Pattern seems potent but may be difficult to use. > Check out how this module uses the type system: > https://github.com/jlambert121/jlambert121-puppet/blob/master/manifests/init.pp > > > On Monday, February 1, 2016, Trevor Vaughan <[email protected]> > wrote: > >> I'll give it a shot again (unfortunately, I have legacy 3.X users so >> updating to use 4.X features will take some time). >> >> Honestly, I still haven't found a compelling reason for anything besides >> Booleans, Undef, and Strings. Even the stdlib code converts everything to a >> string due to the issues with dealing with Strings and Numbers together. >> >> Are there any compelling cases that I'm missing out there? >> >> Happy to fork this to a different thread. >> >> Trevor >> >> On Mon, Feb 1, 2016 at 4:58 PM, Eli Young <[email protected]> wrote: >> >>> On Mon, Feb 1, 2016 at 11:48 AM, Trevor Vaughan <[email protected]> >>> wrote: >>> >>>> I would *love* to see something like this hit the core language, but >>>> there are quite a few cases where I have items that can be a Boolean, >>>> Number, or String (I'm still not loving needing to convert Numbers to >>>> Strings everywhere for consistency) so it gets difficult to use the Puppet >>>> 4 inbuilt validators. >>>> >>> >>> That's where Variants come in: >>> https://docs.puppetlabs.com/puppet/4.2/reference/lang_data_abstract.html#variant >>> >>> Variant[Boolean, Number, String] means "must be a Boolean, a Number, or >>> a String", which sounds like exactly what you want. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Puppet Developers" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/puppet-dev/CAE%2BtgeMbfHhRC76XJ%2BKz0czJsiazgfadQ%2BJ0oU3%3Di9sKtu_fGw%40mail.gmail.com >>> <https://groups.google.com/d/msgid/puppet-dev/CAE%2BtgeMbfHhRC76XJ%2BKz0czJsiazgfadQ%2BJ0oU3%3Di9sKtu_fGw%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Trevor Vaughan >> Vice President, Onyx Point, Inc >> (410) 541-6699 >> >> -- This account not approved for unencrypted proprietary information -- >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/puppet-dev/CANs%2BFoWKSv2P-yOMD1kzfPYima_KVwzbyTRt6ToaejxqyLebYA%40mail.gmail.com >> <https://groups.google.com/d/msgid/puppet-dev/CANs%2BFoWKSv2P-yOMD1kzfPYima_KVwzbyTRt6ToaejxqyLebYA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > -- > > Rob Nelson > [email protected] > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-dev/CAC76iT8n_u8FEhuvjnXFNNtaFPiY5EUTUQZkGUp%2BFZAr42kWxQ%40mail.gmail.com > <https://groups.google.com/d/msgid/puppet-dev/CAC76iT8n_u8FEhuvjnXFNNtaFPiY5EUTUQZkGUp%2BFZAr42kWxQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Trevor Vaughan Vice President, Onyx Point, Inc (410) 541-6699 -- This account not approved for unencrypted proprietary information -- -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CANs%2BFoW3tNiThV_rfnBFdsCBsNF%3DW7a9pc%3D-4ACjePS2fPA2Qw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
