{"action":"closed","number":120,"pull_request":{"url":"https://api.github.com/repos/Wyamio/Wyam/pulls/120","id":50118230,"html_url":"https://github.com/Wyamio/Wyam/pull/120","diff_url":"https://github.com/Wyamio/Wyam/pull/120.diff","patch_url":"https://github.com/Wyamio/Wyam/pull/120.patch","issue_url":"https://api.github.com/repos/Wyamio/Wyam/issues/120","number":120,"state":"closed","locked":false,"title":"Added Switch module to support switch-statement logic for modules","user":{"login":"reliak","id":4062774,"avatar_url":"https://avatars.githubusercontent.com/u/4062774?v=3","gravatar_id":"","url":"https://api.github.com/users/reliak","html_url":"https://github.com/reliak","followers_url":"https://api.github.com/users/reliak/followers","following_url":"https://api.github.com/users/reliak/following{/other_user}","gists_url":"https://api.github.com/users/reliak/gists{/gist_id}","starred_url":"https://api.github.com/users/reliak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reliak/subscriptions","organizations_url":"https://api.github.com/users/reliak/orgs","repos_url":"https://api.github.com/users/reliak/repos","events_url":"https://api.github.com/users/reliak/events{/privacy}","received_events_url":"https://api.github.com/users/reliak/received_events","type":"User","site_admin":false},"body":"This module should make cases easier, where a `If` module would be too verbose, i.e. to reduce redundant code.\r\nAn example would be to use the `Switch` module, to do certain operations depending on the file extension.\r\nSuch an example is shown below:\r\n```\r\n// assuming we have four input files: test.txt, test.css, test.xml and test.js,\r\n// which all contain the text \"test\"\r\nPipelines.Add(\"SwitchDemo\",\r\n\tReadFiles(\"*.*\"),\r\n\tSwitch( ((string)@doc[\"SourceFileExt\"]).ToLower() )\r\n\t.Case(\".js\", ReplaceIn(\"test\", \"js\"))\r\n\t.Case(new []{\".txt\", \".css\"}, ReplaceIn(\"test\", \"txt or css\"))\r\n\t.Default(ReplaceIn(\"test\", \"default for all other extensions\")),\r\n\tWriteFiles()\r\n);\r\n```\r\nThe fluent `Default` method is optional. Without `Default` method, any document that is not catched by the defined cases, will not be modified.","created_at":"2015-11-09T12:48:39Z","updated_at":"2015-11-09T15:51:38Z","closed_at":"2015-11-09T15:51:38Z","merged_at":"2015-11-09T15:51:38Z","merge_commit_sha":"0ac78261d96b01fb645d9898337295947a587e0c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wyamio/Wyam/pulls/120/commits","review_comments_url":"https://api.github.com/repos/Wyamio/Wyam/pulls/120/comments","review_comment_url":"https://api.github.com/repos/Wyamio/Wyam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wyamio/Wyam/issues/120/comments","statuses_url":"https://api.github.com/repos/Wyamio/Wyam/statuses/2dc2f0979eacb271c664c1f51484db4122190160","head":{"label":"reliak:dev-switchmodule","ref":"dev-switchmodule","sha":"2dc2f0979eacb271c664c1f51484db4122190160","user":{"login":"reliak","id":4062774,"avatar_url":"https://avatars.githubusercontent.com/u/4062774?v=3","gravatar_id":"","url":"https://api.github.com/users/reliak","html_url":"https://github.com/reliak","followers_url":"https://api.github.com/users/reliak/followers","following_url":"https://api.github.com/users/reliak/following{/other_user}","gists_url":"https://api.github.com/users/reliak/gists{/gist_id}","starred_url":"https://api.github.com/users/reliak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reliak/subscriptions","organizations_url":"https://api.github.com/users/reliak/orgs","repos_url":"https://api.github.com/users/reliak/repos","events_url":"https://api.github.com/users/reliak/events{/privacy}","received_events_url":"https://api.github.com/users/reliak/received_events","type":"User","site_admin":false},"repo":{"id":45611696,"name":"Wyam","full_name":"reliak/Wyam","owner":{"login":"reliak","id":4062774,"avatar_url":"https://avatars.githubusercontent.com/u/4062774?v=3","gravatar_id":"","url":"https://api.github.com/users/reliak","html_url":"https://github.com/reliak","followers_url":"https://api.github.com/users/reliak/followers","following_url":"https://api.github.com/users/reliak/following{/other_user}","gists_url":"https://api.github.com/users/reliak/gists{/gist_id}","starred_url":"https://api.github.com/users/reliak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reliak/subscriptions","organizations_url":"https://api.github.com/users/reliak/orgs","repos_url":"https://api.github.com/users/reliak/repos","events_url":"https://api.github.com/users/reliak/events{/privacy}","received_events_url":"https://api.github.com/users/reliak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reliak/Wyam","description":"A modular static content and static site generator.","fork":true,"url":"https://api.github.com/repos/reliak/Wyam","forks_url":"https://api.github.com/repos/reliak/Wyam/forks","keys_url":"https://api.github.com/repos/reliak/Wyam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reliak/Wyam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reliak/Wyam/teams","hooks_url":"https://api.github.com/repos/reliak/Wyam/hooks","issue_events_url":"https://api.github.com/repos/reliak/Wyam/issues/events{/number}","events_url":"https://api.github.com/repos/reliak/Wyam/events","assignees_url":"https://api.github.com/repos/reliak/Wyam/assignees{/user}","branches_url":"https://api.github.com/repos/reliak/Wyam/branches{/branch}","tags_url":"https://api.github.com/repos/reliak/Wyam/tags","blobs_url":"https://api.github.com/repos/reliak/Wyam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reliak/Wyam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reliak/Wyam/git/refs{/sha}","trees_url":"https://api.github.com/repos/reliak/Wyam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reliak/Wyam/statuses/{sha}","languages_url":"https://api.github.com/repos/reliak/Wyam/languages","stargazers_url":"https://api.github.com/repos/reliak/Wyam/stargazers","contributors_url":"https://api.github.com/repos/reliak/Wyam/contributors","subscribers_url":"https://api.github.com/repos/reliak/Wyam/subscribers","subscription_url":"https://api.github.com/repos/reliak/Wyam/subscription","commits_url":"https://api.github.com/repos/reliak/Wyam/commits{/sha}","git_commits_url":"https://api.github.com/repos/reliak/Wyam/git/commits{/sha}","comments_url":"https://api.github.com/repos/reliak/Wyam/comments{/number}","issue_comment_url":"https://api.github.com/repos/reliak/Wyam/issues/comments{/number}","contents_url":"https://api.github.com/repos/reliak/Wyam/contents/{+path}","compare_url":"https://api.github.com/repos/reliak/Wyam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reliak/Wyam/merges","archive_url":"https://api.github.com/repos/reliak/Wyam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reliak/Wyam/downloads","issues_url":"https://api.github.com/repos/reliak/Wyam/issues{/number}","pulls_url":"https://api.github.com/repos/reliak/Wyam/pulls{/number}","milestones_url":"https://api.github.com/repos/reliak/Wyam/milestones{/number}","notifications_url":"https://api.github.com/repos/reliak/Wyam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reliak/Wyam/labels{/name}","releases_url":"https://api.github.com/repos/reliak/Wyam/releases{/id}","created_at":"2015-11-05T13:05:13Z","updated_at":"2015-11-05T13:05:16Z","pushed_at":"2015-11-09T15:06:00Z","git_url":"git://github.com/reliak/Wyam.git","ssh_url":"git@github.com:reliak/Wyam.git","clone_url":"https://github.com/reliak/Wyam.git","svn_url":"https://github.com/reliak/Wyam","homepage":"http://wyam.io","size":23317,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"Wyamio:develop","ref":"develop","sha":"bcd565b27e312c6023ca715477ec13dd97d1347f","user":{"login":"Wyamio","id":12833932,"avatar_url":"https://avatars.githubusercontent.com/u/12833932?v=3","gravatar_id":"","url":"https://api.github.com/users/Wyamio","html_url":"https://github.com/Wyamio","followers_url":"https://api.github.com/users/Wyamio/followers","following_url":"https://api.github.com/users/Wyamio/following{/other_user}","gists_url":"https://api.github.com/users/Wyamio/gists{/gist_id}","starred_url":"https://api.github.com/users/Wyamio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wyamio/subscriptions","organizations_url":"https://api.github.com/users/Wyamio/orgs","repos_url":"https://api.github.com/users/Wyamio/repos","events_url":"https://api.github.com/users/Wyamio/events{/privacy}","received_events_url":"https://api.github.com/users/Wyamio/received_events","type":"Organization","site_admin":false},"repo":{"id":24330295,"name":"Wyam","full_name":"Wyamio/Wyam","owner":{"login":"Wyamio","id":12833932,"avatar_url":"https://avatars.githubusercontent.com/u/12833932?v=3","gravatar_id":"","url":"https://api.github.com/users/Wyamio","html_url":"https://github.com/Wyamio","followers_url":"https://api.github.com/users/Wyamio/followers","following_url":"https://api.github.com/users/Wyamio/following{/other_user}","gists_url":"https://api.github.com/users/Wyamio/gists{/gist_id}","starred_url":"https://api.github.com/users/Wyamio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wyamio/subscriptions","organizations_url":"https://api.github.com/users/Wyamio/orgs","repos_url":"https://api.github.com/users/Wyamio/repos","events_url":"https://api.github.com/users/Wyamio/events{/privacy}","received_events_url":"https://api.github.com/users/Wyamio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wyamio/Wyam","description":"A modular static content and static site generator.","fork":false,"url":"https://api.github.com/repos/Wyamio/Wyam","forks_url":"https://api.github.com/repos/Wyamio/Wyam/forks","keys_url":"https://api.github.com/repos/Wyamio/Wyam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wyamio/Wyam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wyamio/Wyam/teams","hooks_url":"https://api.github.com/repos/Wyamio/Wyam/hooks","issue_events_url":"https://api.github.com/repos/Wyamio/Wyam/issues/events{/number}","events_url":"https://api.github.com/repos/Wyamio/Wyam/events","assignees_url":"https://api.github.com/repos/Wyamio/Wyam/assignees{/user}","branches_url":"https://api.github.com/repos/Wyamio/Wyam/branches{/branch}","tags_url":"https://api.github.com/repos/Wyamio/Wyam/tags","blobs_url":"https://api.github.com/repos/Wyamio/Wyam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wyamio/Wyam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wyamio/Wyam/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wyamio/Wyam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wyamio/Wyam/statuses/{sha}","languages_url":"https://api.github.com/repos/Wyamio/Wyam/languages","stargazers_url":"https://api.github.com/repos/Wyamio/Wyam/stargazers","contributors_url":"https://api.github.com/repos/Wyamio/Wyam/contributors","subscribers_url":"https://api.github.com/repos/Wyamio/Wyam/subscribers","subscription_url":"https://api.github.com/repos/Wyamio/Wyam/subscription","commits_url":"https://api.github.com/repos/Wyamio/Wyam/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wyamio/Wyam/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wyamio/Wyam/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wyamio/Wyam/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wyamio/Wyam/contents/{+path}","compare_url":"https://api.github.com/repos/Wyamio/Wyam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wyamio/Wyam/merges","archive_url":"https://api.github.com/repos/Wyamio/Wyam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wyamio/Wyam/downloads","issues_url":"https://api.github.com/repos/Wyamio/Wyam/issues{/number}","pulls_url":"https://api.github.com/repos/Wyamio/Wyam/pulls{/number}","milestones_url":"https://api.github.com/repos/Wyamio/Wyam/milestones{/number}","notifications_url":"https://api.github.com/repos/Wyamio/Wyam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wyamio/Wyam/labels{/name}","releases_url":"https://api.github.com/repos/Wyamio/Wyam/releases{/id}","created_at":"2014-09-22T13:45:30Z","updated_at":"2015-11-09T14:20:51Z","pushed_at":"2015-11-09T15:51:38Z","git_url":"git://github.com/Wyamio/Wyam.git","ssh_url":"git@github.com:Wyamio/Wyam.git","clone_url":"https://github.com/Wyamio/Wyam.git","svn_url":"https://github.com/Wyamio/Wyam","homepage":"http://wyam.io","size":23981,"stargazers_count":83,"watchers_count":83,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":51,"forks":16,"open_issues":51,"watchers":83,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Wyamio/Wyam/pulls/120"},"html":{"href":"https://github.com/Wyamio/Wyam/pull/120"},"issue":{"href":"https://api.github.com/repos/Wyamio/Wyam/issues/120"},"comments":{"href":"https://api.github.com/repos/Wyamio/Wyam/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/Wyamio/Wyam/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/Wyamio/Wyam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wyamio/Wyam/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/Wyamio/Wyam/statuses/2dc2f0979eacb271c664c1f51484db4122190160"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"daveaglick","id":1020407,"avatar_url":"https://avatars.githubusercontent.com/u/1020407?v=3","gravatar_id":"","url":"https://api.github.com/users/daveaglick","html_url":"https://github.com/daveaglick","followers_url":"https://api.github.com/users/daveaglick/followers","following_url":"https://api.github.com/users/daveaglick/following{/other_user}","gists_url":"https://api.github.com/users/daveaglick/gists{/gist_id}","starred_url":"https://api.github.com/users/daveaglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveaglick/subscriptions","organizations_url":"https://api.github.com/users/daveaglick/orgs","repos_url":"https://api.github.com/users/daveaglick/repos","events_url":"https://api.github.com/users/daveaglick/events{/privacy}","received_events_url":"https://api.github.com/users/daveaglick/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":2,"additions":213,"deletions":0,"changed_files":4}}