{"action":"created","issue":{"url":"https://api.github.com/repos/yeoman/grunt-filerev/issues/47","labels_url":"https://api.github.com/repos/yeoman/grunt-filerev/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/yeoman/grunt-filerev/issues/47/comments","events_url":"https://api.github.com/repos/yeoman/grunt-filerev/issues/47/events","html_url":"https://github.com/yeoman/grunt-filerev/pull/47","id":42758873,"number":47,"title":"Add support and test for output filename template.","user":{"login":"murphybob","id":1550045,"avatar_url":"https://avatars.githubusercontent.com/u/1550045?v=3","gravatar_id":"","url":"https://api.github.com/users/murphybob","html_url":"https://github.com/murphybob","followers_url":"https://api.github.com/users/murphybob/followers","following_url":"https://api.github.com/users/murphybob/following{/other_user}","gists_url":"https://api.github.com/users/murphybob/gists{/gist_id}","starred_url":"https://api.github.com/users/murphybob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murphybob/subscriptions","organizations_url":"https://api.github.com/users/murphybob/orgs","repos_url":"https://api.github.com/users/murphybob/repos","events_url":"https://api.github.com/users/murphybob/events{/privacy}","received_events_url":"https://api.github.com/users/murphybob/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-09-15T10:29:21Z","updated_at":"2015-02-06T15:23:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/yeoman/grunt-filerev/pulls/47","html_url":"https://github.com/yeoman/grunt-filerev/pull/47","diff_url":"https://github.com/yeoman/grunt-filerev/pull/47.diff","patch_url":"https://github.com/yeoman/grunt-filerev/pull/47.patch"},"body":"I found that grunt-filerev seemed to be the best plugin to add a hash to my production files, but I found the naming scheme too restrictive. We already used a filename-hash.js format, and other components in the pipeline rely on that which would be significant effort to update.\r\n\r\nTo that end, I've added support for using a mustache template to generate the output filename. Original filename, hash and original extension are made available to the template - though I can imagine other useful information that could be made available in future (e.g. current date or time).\r\n\r\nOne curio - the unit tests don't pass on my local build for 2 reasons:\r\n1. They are never run, no tasks following filerev seem to get run. It seems @dannymarshland had a similar issue in his fork and fixed it with this commit https://github.com/dannymarsland/grunt-filerev/commit/bc5ccfa751f78218292ee0909b497f8c8c15cd85\r\n2. The file hashes are different on my machine to those listed in the tests, e.g. where the test expects a0539763 I get d01d8f48. I can only assume this is some odd system dependency (I'm on win32 here). I've used the original expected hashes in my test which should work. Just thought I'd point this one out.\r\n\r\nNote: this replaces https://github.com/yeoman/grunt-filerev/pull/45"},"comment":{"url":"https://api.github.com/repos/yeoman/grunt-filerev/issues/comments/73252814","html_url":"https://github.com/yeoman/grunt-filerev/pull/47#issuecomment-73252814","issue_url":"https://api.github.com/repos/yeoman/grunt-filerev/issues/47","id":73252814,"user":{"login":"kevva","id":709159,"avatar_url":"https://avatars.githubusercontent.com/u/709159?v=3","gravatar_id":"","url":"https://api.github.com/users/kevva","html_url":"https://github.com/kevva","followers_url":"https://api.github.com/users/kevva/followers","following_url":"https://api.github.com/users/kevva/following{/other_user}","gists_url":"https://api.github.com/users/kevva/gists{/gist_id}","starred_url":"https://api.github.com/users/kevva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevva/subscriptions","organizations_url":"https://api.github.com/users/kevva/orgs","repos_url":"https://api.github.com/users/kevva/repos","events_url":"https://api.github.com/users/kevva/events{/privacy}","received_events_url":"https://api.github.com/users/kevva/received_events","type":"User","site_admin":false},"created_at":"2015-02-06T15:23:55Z","updated_at":"2015-02-06T15:23:55Z","body":"Just `git rebase -i HEAD~5` and change `pick` to `f` on all commits except the first."}}