{"action":"created","comment":{"url":"https://api.github.com/repos/bigcommerce/paper/pulls/comments/57393816","id":57393816,"diff_hunk":"@@ -0,0 +1,52 @@\n+var _ = require('lodash'),\n+    internals = {};\n+\n+/**\n+ * Yield block only if all arguments are valid\n+ *\n+ * @example\n+ * {{#all items theme_settings.optionA theme_settings.optionB}} ... {{/all}}\n+ */\n+\n+internals.implementation = function(handlebars) {\n+    this.handlebars = handlebars;\n+};\n+\n+internals.implementation.prototype.register = function(context) {\n+    this.handlebars.registerHelper('all', function () {\n+\n+        var args = [], opts, result;\n+\n+        // Translate arguments to array safely\n+        for (var i = 0; i < arguments.length; i++) {\n+            args.push(arguments[i]);\n+        }\n+\n+        // Take the last argument (content) out of testing array\n+        opts = args.pop();\n+\n+        // Check if all the arguments are valid / truthy\n+        result = _.all(args, function(arg) {","path":"helpers/all.js","position":29,"original_position":29,"commit_id":"ad12585ceaa069bf62a5421b07acc29f1ce508a3","original_commit_id":"ad12585ceaa069bf62a5421b07acc29f1ce508a3","user":{"login":"mickr","id":7842095,"avatar_url":"https://avatars.githubusercontent.com/u/7842095?v=3","gravatar_id":"","url":"https://api.github.com/users/mickr","html_url":"https://github.com/mickr","followers_url":"https://api.github.com/users/mickr/followers","following_url":"https://api.github.com/users/mickr/following{/other_user}","gists_url":"https://api.github.com/users/mickr/gists{/gist_id}","starred_url":"https://api.github.com/users/mickr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickr/subscriptions","organizations_url":"https://api.github.com/users/mickr/orgs","repos_url":"https://api.github.com/users/mickr/repos","events_url":"https://api.github.com/users/mickr/events{/privacy}","received_events_url":"https://api.github.com/users/mickr/received_events","type":"User","site_admin":false},"body":"I think this could be implemented with `Array.every` to cut the lodash dependency. :tropical_drink: ","created_at":"2016-03-24T21:51:33Z","updated_at":"2016-03-24T21:51:33Z","html_url":"https://github.com/bigcommerce/paper/pull/80#discussion_r57393816","pull_request_url":"https://api.github.com/repos/bigcommerce/paper/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/bigcommerce/paper/pulls/comments/57393816"},"html":{"href":"https://github.com/bigcommerce/paper/pull/80#discussion_r57393816"},"pull_request":{"href":"https://api.github.com/repos/bigcommerce/paper/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/bigcommerce/paper/pulls/80","id":63815424,"html_url":"https://github.com/bigcommerce/paper/pull/80","diff_url":"https://github.com/bigcommerce/paper/pull/80.diff","patch_url":"https://github.com/bigcommerce/paper/pull/80.patch","issue_url":"https://api.github.com/repos/bigcommerce/paper/issues/80","number":80,"state":"open","locked":false,"title":"Add #all helper for testing multiple conditions","user":{"login":"JemBijoux","id":8083892,"avatar_url":"https://avatars.githubusercontent.com/u/8083892?v=3","gravatar_id":"","url":"https://api.github.com/users/JemBijoux","html_url":"https://github.com/JemBijoux","followers_url":"https://api.github.com/users/JemBijoux/followers","following_url":"https://api.github.com/users/JemBijoux/following{/other_user}","gists_url":"https://api.github.com/users/JemBijoux/gists{/gist_id}","starred_url":"https://api.github.com/users/JemBijoux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JemBijoux/subscriptions","organizations_url":"https://api.github.com/users/JemBijoux/orgs","repos_url":"https://api.github.com/users/JemBijoux/repos","events_url":"https://api.github.com/users/JemBijoux/events{/privacy}","received_events_url":"https://api.github.com/users/JemBijoux/received_events","type":"User","site_admin":false},"body":"It's possible with handlebars currently to test against multiple\r\nconditions simply by nesting if loops. However, it becomes difficult\r\nwhen there are more than just a couple arguments that need to be\r\nnested, and it's not possible to use an else conditional for the event\r\nthat one is missing.\r\n\r\n- Add an #all helper that can be supplied multiple arguments and will\r\n  render the block so long as they're all \"truthy\"\r\n- Include some test coverage for the all helper.","created_at":"2016-03-23T00:33:41Z","updated_at":"2016-03-24T21:51:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"437add5d00b921b132180e8c88a06bff2f959707","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bigcommerce/paper/pulls/80/commits","review_comments_url":"https://api.github.com/repos/bigcommerce/paper/pulls/80/comments","review_comment_url":"https://api.github.com/repos/bigcommerce/paper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bigcommerce/paper/issues/80/comments","statuses_url":"https://api.github.com/repos/bigcommerce/paper/statuses/ad12585ceaa069bf62a5421b07acc29f1ce508a3","head":{"label":"JemBijoux:add-all-helper","ref":"add-all-helper","sha":"ad12585ceaa069bf62a5421b07acc29f1ce508a3","user":{"login":"JemBijoux","id":8083892,"avatar_url":"https://avatars.githubusercontent.com/u/8083892?v=3","gravatar_id":"","url":"https://api.github.com/users/JemBijoux","html_url":"https://github.com/JemBijoux","followers_url":"https://api.github.com/users/JemBijoux/followers","following_url":"https://api.github.com/users/JemBijoux/following{/other_user}","gists_url":"https://api.github.com/users/JemBijoux/gists{/gist_id}","starred_url":"https://api.github.com/users/JemBijoux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JemBijoux/subscriptions","organizations_url":"https://api.github.com/users/JemBijoux/orgs","repos_url":"https://api.github.com/users/JemBijoux/repos","events_url":"https://api.github.com/users/JemBijoux/events{/privacy}","received_events_url":"https://api.github.com/users/JemBijoux/received_events","type":"User","site_admin":false},"repo":{"id":53535243,"name":"paper","full_name":"JemBijoux/paper","owner":{"login":"JemBijoux","id":8083892,"avatar_url":"https://avatars.githubusercontent.com/u/8083892?v=3","gravatar_id":"","url":"https://api.github.com/users/JemBijoux","html_url":"https://github.com/JemBijoux","followers_url":"https://api.github.com/users/JemBijoux/followers","following_url":"https://api.github.com/users/JemBijoux/following{/other_user}","gists_url":"https://api.github.com/users/JemBijoux/gists{/gist_id}","starred_url":"https://api.github.com/users/JemBijoux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JemBijoux/subscriptions","organizations_url":"https://api.github.com/users/JemBijoux/orgs","repos_url":"https://api.github.com/users/JemBijoux/repos","events_url":"https://api.github.com/users/JemBijoux/events{/privacy}","received_events_url":"https://api.github.com/users/JemBijoux/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JemBijoux/paper","description":"Paper registers helpers and partials from handlebars and returns the compiled version.","fork":true,"url":"https://api.github.com/repos/JemBijoux/paper","forks_url":"https://api.github.com/repos/JemBijoux/paper/forks","keys_url":"https://api.github.com/repos/JemBijoux/paper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JemBijoux/paper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JemBijoux/paper/teams","hooks_url":"https://api.github.com/repos/JemBijoux/paper/hooks","issue_events_url":"https://api.github.com/repos/JemBijoux/paper/issues/events{/number}","events_url":"https://api.github.com/repos/JemBijoux/paper/events","assignees_url":"https://api.github.com/repos/JemBijoux/paper/assignees{/user}","branches_url":"https://api.github.com/repos/JemBijoux/paper/branches{/branch}","tags_url":"https://api.github.com/repos/JemBijoux/paper/tags","blobs_url":"https://api.github.com/repos/JemBijoux/paper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JemBijoux/paper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JemBijoux/paper/git/refs{/sha}","trees_url":"https://api.github.com/repos/JemBijoux/paper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JemBijoux/paper/statuses/{sha}","languages_url":"https://api.github.com/repos/JemBijoux/paper/languages","stargazers_url":"https://api.github.com/repos/JemBijoux/paper/stargazers","contributors_url":"https://api.github.com/repos/JemBijoux/paper/contributors","subscribers_url":"https://api.github.com/repos/JemBijoux/paper/subscribers","subscription_url":"https://api.github.com/repos/JemBijoux/paper/subscription","commits_url":"https://api.github.com/repos/JemBijoux/paper/commits{/sha}","git_commits_url":"https://api.github.com/repos/JemBijoux/paper/git/commits{/sha}","comments_url":"https://api.github.com/repos/JemBijoux/paper/comments{/number}","issue_comment_url":"https://api.github.com/repos/JemBijoux/paper/issues/comments{/number}","contents_url":"https://api.github.com/repos/JemBijoux/paper/contents/{+path}","compare_url":"https://api.github.com/repos/JemBijoux/paper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JemBijoux/paper/merges","archive_url":"https://api.github.com/repos/JemBijoux/paper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JemBijoux/paper/downloads","issues_url":"https://api.github.com/repos/JemBijoux/paper/issues{/number}","pulls_url":"https://api.github.com/repos/JemBijoux/paper/pulls{/number}","milestones_url":"https://api.github.com/repos/JemBijoux/paper/milestones{/number}","notifications_url":"https://api.github.com/repos/JemBijoux/paper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JemBijoux/paper/labels{/name}","releases_url":"https://api.github.com/repos/JemBijoux/paper/releases{/id}","deployments_url":"https://api.github.com/repos/JemBijoux/paper/deployments","created_at":"2016-03-09T22:05:02Z","updated_at":"2016-03-09T22:05:03Z","pushed_at":"2016-03-23T19:14:21Z","git_url":"git://github.com/JemBijoux/paper.git","ssh_url":"git@github.com:JemBijoux/paper.git","clone_url":"https://github.com/JemBijoux/paper.git","svn_url":"https://github.com/JemBijoux/paper","homepage":null,"size":140,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bigcommerce:master","ref":"master","sha":"c86ccecf87d8efe79a222847156634c1981d9c46","user":{"login":"bigcommerce","id":186342,"avatar_url":"https://avatars.githubusercontent.com/u/186342?v=3","gravatar_id":"","url":"https://api.github.com/users/bigcommerce","html_url":"https://github.com/bigcommerce","followers_url":"https://api.github.com/users/bigcommerce/followers","following_url":"https://api.github.com/users/bigcommerce/following{/other_user}","gists_url":"https://api.github.com/users/bigcommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/bigcommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigcommerce/subscriptions","organizations_url":"https://api.github.com/users/bigcommerce/orgs","repos_url":"https://api.github.com/users/bigcommerce/repos","events_url":"https://api.github.com/users/bigcommerce/events{/privacy}","received_events_url":"https://api.github.com/users/bigcommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":33561197,"name":"paper","full_name":"bigcommerce/paper","owner":{"login":"bigcommerce","id":186342,"avatar_url":"https://avatars.githubusercontent.com/u/186342?v=3","gravatar_id":"","url":"https://api.github.com/users/bigcommerce","html_url":"https://github.com/bigcommerce","followers_url":"https://api.github.com/users/bigcommerce/followers","following_url":"https://api.github.com/users/bigcommerce/following{/other_user}","gists_url":"https://api.github.com/users/bigcommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/bigcommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigcommerce/subscriptions","organizations_url":"https://api.github.com/users/bigcommerce/orgs","repos_url":"https://api.github.com/users/bigcommerce/repos","events_url":"https://api.github.com/users/bigcommerce/events{/privacy}","received_events_url":"https://api.github.com/users/bigcommerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bigcommerce/paper","description":"Paper registers helpers and partials from handlebars and returns the compiled version.","fork":false,"url":"https://api.github.com/repos/bigcommerce/paper","forks_url":"https://api.github.com/repos/bigcommerce/paper/forks","keys_url":"https://api.github.com/repos/bigcommerce/paper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bigcommerce/paper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bigcommerce/paper/teams","hooks_url":"https://api.github.com/repos/bigcommerce/paper/hooks","issue_events_url":"https://api.github.com/repos/bigcommerce/paper/issues/events{/number}","events_url":"https://api.github.com/repos/bigcommerce/paper/events","assignees_url":"https://api.github.com/repos/bigcommerce/paper/assignees{/user}","branches_url":"https://api.github.com/repos/bigcommerce/paper/branches{/branch}","tags_url":"https://api.github.com/repos/bigcommerce/paper/tags","blobs_url":"https://api.github.com/repos/bigcommerce/paper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bigcommerce/paper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bigcommerce/paper/git/refs{/sha}","trees_url":"https://api.github.com/repos/bigcommerce/paper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bigcommerce/paper/statuses/{sha}","languages_url":"https://api.github.com/repos/bigcommerce/paper/languages","stargazers_url":"https://api.github.com/repos/bigcommerce/paper/stargazers","contributors_url":"https://api.github.com/repos/bigcommerce/paper/contributors","subscribers_url":"https://api.github.com/repos/bigcommerce/paper/subscribers","subscription_url":"https://api.github.com/repos/bigcommerce/paper/subscription","commits_url":"https://api.github.com/repos/bigcommerce/paper/commits{/sha}","git_commits_url":"https://api.github.com/repos/bigcommerce/paper/git/commits{/sha}","comments_url":"https://api.github.com/repos/bigcommerce/paper/comments{/number}","issue_comment_url":"https://api.github.com/repos/bigcommerce/paper/issues/comments{/number}","contents_url":"https://api.github.com/repos/bigcommerce/paper/contents/{+path}","compare_url":"https://api.github.com/repos/bigcommerce/paper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bigcommerce/paper/merges","archive_url":"https://api.github.com/repos/bigcommerce/paper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bigcommerce/paper/downloads","issues_url":"https://api.github.com/repos/bigcommerce/paper/issues{/number}","pulls_url":"https://api.github.com/repos/bigcommerce/paper/pulls{/number}","milestones_url":"https://api.github.com/repos/bigcommerce/paper/milestones{/number}","notifications_url":"https://api.github.com/repos/bigcommerce/paper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bigcommerce/paper/labels{/name}","releases_url":"https://api.github.com/repos/bigcommerce/paper/releases{/id}","deployments_url":"https://api.github.com/repos/bigcommerce/paper/deployments","created_at":"2015-04-07T18:37:53Z","updated_at":"2016-03-10T03:48:47Z","pushed_at":"2016-03-24T19:00:45Z","git_url":"git://github.com/bigcommerce/paper.git","ssh_url":"git@github.com:bigcommerce/paper.git","clone_url":"https://github.com/bigcommerce/paper.git","svn_url":"https://github.com/bigcommerce/paper","homepage":null,"size":172,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bigcommerce/paper/pulls/80"},"html":{"href":"https://github.com/bigcommerce/paper/pull/80"},"issue":{"href":"https://api.github.com/repos/bigcommerce/paper/issues/80"},"comments":{"href":"https://api.github.com/repos/bigcommerce/paper/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/bigcommerce/paper/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/bigcommerce/paper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bigcommerce/paper/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/bigcommerce/paper/statuses/ad12585ceaa069bf62a5421b07acc29f1ce508a3"}}}}