{"action":"created","comment":{"url":"https://api.github.com/repos/househappy/floorplan/pulls/comments/51947456","id":51947456,"diff_hunk":"@@ -5,57 +5,74 @@ defmodule Floorplan.FileBuilder do\n   Takes a list of UrlLink structs and writes to file\n   \"\"\"\n \n-  alias Floorplan.FileCounter\n-  alias Floorplan.FileList\n   alias Floorplan.Utilities\n \n-  def build(url_links) do\n-    file_number = FileCounter.increment\n-    url_count   = Dict.size(url_links)\n-    filename    = if Application.get_env(:floorplan, :test) do\n-      \"tmp/test_sitemap#{file_number}.xml\"\n-    else\n-      \"tmp/sitemap#{file_number}.xml\"\n-    end\n-    FileList.push({filename, :in_progress, url_count})\n-\n-    case write_url_links_to_file(filename, url_links) do\n-      {:ok, :ok} ->\n-        {:ok, compressed_filename} = Utilities.compress(filename)\n-\n-        Logger.info \"✓ #{compressed_filename}  -- #{url_count} urls\"\n-        FileList.replace(filename, {compressed_filename, :completed, url_count})\n-      _ ->\n-        Logger.info \"✕ #{filename}  -- #{url_count} urls\"\n-        FileList.push({filename, :failed, url_count})\n-    end\n-\n-    if compressed_filename do\n-      {:ok, compressed_filename}\n-    else\n-      {:error, filename}\n-    end\n+  defmodule Context do\n+    defstruct target_directory: \"tmp\",\n+              urls_per_file: 50_000,\n+              base_url: \"http://www.example.com\",\n+              sitemap_files: [], # Set by Generator\n+              urls: [\n+                %Floorplan.Url{location: \"/foo/bar.html\"}","path":"lib/file_builder.ex","position":40,"original_position":40,"commit_id":"9a09267ec6d5ae1c3237bf3adfee4bb0274d8fa0","original_commit_id":"9a09267ec6d5ae1c3237bf3adfee4bb0274d8fa0","user":{"login":"theoretick","id":1449707,"avatar_url":"https://avatars.githubusercontent.com/u/1449707?v=3","gravatar_id":"","url":"https://api.github.com/users/theoretick","html_url":"https://github.com/theoretick","followers_url":"https://api.github.com/users/theoretick/followers","following_url":"https://api.github.com/users/theoretick/following{/other_user}","gists_url":"https://api.github.com/users/theoretick/gists{/gist_id}","starred_url":"https://api.github.com/users/theoretick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theoretick/subscriptions","organizations_url":"https://api.github.com/users/theoretick/orgs","repos_url":"https://api.github.com/users/theoretick/repos","events_url":"https://api.github.com/users/theoretick/events{/privacy}","received_events_url":"https://api.github.com/users/theoretick/received_events","type":"User","site_admin":false},"body":"It seems potentially problematic to define the defaults with example data instead of just `\"\"`.  If these attributes are not overwritten then we are generating fake data in non-test usage","created_at":"2016-02-04T22:21:04Z","updated_at":"2016-02-04T22:21:04Z","html_url":"https://github.com/househappy/floorplan/pull/1#discussion_r51947456","pull_request_url":"https://api.github.com/repos/househappy/floorplan/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/househappy/floorplan/pulls/comments/51947456"},"html":{"href":"https://github.com/househappy/floorplan/pull/1#discussion_r51947456"},"pull_request":{"href":"https://api.github.com/repos/househappy/floorplan/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/househappy/floorplan/pulls/1","id":58326478,"html_url":"https://github.com/househappy/floorplan/pull/1","diff_url":"https://github.com/househappy/floorplan/pull/1.diff","patch_url":"https://github.com/househappy/floorplan/pull/1.patch","issue_url":"https://api.github.com/repos/househappy/floorplan/issues/1","number":1,"state":"open","locked":false,"title":"Rewrite to run serially","user":{"login":"moxley","id":86996,"avatar_url":"https://avatars.githubusercontent.com/u/86996?v=3","gravatar_id":"","url":"https://api.github.com/users/moxley","html_url":"https://github.com/moxley","followers_url":"https://api.github.com/users/moxley/followers","following_url":"https://api.github.com/users/moxley/following{/other_user}","gists_url":"https://api.github.com/users/moxley/gists{/gist_id}","starred_url":"https://api.github.com/users/moxley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moxley/subscriptions","organizations_url":"https://api.github.com/users/moxley/orgs","repos_url":"https://api.github.com/users/moxley/repos","events_url":"https://api.github.com/users/moxley/events{/privacy}","received_events_url":"https://api.github.com/users/moxley/received_events","type":"User","site_admin":false},"body":"## What\r\n\r\nRewrites most of Floorplan to run serially rather than running in separate processes, to eliminate crashes.\r\n\r\nIntroduces breaking changes to the top-level API.","created_at":"2016-02-04T18:16:15Z","updated_at":"2016-02-04T22:21:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3726e2257b919adf3ad3052b048510425d12511","assignee":{"login":"theoretick","id":1449707,"avatar_url":"https://avatars.githubusercontent.com/u/1449707?v=3","gravatar_id":"","url":"https://api.github.com/users/theoretick","html_url":"https://github.com/theoretick","followers_url":"https://api.github.com/users/theoretick/followers","following_url":"https://api.github.com/users/theoretick/following{/other_user}","gists_url":"https://api.github.com/users/theoretick/gists{/gist_id}","starred_url":"https://api.github.com/users/theoretick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theoretick/subscriptions","organizations_url":"https://api.github.com/users/theoretick/orgs","repos_url":"https://api.github.com/users/theoretick/repos","events_url":"https://api.github.com/users/theoretick/events{/privacy}","received_events_url":"https://api.github.com/users/theoretick/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/househappy/floorplan/pulls/1/commits","review_comments_url":"https://api.github.com/repos/househappy/floorplan/pulls/1/comments","review_comment_url":"https://api.github.com/repos/househappy/floorplan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/househappy/floorplan/issues/1/comments","statuses_url":"https://api.github.com/repos/househappy/floorplan/statuses/9a09267ec6d5ae1c3237bf3adfee4bb0274d8fa0","head":{"label":"househappy:rewrite","ref":"rewrite","sha":"9a09267ec6d5ae1c3237bf3adfee4bb0274d8fa0","user":{"login":"househappy","id":1489857,"avatar_url":"https://avatars.githubusercontent.com/u/1489857?v=3","gravatar_id":"","url":"https://api.github.com/users/househappy","html_url":"https://github.com/househappy","followers_url":"https://api.github.com/users/househappy/followers","following_url":"https://api.github.com/users/househappy/following{/other_user}","gists_url":"https://api.github.com/users/househappy/gists{/gist_id}","starred_url":"https://api.github.com/users/househappy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/househappy/subscriptions","organizations_url":"https://api.github.com/users/househappy/orgs","repos_url":"https://api.github.com/users/househappy/repos","events_url":"https://api.github.com/users/househappy/events{/privacy}","received_events_url":"https://api.github.com/users/househappy/received_events","type":"Organization","site_admin":false},"repo":{"id":45999533,"name":"floorplan","full_name":"househappy/floorplan","owner":{"login":"househappy","id":1489857,"avatar_url":"https://avatars.githubusercontent.com/u/1489857?v=3","gravatar_id":"","url":"https://api.github.com/users/househappy","html_url":"https://github.com/househappy","followers_url":"https://api.github.com/users/househappy/followers","following_url":"https://api.github.com/users/househappy/following{/other_user}","gists_url":"https://api.github.com/users/househappy/gists{/gist_id}","starred_url":"https://api.github.com/users/househappy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/househappy/subscriptions","organizations_url":"https://api.github.com/users/househappy/orgs","repos_url":"https://api.github.com/users/househappy/repos","events_url":"https://api.github.com/users/househappy/events{/privacy}","received_events_url":"https://api.github.com/users/househappy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/househappy/floorplan","description":"Sitemap generator support Ecto and Elasticsearch data sources","fork":false,"url":"https://api.github.com/repos/househappy/floorplan","forks_url":"https://api.github.com/repos/househappy/floorplan/forks","keys_url":"https://api.github.com/repos/househappy/floorplan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/househappy/floorplan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/househappy/floorplan/teams","hooks_url":"https://api.github.com/repos/househappy/floorplan/hooks","issue_events_url":"https://api.github.com/repos/househappy/floorplan/issues/events{/number}","events_url":"https://api.github.com/repos/househappy/floorplan/events","assignees_url":"https://api.github.com/repos/househappy/floorplan/assignees{/user}","branches_url":"https://api.github.com/repos/househappy/floorplan/branches{/branch}","tags_url":"https://api.github.com/repos/househappy/floorplan/tags","blobs_url":"https://api.github.com/repos/househappy/floorplan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/househappy/floorplan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/househappy/floorplan/git/refs{/sha}","trees_url":"https://api.github.com/repos/househappy/floorplan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/househappy/floorplan/statuses/{sha}","languages_url":"https://api.github.com/repos/househappy/floorplan/languages","stargazers_url":"https://api.github.com/repos/househappy/floorplan/stargazers","contributors_url":"https://api.github.com/repos/househappy/floorplan/contributors","subscribers_url":"https://api.github.com/repos/househappy/floorplan/subscribers","subscription_url":"https://api.github.com/repos/househappy/floorplan/subscription","commits_url":"https://api.github.com/repos/househappy/floorplan/commits{/sha}","git_commits_url":"https://api.github.com/repos/househappy/floorplan/git/commits{/sha}","comments_url":"https://api.github.com/repos/househappy/floorplan/comments{/number}","issue_comment_url":"https://api.github.com/repos/househappy/floorplan/issues/comments{/number}","contents_url":"https://api.github.com/repos/househappy/floorplan/contents/{+path}","compare_url":"https://api.github.com/repos/househappy/floorplan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/househappy/floorplan/merges","archive_url":"https://api.github.com/repos/househappy/floorplan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/househappy/floorplan/downloads","issues_url":"https://api.github.com/repos/househappy/floorplan/issues{/number}","pulls_url":"https://api.github.com/repos/househappy/floorplan/pulls{/number}","milestones_url":"https://api.github.com/repos/househappy/floorplan/milestones{/number}","notifications_url":"https://api.github.com/repos/househappy/floorplan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/househappy/floorplan/labels{/name}","releases_url":"https://api.github.com/repos/househappy/floorplan/releases{/id}","deployments_url":"https://api.github.com/repos/househappy/floorplan/deployments","created_at":"2015-11-11T17:57:23Z","updated_at":"2016-02-04T18:16:23Z","pushed_at":"2016-02-04T18:44:28Z","git_url":"git://github.com/househappy/floorplan.git","ssh_url":"git@github.com:househappy/floorplan.git","clone_url":"https://github.com/househappy/floorplan.git","svn_url":"https://github.com/househappy/floorplan","homepage":"https://hex.pm/packages/floorplan","size":27,"stargazers_count":2,"watchers_count":2,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"househappy:master","ref":"master","sha":"0d96d8c11e1ad7861bf07d85250648e35d9136db","user":{"login":"househappy","id":1489857,"avatar_url":"https://avatars.githubusercontent.com/u/1489857?v=3","gravatar_id":"","url":"https://api.github.com/users/househappy","html_url":"https://github.com/househappy","followers_url":"https://api.github.com/users/househappy/followers","following_url":"https://api.github.com/users/househappy/following{/other_user}","gists_url":"https://api.github.com/users/househappy/gists{/gist_id}","starred_url":"https://api.github.com/users/househappy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/househappy/subscriptions","organizations_url":"https://api.github.com/users/househappy/orgs","repos_url":"https://api.github.com/users/househappy/repos","events_url":"https://api.github.com/users/househappy/events{/privacy}","received_events_url":"https://api.github.com/users/househappy/received_events","type":"Organization","site_admin":false},"repo":{"id":45999533,"name":"floorplan","full_name":"househappy/floorplan","owner":{"login":"househappy","id":1489857,"avatar_url":"https://avatars.githubusercontent.com/u/1489857?v=3","gravatar_id":"","url":"https://api.github.com/users/househappy","html_url":"https://github.com/househappy","followers_url":"https://api.github.com/users/househappy/followers","following_url":"https://api.github.com/users/househappy/following{/other_user}","gists_url":"https://api.github.com/users/househappy/gists{/gist_id}","starred_url":"https://api.github.com/users/househappy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/househappy/subscriptions","organizations_url":"https://api.github.com/users/househappy/orgs","repos_url":"https://api.github.com/users/househappy/repos","events_url":"https://api.github.com/users/househappy/events{/privacy}","received_events_url":"https://api.github.com/users/househappy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/househappy/floorplan","description":"Sitemap generator support Ecto and Elasticsearch data sources","fork":false,"url":"https://api.github.com/repos/househappy/floorplan","forks_url":"https://api.github.com/repos/househappy/floorplan/forks","keys_url":"https://api.github.com/repos/househappy/floorplan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/househappy/floorplan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/househappy/floorplan/teams","hooks_url":"https://api.github.com/repos/househappy/floorplan/hooks","issue_events_url":"https://api.github.com/repos/househappy/floorplan/issues/events{/number}","events_url":"https://api.github.com/repos/househappy/floorplan/events","assignees_url":"https://api.github.com/repos/househappy/floorplan/assignees{/user}","branches_url":"https://api.github.com/repos/househappy/floorplan/branches{/branch}","tags_url":"https://api.github.com/repos/househappy/floorplan/tags","blobs_url":"https://api.github.com/repos/househappy/floorplan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/househappy/floorplan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/househappy/floorplan/git/refs{/sha}","trees_url":"https://api.github.com/repos/househappy/floorplan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/househappy/floorplan/statuses/{sha}","languages_url":"https://api.github.com/repos/househappy/floorplan/languages","stargazers_url":"https://api.github.com/repos/househappy/floorplan/stargazers","contributors_url":"https://api.github.com/repos/househappy/floorplan/contributors","subscribers_url":"https://api.github.com/repos/househappy/floorplan/subscribers","subscription_url":"https://api.github.com/repos/househappy/floorplan/subscription","commits_url":"https://api.github.com/repos/househappy/floorplan/commits{/sha}","git_commits_url":"https://api.github.com/repos/househappy/floorplan/git/commits{/sha}","comments_url":"https://api.github.com/repos/househappy/floorplan/comments{/number}","issue_comment_url":"https://api.github.com/repos/househappy/floorplan/issues/comments{/number}","contents_url":"https://api.github.com/repos/househappy/floorplan/contents/{+path}","compare_url":"https://api.github.com/repos/househappy/floorplan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/househappy/floorplan/merges","archive_url":"https://api.github.com/repos/househappy/floorplan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/househappy/floorplan/downloads","issues_url":"https://api.github.com/repos/househappy/floorplan/issues{/number}","pulls_url":"https://api.github.com/repos/househappy/floorplan/pulls{/number}","milestones_url":"https://api.github.com/repos/househappy/floorplan/milestones{/number}","notifications_url":"https://api.github.com/repos/househappy/floorplan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/househappy/floorplan/labels{/name}","releases_url":"https://api.github.com/repos/househappy/floorplan/releases{/id}","deployments_url":"https://api.github.com/repos/househappy/floorplan/deployments","created_at":"2015-11-11T17:57:23Z","updated_at":"2016-02-04T18:16:23Z","pushed_at":"2016-02-04T18:44:28Z","git_url":"git://github.com/househappy/floorplan.git","ssh_url":"git@github.com:househappy/floorplan.git","clone_url":"https://github.com/househappy/floorplan.git","svn_url":"https://github.com/househappy/floorplan","homepage":"https://hex.pm/packages/floorplan","size":27,"stargazers_count":2,"watchers_count":2,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/househappy/floorplan/pulls/1"},"html":{"href":"https://github.com/househappy/floorplan/pull/1"},"issue":{"href":"https://api.github.com/repos/househappy/floorplan/issues/1"},"comments":{"href":"https://api.github.com/repos/househappy/floorplan/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/househappy/floorplan/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/househappy/floorplan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/househappy/floorplan/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/househappy/floorplan/statuses/9a09267ec6d5ae1c3237bf3adfee4bb0274d8fa0"}}}}