Thomas Bellman
2008-12-18 18:47:56 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have written a couple of custom functions that I think would be
nice for more people if they were included in standard Puppet.
They are:
* regsubst() Perform regexp matching and substitution on a string.
Basically a wrapper around the method String.sub() in
Ruby.
* sprintf() Perform printf-style formatting of text.
For a real-life use-case, see the short thread in
http://groups.google.com/group/puppet-users/browse_thread/thread/3cfc79469caafbac?hl=en
which was my actual motivation for writing the regsubst()
function in the first place.
(I realize that the inline_template() function in 0.24.7 *can* be
used for this, but it would be quite a lot less convenient than
having them as built-in functions.)
They could probably do with some criticism from more experienced
Puppet coders, and I definitely need help writing proper markup
for the docstrings. Anyway, I'm posting them as followups to
this message.
/Thomas Bellman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAklKmtwACgkQDGpP8Cv3aqIrOwCfZ8TIkMxLlBheJZ80qvaPYP9q
F88An1J+BfFRYaS8ERF+HsRUF1oIE5NE
=iA6c
-----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-***@googlegroups.com
To unsubscribe from this group, send email to puppet-dev+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---
Hash: SHA1
I have written a couple of custom functions that I think would be
nice for more people if they were included in standard Puppet.
They are:
* regsubst() Perform regexp matching and substitution on a string.
Basically a wrapper around the method String.sub() in
Ruby.
* sprintf() Perform printf-style formatting of text.
For a real-life use-case, see the short thread in
http://groups.google.com/group/puppet-users/browse_thread/thread/3cfc79469caafbac?hl=en
which was my actual motivation for writing the regsubst()
function in the first place.
(I realize that the inline_template() function in 0.24.7 *can* be
used for this, but it would be quite a lot less convenient than
having them as built-in functions.)
They could probably do with some criticism from more experienced
Puppet coders, and I definitely need help writing proper markup
for the docstrings. Anyway, I'm posting them as followups to
this message.
/Thomas Bellman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAklKmtwACgkQDGpP8Cv3aqIrOwCfZ8TIkMxLlBheJZ80qvaPYP9q
F88An1J+BfFRYaS8ERF+HsRUF1oIE5NE
=iA6c
-----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-***@googlegroups.com
To unsubscribe from this group, send email to puppet-dev+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---