Use /usr/bin/env to support non standard ruby locations

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Official copyright and License format (GNU)

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Merge remote-tracking branch 'jaalto/shebang'

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Merge pull request #1 from jaalto/license

Official copyright and License format (GNU)
Whitespace cleanup
Refactor duplicated code creating files
Refactor duplicated code determining filename
Handle patches with Index lines
fullname option to avoid duplicate output files

In larger projects it is likely there are many directories containing
common files (Makefiles, etc). The new fullname option uses the full
path of the patch to name the output file to avoid many similarly named
output patches.
Merge pull request #3 from doctaweeks/master

Refactoring common code and handling patches with Index lines
Add zero padding to filename suffix in splitByFile()

Patch thanks to Alexandr Agranovsky <alesso@alesso.ru>