#better_file
####Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Usage - Using the better_file function
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
##Overview
A better_file function which slurps files from full paths or puppet:/// uris
##Module Description
The puppet builtin file() function is severely limited as it will only operate on fully qualitied paths.
This function fixes (or at least hacks around) that limitation for the common cases.
##Usage
###With a full path name
better_file('/a/full/path')
Works exactly like the built in file() function
###With a module uri
better_file('puppet:///modules/my_module/myfile')
Will resolve 'my_module' to a path on disk in the current environment, and will look inside the files/ subdirectory for that module
For example if your modules are in /etc/puppet/modules, then the above will try to find the file in /etc/puppet/modules/files/myfile
better_file('puppet:///files/myfile')
This will assume that your files are located under the $confdir/files (e.g. /etc/puppet/files)
##Limitations
Unless your fileserver is configured to serve the 'files' repository from $confdir/files then puppet:///files/ uris will not work.
Custom fileserver modules are unsupported.
##Development
Patches are welcome!
Please open a pull request on github :)