Our own Gary Larizza wrote another installment in his occasional series on types and providers. This time, he shows how to write a type and provider using Ruby, all in the spirit of making your Puppet code better:
I was working with a group who wanted to set a list of domains that would bypass their web proxy for a specific network interface on an OS X workstation. It sounds so simple, because it was. Due to the amount of time I had on-site, I wrote a class with some nasty exec statements, a couple of facts, and some conditional logic because that’s what you do when you’re in a hurry ... but it doesn’t make it right. When I left, I hacked up a type and provider, and it’s a GREAT example because you probably have a similar problem.
As with all his posts, plenty of code samples and some content that may be NSFW, if a little profanity about Puppet types and providers doesn't fly in your particular office.