{"action":"created","comment":{"url":"https://api.github.com/repos/usefulio/pipes/pulls/comments/36803919","id":36803919,"diff_hunk":"@@ -4,47 +4,56 @@\n  * @constructor\n  * @self pipes\n  * @type Pipes\n- * @param {Array} pipelineNames An ordered list of names for the consequent execution pipelines.\n- *  The actions assigned to the first named pipeline will be executed initially, the actions assigned to the 2nd pipeline will be executed when pipeline one is completed etc.\n- *  e.g. var myPipe = new Pipes (\"before\", \"action\", \"after\");\n+ * @param {Array} stageNames An ordered list of default stages for all the pipes that are created.\n+ *  The actions assigned to the first named stage will be executed initially, the actions assigned to the 2nd stage will be executed when stage one is completed etc.\n+ *  e.g. \n+ *  ```\n+ *  var myPipe = new Pipes (\"before\", \"action\", \"after\");\n+ *  myPipe.on(\"default\",\"before\",function (options) {\n+ *   return options;\n+ *  });\n+ *\n+ *  myPipe.on(\"default\",\"action\",function (options) {\n+ *   return options;\n+ *  });\n+ *  ...\n+ *  ```\n  *  \"before\" actions will be executed 1st, \"action\" 2nd and \"after\" 3rd.\n- *  See the docs for Pipes.prototype.on on how to attach actions to pipelines. \n+ *  See the docs for Pipes.prototype.on on how to attach actions to pipes. \n  */\n Pipes = function () {\n-  var pipelines = _.flatten(_.toArray(arguments))\n+  var stages = _.flatten(_.toArray(arguments))\n \n-  var isEmpty = (pipelines.length < 1);\n-  var pipelineNamesAreNotStrings = !! _.find(pipelines, function (pipeline) { return ! _.isString(pipeline); });\n-  var pipelineNamesAreNotUnique = !! _.find(pipelines, function(pipeline, index, allPipelines) {\n-    var nameCount = _.filter(allPipelines, function (stg) { return stg === pipeline; });\n+  var isEmpty = (stages.length < 1);\n+  var stageNamesAreNotStrings = !! _.find(stages, function (stage) { return ! _.isString(stage); });\n+  var stageNamesAreNotUnique = !! _.find(stages, function(stage, index, allPipelines) {\n+    var nameCount = _.filter(allPipelines, function (stg) { return stg === stage; });\n     return nameCount.length != 1;\n   });\n \n-  if ( isEmpty && pipelineNamesAreNotStrings ) {\n-    throw new Meteor.Error(\"invalid-arguments\",\"pipelineNames argument does not exist or is not an Array\");\n-  } else if ( pipelineNamesAreNotUnique ) {\n-    throw new Meteor.Error(\"duplicate-pipelinenames\",\"pipelineNames must be unique\");\n+  if ( isEmpty && stageNamesAreNotStrings ) {\n+    throw new Meteor.Error(\"invalid-arguments\",\"stageNames argument does not exist or is not an Array\");","path":"pipes.js","position":45,"original_position":45,"commit_id":"cc2b2b482347f474dfd788644cb1fc352ad7187c","original_commit_id":"cc2b2b482347f474dfd788644cb1fc352ad7187c","user":{"login":"cwohlman","id":4643896,"avatar_url":"https://avatars.githubusercontent.com/u/4643896?v=3","gravatar_id":"","url":"https://api.github.com/users/cwohlman","html_url":"https://github.com/cwohlman","followers_url":"https://api.github.com/users/cwohlman/followers","following_url":"https://api.github.com/users/cwohlman/following{/other_user}","gists_url":"https://api.github.com/users/cwohlman/gists{/gist_id}","starred_url":"https://api.github.com/users/cwohlman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwohlman/subscriptions","organizations_url":"https://api.github.com/users/cwohlman/orgs","repos_url":"https://api.github.com/users/cwohlman/repos","events_url":"https://api.github.com/users/cwohlman/events{/privacy}","received_events_url":"https://api.github.com/users/cwohlman/received_events","type":"User","site_admin":false},"body":"` or is not an array of strings`","created_at":"2015-08-11T21:51:55Z","updated_at":"2015-08-11T21:51:55Z","html_url":"https://github.com/usefulio/pipes/pull/2#discussion_r36803919","pull_request_url":"https://api.github.com/repos/usefulio/pipes/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/usefulio/pipes/pulls/comments/36803919"},"html":{"href":"https://github.com/usefulio/pipes/pull/2#discussion_r36803919"},"pull_request":{"href":"https://api.github.com/repos/usefulio/pipes/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/usefulio/pipes/pulls/2","id":42177898,"html_url":"https://github.com/usefulio/pipes/pull/2","diff_url":"https://github.com/usefulio/pipes/pull/2.diff","patch_url":"https://github.com/usefulio/pipes/pull/2.patch","issue_url":"https://api.github.com/repos/usefulio/pipes/issues/2","number":2,"state":"open","locked":false,"title":"implements predefined stages for all cues","user":{"login":"gevou","id":301764,"avatar_url":"https://avatars.githubusercontent.com/u/301764?v=3","gravatar_id":"","url":"https://api.github.com/users/gevou","html_url":"https://github.com/gevou","followers_url":"https://api.github.com/users/gevou/followers","following_url":"https://api.github.com/users/gevou/following{/other_user}","gists_url":"https://api.github.com/users/gevou/gists{/gist_id}","starred_url":"https://api.github.com/users/gevou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gevou/subscriptions","organizations_url":"https://api.github.com/users/gevou/orgs","repos_url":"https://api.github.com/users/gevou/repos","events_url":"https://api.github.com/users/gevou/events{/privacy}","received_events_url":"https://api.github.com/users/gevou/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-11T21:05:48Z","updated_at":"2015-08-11T21:51:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c2233f516330b992f9b91a02737aad2abdd462b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/usefulio/pipes/pulls/2/commits","review_comments_url":"https://api.github.com/repos/usefulio/pipes/pulls/2/comments","review_comment_url":"https://api.github.com/repos/usefulio/pipes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/usefulio/pipes/issues/2/comments","statuses_url":"https://api.github.com/repos/usefulio/pipes/statuses/cc2b2b482347f474dfd788644cb1fc352ad7187c","head":{"label":"usefulio:predefinedStages","ref":"predefinedStages","sha":"cc2b2b482347f474dfd788644cb1fc352ad7187c","user":{"login":"usefulio","id":6901332,"avatar_url":"https://avatars.githubusercontent.com/u/6901332?v=3","gravatar_id":"","url":"https://api.github.com/users/usefulio","html_url":"https://github.com/usefulio","followers_url":"https://api.github.com/users/usefulio/followers","following_url":"https://api.github.com/users/usefulio/following{/other_user}","gists_url":"https://api.github.com/users/usefulio/gists{/gist_id}","starred_url":"https://api.github.com/users/usefulio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usefulio/subscriptions","organizations_url":"https://api.github.com/users/usefulio/orgs","repos_url":"https://api.github.com/users/usefulio/repos","events_url":"https://api.github.com/users/usefulio/events{/privacy}","received_events_url":"https://api.github.com/users/usefulio/received_events","type":"Organization","site_admin":false},"repo":{"id":40505443,"name":"pipes","full_name":"usefulio/pipes","owner":{"login":"usefulio","id":6901332,"avatar_url":"https://avatars.githubusercontent.com/u/6901332?v=3","gravatar_id":"","url":"https://api.github.com/users/usefulio","html_url":"https://github.com/usefulio","followers_url":"https://api.github.com/users/usefulio/followers","following_url":"https://api.github.com/users/usefulio/following{/other_user}","gists_url":"https://api.github.com/users/usefulio/gists{/gist_id}","starred_url":"https://api.github.com/users/usefulio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usefulio/subscriptions","organizations_url":"https://api.github.com/users/usefulio/orgs","repos_url":"https://api.github.com/users/usefulio/repos","events_url":"https://api.github.com/users/usefulio/events{/privacy}","received_events_url":"https://api.github.com/users/usefulio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/usefulio/pipes","description":"Compos-able processing pipelines","fork":false,"url":"https://api.github.com/repos/usefulio/pipes","forks_url":"https://api.github.com/repos/usefulio/pipes/forks","keys_url":"https://api.github.com/repos/usefulio/pipes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/usefulio/pipes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/usefulio/pipes/teams","hooks_url":"https://api.github.com/repos/usefulio/pipes/hooks","issue_events_url":"https://api.github.com/repos/usefulio/pipes/issues/events{/number}","events_url":"https://api.github.com/repos/usefulio/pipes/events","assignees_url":"https://api.github.com/repos/usefulio/pipes/assignees{/user}","branches_url":"https://api.github.com/repos/usefulio/pipes/branches{/branch}","tags_url":"https://api.github.com/repos/usefulio/pipes/tags","blobs_url":"https://api.github.com/repos/usefulio/pipes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/usefulio/pipes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/usefulio/pipes/git/refs{/sha}","trees_url":"https://api.github.com/repos/usefulio/pipes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/usefulio/pipes/statuses/{sha}","languages_url":"https://api.github.com/repos/usefulio/pipes/languages","stargazers_url":"https://api.github.com/repos/usefulio/pipes/stargazers","contributors_url":"https://api.github.com/repos/usefulio/pipes/contributors","subscribers_url":"https://api.github.com/repos/usefulio/pipes/subscribers","subscription_url":"https://api.github.com/repos/usefulio/pipes/subscription","commits_url":"https://api.github.com/repos/usefulio/pipes/commits{/sha}","git_commits_url":"https://api.github.com/repos/usefulio/pipes/git/commits{/sha}","comments_url":"https://api.github.com/repos/usefulio/pipes/comments{/number}","issue_comment_url":"https://api.github.com/repos/usefulio/pipes/issues/comments{/number}","contents_url":"https://api.github.com/repos/usefulio/pipes/contents/{+path}","compare_url":"https://api.github.com/repos/usefulio/pipes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/usefulio/pipes/merges","archive_url":"https://api.github.com/repos/usefulio/pipes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/usefulio/pipes/downloads","issues_url":"https://api.github.com/repos/usefulio/pipes/issues{/number}","pulls_url":"https://api.github.com/repos/usefulio/pipes/pulls{/number}","milestones_url":"https://api.github.com/repos/usefulio/pipes/milestones{/number}","notifications_url":"https://api.github.com/repos/usefulio/pipes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/usefulio/pipes/labels{/name}","releases_url":"https://api.github.com/repos/usefulio/pipes/releases{/id}","created_at":"2015-08-10T20:48:57Z","updated_at":"2015-08-11T15:41:28Z","pushed_at":"2015-08-11T21:22:43Z","git_url":"git://github.com/usefulio/pipes.git","ssh_url":"git@github.com:usefulio/pipes.git","clone_url":"https://github.com/usefulio/pipes.git","svn_url":"https://github.com/usefulio/pipes","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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"usefulio:master","ref":"master","sha":"8e0a0c3e6630ee8fc096fe82788b9381ef5924bc","user":{"login":"usefulio","id":6901332,"avatar_url":"https://avatars.githubusercontent.com/u/6901332?v=3","gravatar_id":"","url":"https://api.github.com/users/usefulio","html_url":"https://github.com/usefulio","followers_url":"https://api.github.com/users/usefulio/followers","following_url":"https://api.github.com/users/usefulio/following{/other_user}","gists_url":"https://api.github.com/users/usefulio/gists{/gist_id}","starred_url":"https://api.github.com/users/usefulio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usefulio/subscriptions","organizations_url":"https://api.github.com/users/usefulio/orgs","repos_url":"https://api.github.com/users/usefulio/repos","events_url":"https://api.github.com/users/usefulio/events{/privacy}","received_events_url":"https://api.github.com/users/usefulio/received_events","type":"Organization","site_admin":false},"repo":{"id":40505443,"name":"pipes","full_name":"usefulio/pipes","owner":{"login":"usefulio","id":6901332,"avatar_url":"https://avatars.githubusercontent.com/u/6901332?v=3","gravatar_id":"","url":"https://api.github.com/users/usefulio","html_url":"https://github.com/usefulio","followers_url":"https://api.github.com/users/usefulio/followers","following_url":"https://api.github.com/users/usefulio/following{/other_user}","gists_url":"https://api.github.com/users/usefulio/gists{/gist_id}","starred_url":"https://api.github.com/users/usefulio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usefulio/subscriptions","organizations_url":"https://api.github.com/users/usefulio/orgs","repos_url":"https://api.github.com/users/usefulio/repos","events_url":"https://api.github.com/users/usefulio/events{/privacy}","received_events_url":"https://api.github.com/users/usefulio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/usefulio/pipes","description":"Compos-able processing pipelines","fork":false,"url":"https://api.github.com/repos/usefulio/pipes","forks_url":"https://api.github.com/repos/usefulio/pipes/forks","keys_url":"https://api.github.com/repos/usefulio/pipes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/usefulio/pipes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/usefulio/pipes/teams","hooks_url":"https://api.github.com/repos/usefulio/pipes/hooks","issue_events_url":"https://api.github.com/repos/usefulio/pipes/issues/events{/number}","events_url":"https://api.github.com/repos/usefulio/pipes/events","assignees_url":"https://api.github.com/repos/usefulio/pipes/assignees{/user}","branches_url":"https://api.github.com/repos/usefulio/pipes/branches{/branch}","tags_url":"https://api.github.com/repos/usefulio/pipes/tags","blobs_url":"https://api.github.com/repos/usefulio/pipes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/usefulio/pipes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/usefulio/pipes/git/refs{/sha}","trees_url":"https://api.github.com/repos/usefulio/pipes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/usefulio/pipes/statuses/{sha}","languages_url":"https://api.github.com/repos/usefulio/pipes/languages","stargazers_url":"https://api.github.com/repos/usefulio/pipes/stargazers","contributors_url":"https://api.github.com/repos/usefulio/pipes/contributors","subscribers_url":"https://api.github.com/repos/usefulio/pipes/subscribers","subscription_url":"https://api.github.com/repos/usefulio/pipes/subscription","commits_url":"https://api.github.com/repos/usefulio/pipes/commits{/sha}","git_commits_url":"https://api.github.com/repos/usefulio/pipes/git/commits{/sha}","comments_url":"https://api.github.com/repos/usefulio/pipes/comments{/number}","issue_comment_url":"https://api.github.com/repos/usefulio/pipes/issues/comments{/number}","contents_url":"https://api.github.com/repos/usefulio/pipes/contents/{+path}","compare_url":"https://api.github.com/repos/usefulio/pipes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/usefulio/pipes/merges","archive_url":"https://api.github.com/repos/usefulio/pipes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/usefulio/pipes/downloads","issues_url":"https://api.github.com/repos/usefulio/pipes/issues{/number}","pulls_url":"https://api.github.com/repos/usefulio/pipes/pulls{/number}","milestones_url":"https://api.github.com/repos/usefulio/pipes/milestones{/number}","notifications_url":"https://api.github.com/repos/usefulio/pipes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/usefulio/pipes/labels{/name}","releases_url":"https://api.github.com/repos/usefulio/pipes/releases{/id}","created_at":"2015-08-10T20:48:57Z","updated_at":"2015-08-11T15:41:28Z","pushed_at":"2015-08-11T21:22:43Z","git_url":"git://github.com/usefulio/pipes.git","ssh_url":"git@github.com:usefulio/pipes.git","clone_url":"https://github.com/usefulio/pipes.git","svn_url":"https://github.com/usefulio/pipes","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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/usefulio/pipes/pulls/2"},"html":{"href":"https://github.com/usefulio/pipes/pull/2"},"issue":{"href":"https://api.github.com/repos/usefulio/pipes/issues/2"},"comments":{"href":"https://api.github.com/repos/usefulio/pipes/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/usefulio/pipes/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/usefulio/pipes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/usefulio/pipes/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/usefulio/pipes/statuses/cc2b2b482347f474dfd788644cb1fc352ad7187c"}}}}