Add colour support and log functions.

The colouring is nice for people with shells that support it and will
give them a better idea of which messages they should pay attention to
and which are more meant as informative.

The log functions additionally add a 'loglevel' indicating the severity
of the message and the timestamp when this message was logged. The time
isn't strictly necessary but it's a common thing to do when logging
messages and will give people a sense of the elapsed time, if any.
Merge pull request #1 from daenney/color-logging

Add colour support and log functions.
Fix tempfile behaviour.

1. Move setting TMPDIR to earlier in the script;
2. Introduce the random function;
3. Replace /tmp/stderr by a 'true' tempfile;
4. Use the random function in generating the tmpdir too;
5. Trap a few signals so that the script cleans up after itself.
Merge branch 'master' of https://github.com/ahpook/puppet-install-shell into ahpook-master
Improve command line options
Merge pull request #2 from daenney/tempfile

Fix tempfile behaviour.
Give more details on the bug report message
Merge pull request #4 from petems/improve_opts

Improve command line options
Fix spelling
Extremely simple bats tests added
I'm pretty new to bats, so I'm not sure how to do more complex matching
and helper setup. This'll do for now...
Merge pull request #5 from petems/add_bats_specs

Add bats specs
Add Travis badge
Get bats install working...
Fix Bats tests...
Currently they will only work in Travis
Ubuntu version now working
Add start of Mac support, DRY up downloads

- Mac packages come from downloads.puppetlabs.com
- Use interpolation for $filename instead
  of repeating it in each variation
- Fix a gap in logic: if both a commandline name
  and a download directory were specified, previously
  the name would be ignored. Now it's two separate
  conditionals.
Fix writing stderr files for error checking

The routines which seached through the stderr
of the download commands for problems used the
`$tmp_stderr` variable, but the download programs
themselves wrote to /tmp/stderr, so the errors
were not found.
More complete Mac OS X support

This adds installation for Macs via dmg, which
are actually a pkg-inside-dmg and therefore require
mounting, then installation.

There's more to be done; specifically this -only-
installs Puppet and therefore does not leave you
with a working setup -- facter and hiera are
separate downloads and there's no automatic dependency
resolution in Apple-land.