1 # Custom Puppet function to convert unix to dos format
2 module Puppet::Parser::Functions
3 newfunction(:unix2dos, :type => :rvalue, :arity => 1, :doc => <<-EOS
4 Returns the DOS version of the given string.
5 Takes a single string argument.
9 unless arguments[0].is_a?(String)
10 raise(Puppet::ParseError, 'unix2dos(): Requires string as argument')
13 arguments[0].gsub(/\r*\n/, "\r\n")