{"action":"created","comment":{"url":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/comments/42817527","id":42817527,"diff_hunk":"@@ -1,44 +1,100 @@\n+require 'pry'\n module Lita\n   module GithubPrList\n     class Status\n-      attr_accessor :comment, :status,\n-                    :pass_regex, :review_regex, :fail_regex, :fixed_regex\n+      attr_accessor :comment, :status, :base, :dev, :design\n \n-      PASS_REGEX = /:elephant: :elephant: :elephant:/\n+      DESIGN_REVIEW_REGEX = /:art:/\n+      DEV_REVIEW_REGEX = /:elephant:/\n+      PASS_DEV_REGEX = /:elephant: :elephant: :elephant:/\n+      PASS_DESIGN_REGEX = /:art: :art: :art:/\n       REVIEW_REGEX = /:book:/\n       FAIL_REGEX = /:poop:|:hankey:/\n       FIXED_REGEX = /:wave:/\n+      NEW_REGEX = /:new:/\n \n-      PASS_EMOJI = \"(elephant)(elephant)(elephant)\"\n+      DESIGN_REVIEW_REQUIRED = \"(art)\"\n+      DEV_REVIEW_REQUIRED = \"(elephant)\"\n+      PASS_DEV_EMOJI = \"(elephant)(elephant)(elephant)\"\n+      PASS_DESIGN_EMOJI = \"(art)(art)(art)\"\n       REVIEW_EMOJI = \"(book)\"\n       FAIL_EMOJI = \"(poop)\"\n       FIXED_EMOJI = \"(wave)\"\n+      NEW_EMOJI = \"(new)\"\n \n       def initialize(params = {})\n         self.comment = params.fetch(:comment, nil)\n-        self.status = params.fetch(:status, {})\n-\n+        self.status = {}\n+        self.base = \"(new)\"\n+        setup(comment)\n         raise \"invalid params in #{self.class.name}\" if comment.nil?\n       end\n \n       def comment_status\n-        case self.comment\n-          when PASS_REGEX\n-            status[:emoji] = PASS_EMOJI\n-            status[:status] = \"Passed\"\n+        case base\n+          when REVIEW_REGEX, FAIL_REGEX\n+            status = base\n+          else\n+            status = \"#{base}#{dev}#{design}\"\n+        end\n+        status\n+      end\n+\n+      def update(new_comment)\n+        parse_dev(new_comment)\n+        parse_design(new_comment)\n+        parse_common(new_comment)\n+        self.comment = new_comment\n+        comment_status\n+      end\n+\n+    private\n+\n+      def parse_dev(comm)\n+        if !self.dev.empty?\n+          case comm\n+          when PASS_DEV_REGEX\n+              self.base = \"\"\n+              self.dev = PASS_DEV_EMOJI\n+            when DEV_REVIEW_REGEX, FAIL_REGEX, FIXED_REGEX\n+              self.dev = DEV_REVIEW_REQUIRED\n+          end\n+        end\n+      end\n+\n+      def parse_design(comm)\n+        if !self.design.empty?","path":"lib/lita/github_pr_list/status.rb","position":76,"original_position":76,"commit_id":"7b30bb1497d8714bc97ef64432388620108d693a","original_commit_id":"7b30bb1497d8714bc97ef64432388620108d693a","user":{"login":"adamrmelnyk","id":6963287,"avatar_url":"https://avatars.githubusercontent.com/u/6963287?v=3","gravatar_id":"","url":"https://api.github.com/users/adamrmelnyk","html_url":"https://github.com/adamrmelnyk","followers_url":"https://api.github.com/users/adamrmelnyk/followers","following_url":"https://api.github.com/users/adamrmelnyk/following{/other_user}","gists_url":"https://api.github.com/users/adamrmelnyk/gists{/gist_id}","starred_url":"https://api.github.com/users/adamrmelnyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamrmelnyk/subscriptions","organizations_url":"https://api.github.com/users/adamrmelnyk/orgs","repos_url":"https://api.github.com/users/adamrmelnyk/repos","events_url":"https://api.github.com/users/adamrmelnyk/events{/privacy}","received_events_url":"https://api.github.com/users/adamrmelnyk/received_events","type":"User","site_admin":false},"body":"same as above","created_at":"2015-10-22T23:06:01Z","updated_at":"2015-10-22T23:06:01Z","html_url":"https://github.com/amaabca/lita-github_pr_list/pull/40#discussion_r42817527","pull_request_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/comments/42817527"},"html":{"href":"https://github.com/amaabca/lita-github_pr_list/pull/40#discussion_r42817527"},"pull_request":{"href":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/40","id":48502579,"html_url":"https://github.com/amaabca/lita-github_pr_list/pull/40","diff_url":"https://github.com/amaabca/lita-github_pr_list/pull/40.diff","patch_url":"https://github.com/amaabca/lita-github_pr_list/pull/40.patch","issue_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/issues/40","number":40,"state":"open","locked":false,"title":"Art palette","user":{"login":"weyermannx","id":11400938,"avatar_url":"https://avatars.githubusercontent.com/u/11400938?v=3","gravatar_id":"","url":"https://api.github.com/users/weyermannx","html_url":"https://github.com/weyermannx","followers_url":"https://api.github.com/users/weyermannx/followers","following_url":"https://api.github.com/users/weyermannx/following{/other_user}","gists_url":"https://api.github.com/users/weyermannx/gists{/gist_id}","starred_url":"https://api.github.com/users/weyermannx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weyermannx/subscriptions","organizations_url":"https://api.github.com/users/weyermannx/orgs","repos_url":"https://api.github.com/users/weyermannx/repos","events_url":"https://api.github.com/users/weyermannx/events{/privacy}","received_events_url":"https://api.github.com/users/weyermannx/received_events","type":"User","site_admin":false},"body":"Adds :art: pallete support to pull requests for design\r\n\r\npr list shows which pull requests need design and which need dev review\r\nproper responses when reviews are done - shows if a dev/design review still needs to happen, or if you are done \r\n\r\nBoth design and dev review are mandatory if nothing is specified in the initial pull request\r\nif you want just dev, add :elephant: in your pull request\r\nif you want just design, add :art: in your pull request\r\nif you want both, you can add :art: and :elephant:  or don't specify anything","created_at":"2015-10-22T19:38:23Z","updated_at":"2015-10-22T23:06:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8612b1cb8f4aea36a2b2b96eca5942b8f785029","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/40/commits","review_comments_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/40/comments","review_comment_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/issues/40/comments","statuses_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/statuses/7b30bb1497d8714bc97ef64432388620108d693a","head":{"label":"amaabca:art_palette","ref":"art_palette","sha":"7b30bb1497d8714bc97ef64432388620108d693a","user":{"login":"amaabca","id":1038934,"avatar_url":"https://avatars.githubusercontent.com/u/1038934?v=3","gravatar_id":"","url":"https://api.github.com/users/amaabca","html_url":"https://github.com/amaabca","followers_url":"https://api.github.com/users/amaabca/followers","following_url":"https://api.github.com/users/amaabca/following{/other_user}","gists_url":"https://api.github.com/users/amaabca/gists{/gist_id}","starred_url":"https://api.github.com/users/amaabca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaabca/subscriptions","organizations_url":"https://api.github.com/users/amaabca/orgs","repos_url":"https://api.github.com/users/amaabca/repos","events_url":"https://api.github.com/users/amaabca/events{/privacy}","received_events_url":"https://api.github.com/users/amaabca/received_events","type":"Organization","site_admin":false},"repo":{"id":21129452,"name":"lita-github_pr_list","full_name":"amaabca/lita-github_pr_list","owner":{"login":"amaabca","id":1038934,"avatar_url":"https://avatars.githubusercontent.com/u/1038934?v=3","gravatar_id":"","url":"https://api.github.com/users/amaabca","html_url":"https://github.com/amaabca","followers_url":"https://api.github.com/users/amaabca/followers","following_url":"https://api.github.com/users/amaabca/following{/other_user}","gists_url":"https://api.github.com/users/amaabca/gists{/gist_id}","starred_url":"https://api.github.com/users/amaabca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaabca/subscriptions","organizations_url":"https://api.github.com/users/amaabca/orgs","repos_url":"https://api.github.com/users/amaabca/repos","events_url":"https://api.github.com/users/amaabca/events{/privacy}","received_events_url":"https://api.github.com/users/amaabca/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amaabca/lita-github_pr_list","description":"List open pull requests for an organization.","fork":false,"url":"https://api.github.com/repos/amaabca/lita-github_pr_list","forks_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/forks","keys_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/teams","hooks_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/hooks","issue_events_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/issues/events{/number}","events_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/events","assignees_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/assignees{/user}","branches_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/branches{/branch}","tags_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/tags","blobs_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/git/refs{/sha}","trees_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/statuses/{sha}","languages_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/languages","stargazers_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/stargazers","contributors_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/contributors","subscribers_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/subscribers","subscription_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/subscription","commits_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/commits{/sha}","git_commits_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/git/commits{/sha}","comments_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/comments{/number}","issue_comment_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/issues/comments{/number}","contents_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/contents/{+path}","compare_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/merges","archive_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/downloads","issues_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/issues{/number}","pulls_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls{/number}","milestones_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/milestones{/number}","notifications_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/labels{/name}","releases_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/releases{/id}","created_at":"2014-06-23T14:34:19Z","updated_at":"2015-04-28T20:52:39Z","pushed_at":"2015-10-22T22:42:31Z","git_url":"git://github.com/amaabca/lita-github_pr_list.git","ssh_url":"git@github.com:amaabca/lita-github_pr_list.git","clone_url":"https://github.com/amaabca/lita-github_pr_list.git","svn_url":"https://github.com/amaabca/lita-github_pr_list","homepage":null,"size":576,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"amaabca:master","ref":"master","sha":"3c8269bcfd3c2d503ecec19ad876926463e55d8b","user":{"login":"amaabca","id":1038934,"avatar_url":"https://avatars.githubusercontent.com/u/1038934?v=3","gravatar_id":"","url":"https://api.github.com/users/amaabca","html_url":"https://github.com/amaabca","followers_url":"https://api.github.com/users/amaabca/followers","following_url":"https://api.github.com/users/amaabca/following{/other_user}","gists_url":"https://api.github.com/users/amaabca/gists{/gist_id}","starred_url":"https://api.github.com/users/amaabca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaabca/subscriptions","organizations_url":"https://api.github.com/users/amaabca/orgs","repos_url":"https://api.github.com/users/amaabca/repos","events_url":"https://api.github.com/users/amaabca/events{/privacy}","received_events_url":"https://api.github.com/users/amaabca/received_events","type":"Organization","site_admin":false},"repo":{"id":21129452,"name":"lita-github_pr_list","full_name":"amaabca/lita-github_pr_list","owner":{"login":"amaabca","id":1038934,"avatar_url":"https://avatars.githubusercontent.com/u/1038934?v=3","gravatar_id":"","url":"https://api.github.com/users/amaabca","html_url":"https://github.com/amaabca","followers_url":"https://api.github.com/users/amaabca/followers","following_url":"https://api.github.com/users/amaabca/following{/other_user}","gists_url":"https://api.github.com/users/amaabca/gists{/gist_id}","starred_url":"https://api.github.com/users/amaabca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaabca/subscriptions","organizations_url":"https://api.github.com/users/amaabca/orgs","repos_url":"https://api.github.com/users/amaabca/repos","events_url":"https://api.github.com/users/amaabca/events{/privacy}","received_events_url":"https://api.github.com/users/amaabca/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amaabca/lita-github_pr_list","description":"List open pull requests for an organization.","fork":false,"url":"https://api.github.com/repos/amaabca/lita-github_pr_list","forks_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/forks","keys_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/teams","hooks_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/hooks","issue_events_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/issues/events{/number}","events_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/events","assignees_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/assignees{/user}","branches_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/branches{/branch}","tags_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/tags","blobs_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/git/refs{/sha}","trees_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/statuses/{sha}","languages_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/languages","stargazers_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/stargazers","contributors_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/contributors","subscribers_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/subscribers","subscription_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/subscription","commits_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/commits{/sha}","git_commits_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/git/commits{/sha}","comments_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/comments{/number}","issue_comment_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/issues/comments{/number}","contents_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/contents/{+path}","compare_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/merges","archive_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/downloads","issues_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/issues{/number}","pulls_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls{/number}","milestones_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/milestones{/number}","notifications_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/labels{/name}","releases_url":"https://api.github.com/repos/amaabca/lita-github_pr_list/releases{/id}","created_at":"2014-06-23T14:34:19Z","updated_at":"2015-04-28T20:52:39Z","pushed_at":"2015-10-22T22:42:31Z","git_url":"git://github.com/amaabca/lita-github_pr_list.git","ssh_url":"git@github.com:amaabca/lita-github_pr_list.git","clone_url":"https://github.com/amaabca/lita-github_pr_list.git","svn_url":"https://github.com/amaabca/lita-github_pr_list","homepage":null,"size":576,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/40"},"html":{"href":"https://github.com/amaabca/lita-github_pr_list/pull/40"},"issue":{"href":"https://api.github.com/repos/amaabca/lita-github_pr_list/issues/40"},"comments":{"href":"https://api.github.com/repos/amaabca/lita-github_pr_list/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amaabca/lita-github_pr_list/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/amaabca/lita-github_pr_list/statuses/7b30bb1497d8714bc97ef64432388620108d693a"}}}}