source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/unix2dos.rb@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 7 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

File size: 443 bytes
Line 
1# Custom Puppet function to convert unix to dos format
2module 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.
6 EOS
7 ) do |arguments|
8
9 unless arguments[0].is_a?(String)
10 raise(Puppet::ParseError, 'unix2dos(): Requires string as argument')
11 end
12
13 arguments[0].gsub(/\r*\n/, "\r\n")
14 end
15end
Note: See TracBrowser for help on using the repository browser.