diff options
author | varac <varacanero@zeromail.org> | 2013-08-27 18:05:12 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2013-08-27 18:05:12 +0200 |
commit | 85470dfc1e703611a84abf922634d129dd2f8f8d (patch) | |
tree | d1e444b099fd31427476156f5e9a2d6a5f8973a0 /lib/puppet/parser/functions | |
parent | 473896f2ca22f5003ea47542ad8026819d2d8613 (diff) |
added obfuscate_email.rb, including 'obfuscate_email' function
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r-- | lib/puppet/parser/functions/obfuscate_email.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/obfuscate_email.rb b/lib/puppet/parser/functions/obfuscate_email.rb new file mode 100644 index 0000000..07ccf72 --- /dev/null +++ b/lib/puppet/parser/functions/obfuscate_email.rb @@ -0,0 +1,18 @@ +module Puppet::Parser::Functions + newfunction(:obfuscate_email, :type => :rvalue, :doc => <<-EOS +Given: + an email in form of john@doe.com + +This function will return an obfuscated email in form of 'john {at} doe {dot} com' + + EOS + ) do |args| + email=args[0] + email["@"]= " {at} " + email=email.gsub(/(.*)(\.)(.*)/, '\1 {dot} \3') + email + end +end + +# vim: set ts=2 sw=2 et : +# encoding: utf-8 |