{"action":"created","comment":{"url":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/comments/166489044","pull_request_review_id":94558677,"id":166489044,"diff_hunk":"@@ -4,6 +4,69 @@\n \n   subject(:prompt) { TTY::TestPrompt.new }\n \n+  def collect(&block)\n+    prompt = subject\n+    count = 0\n+\n+    result = prompt.collect do\n+      while prompt.yes?(\"continue?\")\n+        instance_eval(&block)\n+        count += 1\n+      end\n+    end\n+\n+    result[:count] = count\n+    result\n+  end\n+\n+  context \"when receiving multiple answers\" do","path":"spec/unit/collect_spec.rb","position":19,"original_position":19,"commit_id":"292a79b00f04aac35693c50c3481dbbd9d1da56b","original_commit_id":"292a79b00f04aac35693c50c3481dbbd9d1da56b","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Block has too many lines. [38/25]","created_at":"2018-02-07T00:42:54Z","updated_at":"2018-02-07T00:42:54Z","html_url":"https://github.com/piotrmurach/tty-prompt/pull/74#discussion_r166489044","pull_request_url":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/74","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/comments/166489044"},"html":{"href":"https://github.com/piotrmurach/tty-prompt/pull/74#discussion_r166489044"},"pull_request":{"href":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/74","id":164694382,"html_url":"https://github.com/piotrmurach/tty-prompt/pull/74","diff_url":"https://github.com/piotrmurach/tty-prompt/pull/74.diff","patch_url":"https://github.com/piotrmurach/tty-prompt/pull/74.patch","issue_url":"https://api.github.com/repos/piotrmurach/tty-prompt/issues/74","number":74,"state":"open","locked":false,"title":"Support array values for answer collector keys","user":{"login":"dadleyy","id":1545348,"avatar_url":"https://avatars1.githubusercontent.com/u/1545348?v=4","gravatar_id":"","url":"https://api.github.com/users/dadleyy","html_url":"https://github.com/dadleyy","followers_url":"https://api.github.com/users/dadleyy/followers","following_url":"https://api.github.com/users/dadleyy/following{/other_user}","gists_url":"https://api.github.com/users/dadleyy/gists{/gist_id}","starred_url":"https://api.github.com/users/dadleyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadleyy/subscriptions","organizations_url":"https://api.github.com/users/dadleyy/orgs","repos_url":"https://api.github.com/users/dadleyy/repos","events_url":"https://api.github.com/users/dadleyy/events{/privacy}","received_events_url":"https://api.github.com/users/dadleyy/received_events","type":"User","site_admin":false},"body":"I'm working on a project where I want to be able to keep a loop going, getting feedback from users and storing them all in the `result` returned from an `AnswerCollector`. This PR allows collector consumers to receive multiple values from `key`-ed prompts if the key name is shared.\r\n\r\nI feel like there is value in this being optional - where the default behavior would be to _override_ the value of a key if it appears multiple times - but couldn't figure out a clean way to implement an additional option to the `key` method; was thinking something like:\r\n\r\n```rb\r\ndef key(name, multi: false, &block)\r\n  @name = name\r\n  @multi = multi\r\n  # ...\r\nend\r\n```","created_at":"2018-01-23T21:28:09Z","updated_at":"2018-02-07T00:42:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b10d9d53450d31582103fc35815f2d4260f54926","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/74/commits","review_comments_url":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/74/comments","review_comment_url":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/piotrmurach/tty-prompt/issues/74/comments","statuses_url":"https://api.github.com/repos/piotrmurach/tty-prompt/statuses/292a79b00f04aac35693c50c3481dbbd9d1da56b","head":{"label":"dadleyy:feature-mutli-answer","ref":"feature-mutli-answer","sha":"292a79b00f04aac35693c50c3481dbbd9d1da56b","user":{"login":"dadleyy","id":1545348,"avatar_url":"https://avatars1.githubusercontent.com/u/1545348?v=4","gravatar_id":"","url":"https://api.github.com/users/dadleyy","html_url":"https://github.com/dadleyy","followers_url":"https://api.github.com/users/dadleyy/followers","following_url":"https://api.github.com/users/dadleyy/following{/other_user}","gists_url":"https://api.github.com/users/dadleyy/gists{/gist_id}","starred_url":"https://api.github.com/users/dadleyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadleyy/subscriptions","organizations_url":"https://api.github.com/users/dadleyy/orgs","repos_url":"https://api.github.com/users/dadleyy/repos","events_url":"https://api.github.com/users/dadleyy/events{/privacy}","received_events_url":"https://api.github.com/users/dadleyy/received_events","type":"User","site_admin":false},"repo":{"id":118664008,"name":"tty-prompt","full_name":"dadleyy/tty-prompt","owner":{"login":"dadleyy","id":1545348,"avatar_url":"https://avatars1.githubusercontent.com/u/1545348?v=4","gravatar_id":"","url":"https://api.github.com/users/dadleyy","html_url":"https://github.com/dadleyy","followers_url":"https://api.github.com/users/dadleyy/followers","following_url":"https://api.github.com/users/dadleyy/following{/other_user}","gists_url":"https://api.github.com/users/dadleyy/gists{/gist_id}","starred_url":"https://api.github.com/users/dadleyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadleyy/subscriptions","organizations_url":"https://api.github.com/users/dadleyy/orgs","repos_url":"https://api.github.com/users/dadleyy/repos","events_url":"https://api.github.com/users/dadleyy/events{/privacy}","received_events_url":"https://api.github.com/users/dadleyy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dadleyy/tty-prompt","description":"A beautiful and powerful interactive command line prompt","fork":true,"url":"https://api.github.com/repos/dadleyy/tty-prompt","forks_url":"https://api.github.com/repos/dadleyy/tty-prompt/forks","keys_url":"https://api.github.com/repos/dadleyy/tty-prompt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dadleyy/tty-prompt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dadleyy/tty-prompt/teams","hooks_url":"https://api.github.com/repos/dadleyy/tty-prompt/hooks","issue_events_url":"https://api.github.com/repos/dadleyy/tty-prompt/issues/events{/number}","events_url":"https://api.github.com/repos/dadleyy/tty-prompt/events","assignees_url":"https://api.github.com/repos/dadleyy/tty-prompt/assignees{/user}","branches_url":"https://api.github.com/repos/dadleyy/tty-prompt/branches{/branch}","tags_url":"https://api.github.com/repos/dadleyy/tty-prompt/tags","blobs_url":"https://api.github.com/repos/dadleyy/tty-prompt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dadleyy/tty-prompt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dadleyy/tty-prompt/git/refs{/sha}","trees_url":"https://api.github.com/repos/dadleyy/tty-prompt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dadleyy/tty-prompt/statuses/{sha}","languages_url":"https://api.github.com/repos/dadleyy/tty-prompt/languages","stargazers_url":"https://api.github.com/repos/dadleyy/tty-prompt/stargazers","contributors_url":"https://api.github.com/repos/dadleyy/tty-prompt/contributors","subscribers_url":"https://api.github.com/repos/dadleyy/tty-prompt/subscribers","subscription_url":"https://api.github.com/repos/dadleyy/tty-prompt/subscription","commits_url":"https://api.github.com/repos/dadleyy/tty-prompt/commits{/sha}","git_commits_url":"https://api.github.com/repos/dadleyy/tty-prompt/git/commits{/sha}","comments_url":"https://api.github.com/repos/dadleyy/tty-prompt/comments{/number}","issue_comment_url":"https://api.github.com/repos/dadleyy/tty-prompt/issues/comments{/number}","contents_url":"https://api.github.com/repos/dadleyy/tty-prompt/contents/{+path}","compare_url":"https://api.github.com/repos/dadleyy/tty-prompt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dadleyy/tty-prompt/merges","archive_url":"https://api.github.com/repos/dadleyy/tty-prompt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dadleyy/tty-prompt/downloads","issues_url":"https://api.github.com/repos/dadleyy/tty-prompt/issues{/number}","pulls_url":"https://api.github.com/repos/dadleyy/tty-prompt/pulls{/number}","milestones_url":"https://api.github.com/repos/dadleyy/tty-prompt/milestones{/number}","notifications_url":"https://api.github.com/repos/dadleyy/tty-prompt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dadleyy/tty-prompt/labels{/name}","releases_url":"https://api.github.com/repos/dadleyy/tty-prompt/releases{/id}","deployments_url":"https://api.github.com/repos/dadleyy/tty-prompt/deployments","created_at":"2018-01-23T20:15:52Z","updated_at":"2018-01-23T20:15:54Z","pushed_at":"2018-02-07T00:42:43Z","git_url":"git://github.com/dadleyy/tty-prompt.git","ssh_url":"git@github.com:dadleyy/tty-prompt.git","clone_url":"https://github.com/dadleyy/tty-prompt.git","svn_url":"https://github.com/dadleyy/tty-prompt","homepage":"https://piotrmurach.github.io/tty/","size":701,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"piotrmurach:master","ref":"master","sha":"5b414c48043857727bbd8f2333ccd07d01d3c57f","user":{"login":"piotrmurach","id":444312,"avatar_url":"https://avatars3.githubusercontent.com/u/444312?v=4","gravatar_id":"","url":"https://api.github.com/users/piotrmurach","html_url":"https://github.com/piotrmurach","followers_url":"https://api.github.com/users/piotrmurach/followers","following_url":"https://api.github.com/users/piotrmurach/following{/other_user}","gists_url":"https://api.github.com/users/piotrmurach/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrmurach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrmurach/subscriptions","organizations_url":"https://api.github.com/users/piotrmurach/orgs","repos_url":"https://api.github.com/users/piotrmurach/repos","events_url":"https://api.github.com/users/piotrmurach/events{/privacy}","received_events_url":"https://api.github.com/users/piotrmurach/received_events","type":"User","site_admin":false},"repo":{"id":45350538,"name":"tty-prompt","full_name":"piotrmurach/tty-prompt","owner":{"login":"piotrmurach","id":444312,"avatar_url":"https://avatars3.githubusercontent.com/u/444312?v=4","gravatar_id":"","url":"https://api.github.com/users/piotrmurach","html_url":"https://github.com/piotrmurach","followers_url":"https://api.github.com/users/piotrmurach/followers","following_url":"https://api.github.com/users/piotrmurach/following{/other_user}","gists_url":"https://api.github.com/users/piotrmurach/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrmurach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrmurach/subscriptions","organizations_url":"https://api.github.com/users/piotrmurach/orgs","repos_url":"https://api.github.com/users/piotrmurach/repos","events_url":"https://api.github.com/users/piotrmurach/events{/privacy}","received_events_url":"https://api.github.com/users/piotrmurach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/piotrmurach/tty-prompt","description":"A beautiful and powerful interactive command line prompt","fork":false,"url":"https://api.github.com/repos/piotrmurach/tty-prompt","forks_url":"https://api.github.com/repos/piotrmurach/tty-prompt/forks","keys_url":"https://api.github.com/repos/piotrmurach/tty-prompt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/piotrmurach/tty-prompt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/piotrmurach/tty-prompt/teams","hooks_url":"https://api.github.com/repos/piotrmurach/tty-prompt/hooks","issue_events_url":"https://api.github.com/repos/piotrmurach/tty-prompt/issues/events{/number}","events_url":"https://api.github.com/repos/piotrmurach/tty-prompt/events","assignees_url":"https://api.github.com/repos/piotrmurach/tty-prompt/assignees{/user}","branches_url":"https://api.github.com/repos/piotrmurach/tty-prompt/branches{/branch}","tags_url":"https://api.github.com/repos/piotrmurach/tty-prompt/tags","blobs_url":"https://api.github.com/repos/piotrmurach/tty-prompt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/piotrmurach/tty-prompt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/piotrmurach/tty-prompt/git/refs{/sha}","trees_url":"https://api.github.com/repos/piotrmurach/tty-prompt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/piotrmurach/tty-prompt/statuses/{sha}","languages_url":"https://api.github.com/repos/piotrmurach/tty-prompt/languages","stargazers_url":"https://api.github.com/repos/piotrmurach/tty-prompt/stargazers","contributors_url":"https://api.github.com/repos/piotrmurach/tty-prompt/contributors","subscribers_url":"https://api.github.com/repos/piotrmurach/tty-prompt/subscribers","subscription_url":"https://api.github.com/repos/piotrmurach/tty-prompt/subscription","commits_url":"https://api.github.com/repos/piotrmurach/tty-prompt/commits{/sha}","git_commits_url":"https://api.github.com/repos/piotrmurach/tty-prompt/git/commits{/sha}","comments_url":"https://api.github.com/repos/piotrmurach/tty-prompt/comments{/number}","issue_comment_url":"https://api.github.com/repos/piotrmurach/tty-prompt/issues/comments{/number}","contents_url":"https://api.github.com/repos/piotrmurach/tty-prompt/contents/{+path}","compare_url":"https://api.github.com/repos/piotrmurach/tty-prompt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/piotrmurach/tty-prompt/merges","archive_url":"https://api.github.com/repos/piotrmurach/tty-prompt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/piotrmurach/tty-prompt/downloads","issues_url":"https://api.github.com/repos/piotrmurach/tty-prompt/issues{/number}","pulls_url":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls{/number}","milestones_url":"https://api.github.com/repos/piotrmurach/tty-prompt/milestones{/number}","notifications_url":"https://api.github.com/repos/piotrmurach/tty-prompt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/piotrmurach/tty-prompt/labels{/name}","releases_url":"https://api.github.com/repos/piotrmurach/tty-prompt/releases{/id}","deployments_url":"https://api.github.com/repos/piotrmurach/tty-prompt/deployments","created_at":"2015-11-01T17:40:57Z","updated_at":"2018-02-06T15:17:55Z","pushed_at":"2018-02-07T00:42:44Z","git_url":"git://github.com/piotrmurach/tty-prompt.git","ssh_url":"git@github.com:piotrmurach/tty-prompt.git","clone_url":"https://github.com/piotrmurach/tty-prompt.git","svn_url":"https://github.com/piotrmurach/tty-prompt","homepage":"https://piotrmurach.github.io/tty/","size":700,"stargazers_count":712,"watchers_count":712,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":43,"open_issues":9,"watchers":712,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/74"},"html":{"href":"https://github.com/piotrmurach/tty-prompt/pull/74"},"issue":{"href":"https://api.github.com/repos/piotrmurach/tty-prompt/issues/74"},"comments":{"href":"https://api.github.com/repos/piotrmurach/tty-prompt/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/piotrmurach/tty-prompt/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/piotrmurach/tty-prompt/statuses/292a79b00f04aac35693c50c3481dbbd9d1da56b"}},"author_association":"NONE"}}
{"actor":{"display_login":"houndci-bot"}}