GitHub PullRequestReviewCommentEvent at 2014-04-16 05:00:14
Repository: fixtures-fs
Actor: Raynos
Payload: {"comment":{"url":"https://api.github.com/repos/uber/fixtures-fs/pulls/comments/11669948","id":11669948,"diff_hunk":"@@ -0,0 +1,38 @@\n+var globalFs = require('fs');\n+var path = require('path');\n+var parallel = require('continuable-para');\n+var series = require('continuable-series');\n+var globalMkdirp = require('mkdirp');\n+var format = require('util').format;\n+\n+function createFixtures(dirname, fixtures, opts, callback) {\n+    if (typeof opts === 'function') {\n+        callback = opts;\n+        opts = {};\n+    }\n+\n+    var fs = opts.fs || globalFs;\n+    var mkdirp = opts.mkdirp || globalMkdirp;\n+    var tasks = Object.keys(fixtures).map(function (key) {\n+        var value = fixtures[key];\n+        var loc = path.join(dirname, key);\n+\n+        if (typeof value === 'string') {\n+            return fs.writeFile.bind(fs, loc, value);\n+        } else if (typeof value === 'object') {\n+            return series([\n+                fs.mkdir.bind(fs, loc),\n+                createFixtures.bind(null, loc, value, opts)\n+            ]);\n+        } else {\n+            var msg = format('value not supported %j', value);\n+            throw new Error(msg);","path":"create-fixtures.js","position":29,"original_position":29,"commit_id":"831b32dcaae4eab15a0a08401d264effea19b13c","original_commit_id":"831b32dcaae4eab15a0a08401d264effea19b13c","user":{"login":"Raynos","id":479538,"avatar_url":"https://avatars.githubusercontent.com/u/479538?","gravatar_id":"d840cb1fb7e828284011cc08f40a1015","url":"https://api.github.com/users/Raynos","html_url":"https://github.com/Raynos","followers_url":"https://api.github.com/users/Raynos/followers","following_url":"https://api.github.com/users/Raynos/following{/other_user}","gists_url":"https://api.github.com/users/Raynos/gists{/gist_id}","starred_url":"https://api.github.com/users/Raynos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raynos/subscriptions","organizations_url":"https://api.github.com/users/Raynos/orgs","repos_url":"https://api.github.com/users/Raynos/repos","events_url":"https://api.github.com/users/Raynos/events{/privacy}","received_events_url":"https://api.github.com/users/Raynos/received_events","type":"User","site_admin":false},"body":"this is an exceptional case. Its going to throw. This error cannot be recovered from.","created_at":"2014-04-16T05:00:14Z","updated_at":"2014-04-16T05:00:14Z","html_url":"https://github.com/uber/fixtures-fs/pull/1#discussion_r11669948","pull_request_url":"https://api.github.com/repos/uber/fixtures-fs/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/uber/fixtures-fs/pulls/comments/11669948"},"html":{"href":"https://github.com/uber/fixtures-fs/pull/1#discussion_r11669948"},"pull_request":{"href":"https://api.github.com/repos/uber/fixtures-fs/pulls/1"}}}}