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