iElectric/mr.bob — pull request #66 by fgimian (2014-03-04 09:26:54+00:00)
Title: Implemented new hooks to validate URLs set a value to the target directory and run pre and post shell scripts

Hey again,

This pull requests introduces 4 new hooks! These include the ability to run shell scripts before or after rendering with all mr.bob variables passed to scripts as environment variables. You can imagine the possibilities with this sort of power :smile:

The new hooks are as follows:

* **validate_url**: Checks that a given URL is valid (based on Django's validator)
* **set_target_dir_basename**: Sets the default of a question to the base directory of the target directory
* **run_pre_script**: Runs a script before rendering
* **run_post_script**: Runs a script after rendering

I would also love to add a **validate_email** hook based on Django's code, but that involves a considerable addition due to the complexity that email addresses can have.

As per my email, the only question I have regarding this commit is a little utility function known as **\_run_script** which is used by both the pre and post script hooks. I've prefixed the utility function with an underscore to indicate it's private, but I'm not sure if this is enough to keep it out of the documentation.

Please let me know your thoughts

Cheers
Fotis