Bartvds/gruntfile-gtx — pull request #17 by boneskull (2014-06-04 06:09:44+00:00)
Title: unleashed ultimate hax

- enabled ability to create a macro from a macro so you can macro while you macro. this involved two things:
- loop over `taskMap` in a different manner (had to move some functions out of the loop b/c of jshint)
- pass the entire `data` object into the `define()` callback itself, so you can do all sorts of wacky stuff.
- added tests

- - - - -

My use case:

- a macro which adds a single-run Karma task, with the configuration of code under test (required files, 3p library versions, etc)
- a boatload of task files spread throughout a large software suite, each corresponding to bits of subsystems or individual applications
- each task file creates a macro instance, specifies its configuration, and uses grouping heavily

What if I could easily modify my macro to create *more* tasks to instead run a `watch` on the task config's required files, then execute the tests when they change? What if I *also* wanted all of the groups I've configured to have the same ability, so I could `grunt watch` entire groups at once?

This PR lets me create a modified macro instance from my macro definition itself, configure `watch` to fire that new instance (if I happen to run `grunt watch`, of course), and do the same for all groupings of the instances.