preston/railroady — pull request #63 by Rudikza (2014-05-08 15:50:48+00:00)
Title: fix_default_folder_creation

Hi,

I was using your gem and I noticed that I had to manually create the doc folder or else I would receive the following error.

* Invoke diagram:all (first_time)
** Invoke diagram:models:complete (first_time)
** Execute diagram:models:complete
Generating /home/BobJones/Project/doc/models_complete.svg
railroady -ilamM | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | dot -Tsvg > /home/rudik/Projects/Battleshipz/doc/models_complete.svg
sh: 1: cannot create/home/BobJones/Project/doc/models_complete.svg: Directory nonexistent

I started poking around and I noticed that your code to handle the folder setup was not in a task. So I added new namespace called setup and a task called create_new_doc_folder_if_needed and put your existing code in to that class. I then added the create_new_doc_folder_if_needed task to the "All" task and that seemed to fix my problem.

(Apologies for the commits removing trailing white spaces, those edits were made by my OCD and I take no responsibility for them.)