gruntjs/grunt-contrib-imagemin — pull request #150 by maboiteaspam (2014-02-09 09:21:05+00:00)
Title: Progressbar event driven demo

Hello,

I made a demo of my previous suggestions in https://github.com/gruntjs/grunt-contrib-imagemin/pull/149,
it seems to works fine.

The footprint on your source is really small, i don't think it could be better, progress is not anymore a depedency of your package.
The task changes consist of three new lines such,
```
grunt.event.emit("grunt_contribimgmin_init", self.files.length);
...
grunt.event.emit("grunt_contribimgmin_item_done", self.files.length, file, err, data);
...
grunt.event.emit("grunt_contribimgmin_job_done", self.files.length, err);
```

I have put a working example thru ```grunt imgmin_task```.
It consists of two surrounding tasks to
- declare the logger
- install/remove events
- mutte/unmute grunt when it is usefull.

Could be used to provide other kinds of output where needed.

This PR is not intended to be pulled, it is just to have decent diff view and demonstrate the idea.

Let me know.