summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/obfuscate_email.rb
blob: 4e4cb82621f6ee34b87bdb1942898df5c78b7a9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Puppet::Parser::Functions
  newfunction(:obfuscate_email, :type => :rvalue, :doc => <<-EOS
Given:
  a comma seperated email string in form of 'john@doe.com, doe@john.com'

This function will return all emails obfuscated in form of 'john {at} doe {dot} com, doe {at} john {dot} com' 
Works with multiple email adresses as well as with a single email adress.

    EOS
  ) do |args|
      args[0].gsub('@', ' {at} ').gsub('.', ' {dot} ')
    end
end

# vim: set ts=2 sw=2 et :
# encoding: utf-8