X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fdos2unix.rb;h=e741aa8ddfc91737bb16983969326119fe1218fa;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=ccac899333ffe9f69dffc1d30b85b049e33ea9df;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/dos2unix.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/dos2unix.rb index ccac89933..e741aa8dd 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/dos2unix.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/dos2unix.rb @@ -1,15 +1,19 @@ # Custom Puppet function to convert dos to unix format module Puppet::Parser::Functions - newfunction(:dos2unix, :type => :rvalue, :arity => 1, :doc => <<-EOS - Returns the Unix version of the given string. + newfunction(:dos2unix, :type => :rvalue, :arity => 1, :doc => <<-DOC + @summary + Returns the Unix version of the given string. + Takes a single string argument. - EOS - ) do |arguments| + + @return The retrieved version + DOC + ) do |arguments| unless arguments[0].is_a?(String) raise(Puppet::ParseError, 'dos2unix(): Requires string as argument') end - arguments[0].gsub(/\r\n/, "\n") + arguments[0].gsub(%r{\r\n}, "\n") end end