yatskevich/grunt-bower-task — pull request #114 by grawk (2014-04-16 16:39:19+00:00)
Title: increase flexibility in custom layout function

By passing in the full "source" path of the file.

For my use case, I need to have more flexibility around which directory I move certain files to. To get specific for my use case, I expect bower components which (for component named mattc):
* expect single directory with all templates: mattc/templates/*.dust
* expect one or more locale based directory endpoint mattc/locales/{CC}/{lc}/*.properties where CC=country * code and lc=language code
* copy mattc/templates/*.dust -> public/templates/components/mattc/*.dust
* copy mattc/locales/{CC}/{lc}/*.properties -> locales/{CC}/{lc}/mattc/*.properties

To achieve this, the layout function almost could do it, but just needed the full component path of the file to complete the journey. E.g.

```javascript
layout: function(type, component, src) {
var loc, newpath;
console.log("type, component, src ::: ", type, component, src);
if (type === "properties") {
//what is the {CC}/{lc} ?
loc = src.match(/[A-Z]{2}\/[a-z]{2}/g);
newpath = "../locales/" + loc + "/" + component + "/";
} else if (type === "dust") {
newpath = "../public/templates/components/" + component + "/";
}
return path.join(newpath);
},
```