{"action":"created","comment":{"url":"https://api.github.com/repos/appium/appium-doctor/pulls/comments/33380672","id":33380672,"diff_hunk":"@@ -0,0 +1,31 @@\n+class DoctorCheck {\n+  async diagnose () { return false; }\n+  async fix () { return true; }\n+}\n+\n+class Doctor {\n+  constructor() {\n+    this.checks = [];\n+    this.toFix = [];\n+  }\n+\n+  register(checks) {\n+    if(!Array.isArray(checks)) { checks = [checks]; }\n+    this.checks = this.checks.concat(checks);\n+  }\n+\n+  async diagnose() {\n+    this.toFix = [];\n+    for(let check of this.checks) {\n+      if (!await check.diagnose().ok) { this.toFix.push(check); }\n+    }\n+  }\n+\n+  async fix() {\n+    for(let check of this.toFix) {\n+      await check.fix();\n+    }\n+  }\n+}\n+\n+export {Doctor, DoctorCheck};","path":"lib/doctor.js","position":31,"original_position":31,"commit_id":"eea593aefad3f4dccb6b0da800bf344006c36117","original_commit_id":"eea593aefad3f4dccb6b0da800bf344006c36117","user":{"login":"jlipps","id":605053,"avatar_url":"https://avatars.githubusercontent.com/u/605053?v=3","gravatar_id":"","url":"https://api.github.com/users/jlipps","html_url":"https://github.com/jlipps","followers_url":"https://api.github.com/users/jlipps/followers","following_url":"https://api.github.com/users/jlipps/following{/other_user}","gists_url":"https://api.github.com/users/jlipps/gists{/gist_id}","starred_url":"https://api.github.com/users/jlipps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlipps/subscriptions","organizations_url":"https://api.github.com/users/jlipps/orgs","repos_url":"https://api.github.com/users/jlipps/repos","events_url":"https://api.github.com/users/jlipps/events{/privacy}","received_events_url":"https://api.github.com/users/jlipps/received_events","type":"User","site_admin":false},"body":"```js\r\nexport { Doctor, DoctorCheck };\r\n```","created_at":"2015-06-26T18:12:01Z","updated_at":"2015-06-26T18:12:01Z","html_url":"https://github.com/appium/appium-doctor/pull/1#discussion_r33380672","pull_request_url":"https://api.github.com/repos/appium/appium-doctor/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/appium/appium-doctor/pulls/comments/33380672"},"html":{"href":"https://github.com/appium/appium-doctor/pull/1#discussion_r33380672"},"pull_request":{"href":"https://api.github.com/repos/appium/appium-doctor/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/appium/appium-doctor/pulls/1","id":38626188,"html_url":"https://github.com/appium/appium-doctor/pull/1","diff_url":"https://github.com/appium/appium-doctor/pull/1.diff","patch_url":"https://github.com/appium/appium-doctor/pull/1.patch","issue_url":"https://api.github.com/repos/appium/appium-doctor/issues/1","number":1,"state":"open","locked":false,"title":"The New Doctor","user":{"login":"sebv","id":418288,"avatar_url":"https://avatars.githubusercontent.com/u/418288?v=3","gravatar_id":"","url":"https://api.github.com/users/sebv","html_url":"https://github.com/sebv","followers_url":"https://api.github.com/users/sebv/followers","following_url":"https://api.github.com/users/sebv/following{/other_user}","gists_url":"https://api.github.com/users/sebv/gists{/gist_id}","starred_url":"https://api.github.com/users/sebv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebv/subscriptions","organizations_url":"https://api.github.com/users/sebv/orgs","repos_url":"https://api.github.com/users/sebv/repos","events_url":"https://api.github.com/users/sebv/events{/privacy}","received_events_url":"https://api.github.com/users/sebv/received_events","type":"User","site_admin":false},"body":"Work in progress...","created_at":"2015-06-26T08:10:56Z","updated_at":"2015-06-26T18:12:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1f509881d2ea0a97c3005382995df30302f7c74","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/appium/appium-doctor/pulls/1/commits","review_comments_url":"https://api.github.com/repos/appium/appium-doctor/pulls/1/comments","review_comment_url":"https://api.github.com/repos/appium/appium-doctor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appium/appium-doctor/issues/1/comments","statuses_url":"https://api.github.com/repos/appium/appium-doctor/statuses/eea593aefad3f4dccb6b0da800bf344006c36117","head":{"label":"appium:sebv-doctor-who","ref":"sebv-doctor-who","sha":"eea593aefad3f4dccb6b0da800bf344006c36117","user":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"repo":{"id":37994417,"name":"appium-doctor","full_name":"appium/appium-doctor","owner":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appium/appium-doctor","description":"Tool to verify appium installation","fork":false,"url":"https://api.github.com/repos/appium/appium-doctor","forks_url":"https://api.github.com/repos/appium/appium-doctor/forks","keys_url":"https://api.github.com/repos/appium/appium-doctor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appium/appium-doctor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appium/appium-doctor/teams","hooks_url":"https://api.github.com/repos/appium/appium-doctor/hooks","issue_events_url":"https://api.github.com/repos/appium/appium-doctor/issues/events{/number}","events_url":"https://api.github.com/repos/appium/appium-doctor/events","assignees_url":"https://api.github.com/repos/appium/appium-doctor/assignees{/user}","branches_url":"https://api.github.com/repos/appium/appium-doctor/branches{/branch}","tags_url":"https://api.github.com/repos/appium/appium-doctor/tags","blobs_url":"https://api.github.com/repos/appium/appium-doctor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appium/appium-doctor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appium/appium-doctor/git/refs{/sha}","trees_url":"https://api.github.com/repos/appium/appium-doctor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appium/appium-doctor/statuses/{sha}","languages_url":"https://api.github.com/repos/appium/appium-doctor/languages","stargazers_url":"https://api.github.com/repos/appium/appium-doctor/stargazers","contributors_url":"https://api.github.com/repos/appium/appium-doctor/contributors","subscribers_url":"https://api.github.com/repos/appium/appium-doctor/subscribers","subscription_url":"https://api.github.com/repos/appium/appium-doctor/subscription","commits_url":"https://api.github.com/repos/appium/appium-doctor/commits{/sha}","git_commits_url":"https://api.github.com/repos/appium/appium-doctor/git/commits{/sha}","comments_url":"https://api.github.com/repos/appium/appium-doctor/comments{/number}","issue_comment_url":"https://api.github.com/repos/appium/appium-doctor/issues/comments{/number}","contents_url":"https://api.github.com/repos/appium/appium-doctor/contents/{+path}","compare_url":"https://api.github.com/repos/appium/appium-doctor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appium/appium-doctor/merges","archive_url":"https://api.github.com/repos/appium/appium-doctor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appium/appium-doctor/downloads","issues_url":"https://api.github.com/repos/appium/appium-doctor/issues{/number}","pulls_url":"https://api.github.com/repos/appium/appium-doctor/pulls{/number}","milestones_url":"https://api.github.com/repos/appium/appium-doctor/milestones{/number}","notifications_url":"https://api.github.com/repos/appium/appium-doctor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appium/appium-doctor/labels{/name}","releases_url":"https://api.github.com/repos/appium/appium-doctor/releases{/id}","created_at":"2015-06-24T15:49:21Z","updated_at":"2015-06-24T15:50:35Z","pushed_at":"2015-06-26T11:59:07Z","git_url":"git://github.com/appium/appium-doctor.git","ssh_url":"git@github.com:appium/appium-doctor.git","clone_url":"https://github.com/appium/appium-doctor.git","svn_url":"https://github.com/appium/appium-doctor","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"appium:master","ref":"master","sha":"ccfb631e21f993454f10edaed9f1eac16bc509e0","user":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"repo":{"id":37994417,"name":"appium-doctor","full_name":"appium/appium-doctor","owner":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appium/appium-doctor","description":"Tool to verify appium installation","fork":false,"url":"https://api.github.com/repos/appium/appium-doctor","forks_url":"https://api.github.com/repos/appium/appium-doctor/forks","keys_url":"https://api.github.com/repos/appium/appium-doctor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appium/appium-doctor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appium/appium-doctor/teams","hooks_url":"https://api.github.com/repos/appium/appium-doctor/hooks","issue_events_url":"https://api.github.com/repos/appium/appium-doctor/issues/events{/number}","events_url":"https://api.github.com/repos/appium/appium-doctor/events","assignees_url":"https://api.github.com/repos/appium/appium-doctor/assignees{/user}","branches_url":"https://api.github.com/repos/appium/appium-doctor/branches{/branch}","tags_url":"https://api.github.com/repos/appium/appium-doctor/tags","blobs_url":"https://api.github.com/repos/appium/appium-doctor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appium/appium-doctor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appium/appium-doctor/git/refs{/sha}","trees_url":"https://api.github.com/repos/appium/appium-doctor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appium/appium-doctor/statuses/{sha}","languages_url":"https://api.github.com/repos/appium/appium-doctor/languages","stargazers_url":"https://api.github.com/repos/appium/appium-doctor/stargazers","contributors_url":"https://api.github.com/repos/appium/appium-doctor/contributors","subscribers_url":"https://api.github.com/repos/appium/appium-doctor/subscribers","subscription_url":"https://api.github.com/repos/appium/appium-doctor/subscription","commits_url":"https://api.github.com/repos/appium/appium-doctor/commits{/sha}","git_commits_url":"https://api.github.com/repos/appium/appium-doctor/git/commits{/sha}","comments_url":"https://api.github.com/repos/appium/appium-doctor/comments{/number}","issue_comment_url":"https://api.github.com/repos/appium/appium-doctor/issues/comments{/number}","contents_url":"https://api.github.com/repos/appium/appium-doctor/contents/{+path}","compare_url":"https://api.github.com/repos/appium/appium-doctor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appium/appium-doctor/merges","archive_url":"https://api.github.com/repos/appium/appium-doctor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appium/appium-doctor/downloads","issues_url":"https://api.github.com/repos/appium/appium-doctor/issues{/number}","pulls_url":"https://api.github.com/repos/appium/appium-doctor/pulls{/number}","milestones_url":"https://api.github.com/repos/appium/appium-doctor/milestones{/number}","notifications_url":"https://api.github.com/repos/appium/appium-doctor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appium/appium-doctor/labels{/name}","releases_url":"https://api.github.com/repos/appium/appium-doctor/releases{/id}","created_at":"2015-06-24T15:49:21Z","updated_at":"2015-06-24T15:50:35Z","pushed_at":"2015-06-26T11:59:07Z","git_url":"git://github.com/appium/appium-doctor.git","ssh_url":"git@github.com:appium/appium-doctor.git","clone_url":"https://github.com/appium/appium-doctor.git","svn_url":"https://github.com/appium/appium-doctor","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appium/appium-doctor/pulls/1"},"html":{"href":"https://github.com/appium/appium-doctor/pull/1"},"issue":{"href":"https://api.github.com/repos/appium/appium-doctor/issues/1"},"comments":{"href":"https://api.github.com/repos/appium/appium-doctor/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/appium/appium-doctor/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/appium/appium-doctor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appium/appium-doctor/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/appium/appium-doctor/statuses/eea593aefad3f4dccb6b0da800bf344006c36117"}}}}