{"action":"created","comment":{"url":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/comments/60182575","id":60182575,"diff_hunk":"@@ -1,35 +1,37 @@\n 'use strict';\n \n var q = require('q'),\n-    temp = require('temp'),\n+    tempFS = require('../temp-fs'),\n \n     BaseError = require('./base-error'),\n     ImageError = require('./image-error'),\n     imageProcessor = require('../image-processor');\n \n-temp.track();\n-\n-exports.buildError = function(data, geminiConfig, options) {\n-    if (!data.image && !data.saveDiffTo) {\n+exports.buildError = function (data, geminiConfig, options) {\n+    if (!data.imagePath && !data.saveDiffTo) {\n         return q(new BaseError(data, geminiConfig));\n     }\n \n-    var tempDir = temp.mkdirSync('gemini-fails'),\n-        imagePath = temp.path({dir: tempDir, suffix: '.png'}),\n-        saveImg = data.image\n-            ? data.image.save.bind(data.image)\n-            : data.saveDiffTo.bind(data);\n+    return saveFailedData(data)\n+        .then(function (imagePath) {\n+            var convertPngImage = options.light ?\n+                q() :\n+                imageProcessor.pngToBase64(imagePath);\n \n-    return saveImg(imagePath)\n-        .then(function() {\n-            if (!options.light) {\n-                return imageProcessor.pngToBase64(imagePath);\n-            }\n-        })\n-        .then(function(base64) {\n-            return new ImageError(data, geminiConfig, {\n-                path: imagePath,\n-                base64: base64\n+            return convertPngImage.then(function (base64) {\n+                return new ImageError(data, geminiConfig, {\n+                    path: imagePath,\n+                    base64: base64\n+                });\n             });\n         });\n };\n+\n+function saveFailedData(data) {\n+    if (data.imagePath) {\n+        return q(data.imagePath);\n+    }\n+\n+    var imagePath = tempFS.resolveImagePath();\n+    return data.saveDiffTo(imagePath).thenResolve(imagePath);","path":"lib/errors/error-factory.js","position":56,"original_position":56,"commit_id":"ba345209c9e7e1aed1f0cd465d5b78635b432412","original_commit_id":"cadd82529e777d9c8e366afdd4ba7c2cf464dcd3","user":{"login":"j0tunn","id":7701229,"avatar_url":"https://avatars.githubusercontent.com/u/7701229?v=3","gravatar_id":"","url":"https://api.github.com/users/j0tunn","html_url":"https://github.com/j0tunn","followers_url":"https://api.github.com/users/j0tunn/followers","following_url":"https://api.github.com/users/j0tunn/following{/other_user}","gists_url":"https://api.github.com/users/j0tunn/gists{/gist_id}","starred_url":"https://api.github.com/users/j0tunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j0tunn/subscriptions","organizations_url":"https://api.github.com/users/j0tunn/orgs","repos_url":"https://api.github.com/users/j0tunn/repos","events_url":"https://api.github.com/users/j0tunn/events{/privacy}","received_events_url":"https://api.github.com/users/j0tunn/received_events","type":"User","site_admin":false},"body":"да нафига? здесь поправить - две строчки, все равно этот код правится","created_at":"2016-04-19T07:15:46Z","updated_at":"2016-04-19T07:15:46Z","html_url":"https://github.com/gemini-testing/gemini-faildump/pull/6#discussion_r60182575","pull_request_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/comments/60182575"},"html":{"href":"https://github.com/gemini-testing/gemini-faildump/pull/6#discussion_r60182575"},"pull_request":{"href":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/6","id":66637203,"html_url":"https://github.com/gemini-testing/gemini-faildump/pull/6","diff_url":"https://github.com/gemini-testing/gemini-faildump/pull/6.diff","patch_url":"https://github.com/gemini-testing/gemini-faildump/pull/6.patch","issue_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/issues/6","number":6,"state":"open","locked":false,"title":"Add supporting of imagePath instead of image field in fail data","user":{"login":"tormozz48","id":996162,"avatar_url":"https://avatars.githubusercontent.com/u/996162?v=3","gravatar_id":"","url":"https://api.github.com/users/tormozz48","html_url":"https://github.com/tormozz48","followers_url":"https://api.github.com/users/tormozz48/followers","following_url":"https://api.github.com/users/tormozz48/following{/other_user}","gists_url":"https://api.github.com/users/tormozz48/gists{/gist_id}","starred_url":"https://api.github.com/users/tormozz48/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tormozz48/subscriptions","organizations_url":"https://api.github.com/users/tormozz48/orgs","repos_url":"https://api.github.com/users/tormozz48/repos","events_url":"https://api.github.com/users/tormozz48/events{/privacy}","received_events_url":"https://api.github.com/users/tormozz48/received_events","type":"User","site_admin":false},"body":"@j0tunn @sipayRT \r\n\r\nImplement support of  `imagePath` field instead of `image` field in fail data to reach compatibility with gemini v4.x","created_at":"2016-04-15T12:51:13Z","updated_at":"2016-04-19T07:15:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1485ab1b64fa5baa88a1705f6f0d95706ecc3fec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/6/commits","review_comments_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/6/comments","review_comment_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/issues/6/comments","statuses_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/statuses/ba345209c9e7e1aed1f0cd465d5b78635b432412","head":{"label":"gemini-testing:gemini4.x/compatibility","ref":"gemini4.x/compatibility","sha":"ba345209c9e7e1aed1f0cd465d5b78635b432412","user":{"login":"gemini-testing","id":11424134,"avatar_url":"https://avatars.githubusercontent.com/u/11424134?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-testing","html_url":"https://github.com/gemini-testing","followers_url":"https://api.github.com/users/gemini-testing/followers","following_url":"https://api.github.com/users/gemini-testing/following{/other_user}","gists_url":"https://api.github.com/users/gemini-testing/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-testing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-testing/subscriptions","organizations_url":"https://api.github.com/users/gemini-testing/orgs","repos_url":"https://api.github.com/users/gemini-testing/repos","events_url":"https://api.github.com/users/gemini-testing/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-testing/received_events","type":"Organization","site_admin":false},"repo":{"id":50348300,"name":"gemini-faildump","full_name":"gemini-testing/gemini-faildump","owner":{"login":"gemini-testing","id":11424134,"avatar_url":"https://avatars.githubusercontent.com/u/11424134?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-testing","html_url":"https://github.com/gemini-testing","followers_url":"https://api.github.com/users/gemini-testing/followers","following_url":"https://api.github.com/users/gemini-testing/following{/other_user}","gists_url":"https://api.github.com/users/gemini-testing/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-testing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-testing/subscriptions","organizations_url":"https://api.github.com/users/gemini-testing/orgs","repos_url":"https://api.github.com/users/gemini-testing/repos","events_url":"https://api.github.com/users/gemini-testing/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-testing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gemini-testing/gemini-faildump","description":"Plugin to collect information about test fails.","fork":false,"url":"https://api.github.com/repos/gemini-testing/gemini-faildump","forks_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/forks","keys_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/teams","hooks_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/hooks","issue_events_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/issues/events{/number}","events_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/events","assignees_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/assignees{/user}","branches_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/branches{/branch}","tags_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/tags","blobs_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/git/refs{/sha}","trees_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/statuses/{sha}","languages_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/languages","stargazers_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/stargazers","contributors_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/contributors","subscribers_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/subscribers","subscription_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/subscription","commits_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/commits{/sha}","git_commits_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/git/commits{/sha}","comments_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/comments{/number}","issue_comment_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/issues/comments{/number}","contents_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/contents/{+path}","compare_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/merges","archive_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/downloads","issues_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/issues{/number}","pulls_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls{/number}","milestones_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/milestones{/number}","notifications_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/labels{/name}","releases_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/releases{/id}","deployments_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/deployments","created_at":"2016-01-25T12:11:23Z","updated_at":"2016-04-18T14:28:31Z","pushed_at":"2016-04-18T12:36:19Z","git_url":"git://github.com/gemini-testing/gemini-faildump.git","ssh_url":"git@github.com:gemini-testing/gemini-faildump.git","clone_url":"https://github.com/gemini-testing/gemini-faildump.git","svn_url":"https://github.com/gemini-testing/gemini-faildump","homepage":null,"size":25,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"gemini-testing:master","ref":"master","sha":"b1c7afe6672927a54deb740deafa52337b0bd6fc","user":{"login":"gemini-testing","id":11424134,"avatar_url":"https://avatars.githubusercontent.com/u/11424134?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-testing","html_url":"https://github.com/gemini-testing","followers_url":"https://api.github.com/users/gemini-testing/followers","following_url":"https://api.github.com/users/gemini-testing/following{/other_user}","gists_url":"https://api.github.com/users/gemini-testing/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-testing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-testing/subscriptions","organizations_url":"https://api.github.com/users/gemini-testing/orgs","repos_url":"https://api.github.com/users/gemini-testing/repos","events_url":"https://api.github.com/users/gemini-testing/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-testing/received_events","type":"Organization","site_admin":false},"repo":{"id":50348300,"name":"gemini-faildump","full_name":"gemini-testing/gemini-faildump","owner":{"login":"gemini-testing","id":11424134,"avatar_url":"https://avatars.githubusercontent.com/u/11424134?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-testing","html_url":"https://github.com/gemini-testing","followers_url":"https://api.github.com/users/gemini-testing/followers","following_url":"https://api.github.com/users/gemini-testing/following{/other_user}","gists_url":"https://api.github.com/users/gemini-testing/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-testing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-testing/subscriptions","organizations_url":"https://api.github.com/users/gemini-testing/orgs","repos_url":"https://api.github.com/users/gemini-testing/repos","events_url":"https://api.github.com/users/gemini-testing/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-testing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gemini-testing/gemini-faildump","description":"Plugin to collect information about test fails.","fork":false,"url":"https://api.github.com/repos/gemini-testing/gemini-faildump","forks_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/forks","keys_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/teams","hooks_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/hooks","issue_events_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/issues/events{/number}","events_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/events","assignees_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/assignees{/user}","branches_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/branches{/branch}","tags_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/tags","blobs_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/git/refs{/sha}","trees_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/statuses/{sha}","languages_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/languages","stargazers_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/stargazers","contributors_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/contributors","subscribers_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/subscribers","subscription_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/subscription","commits_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/commits{/sha}","git_commits_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/git/commits{/sha}","comments_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/comments{/number}","issue_comment_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/issues/comments{/number}","contents_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/contents/{+path}","compare_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/merges","archive_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/downloads","issues_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/issues{/number}","pulls_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls{/number}","milestones_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/milestones{/number}","notifications_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/labels{/name}","releases_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/releases{/id}","deployments_url":"https://api.github.com/repos/gemini-testing/gemini-faildump/deployments","created_at":"2016-01-25T12:11:23Z","updated_at":"2016-04-18T14:28:31Z","pushed_at":"2016-04-18T12:36:19Z","git_url":"git://github.com/gemini-testing/gemini-faildump.git","ssh_url":"git@github.com:gemini-testing/gemini-faildump.git","clone_url":"https://github.com/gemini-testing/gemini-faildump.git","svn_url":"https://github.com/gemini-testing/gemini-faildump","homepage":null,"size":25,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/6"},"html":{"href":"https://github.com/gemini-testing/gemini-faildump/pull/6"},"issue":{"href":"https://api.github.com/repos/gemini-testing/gemini-faildump/issues/6"},"comments":{"href":"https://api.github.com/repos/gemini-testing/gemini-faildump/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gemini-testing/gemini-faildump/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/gemini-testing/gemini-faildump/statuses/ba345209c9e7e1aed1f0cd465d5b78635b432412"}}}}