Update stdlib and concat to 6.1.0 both
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / dos2unix.rb
index ccac899..e741aa8 100644 (file)
@@ -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