{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/url-arbiter/pulls/comments/42851775","id":42851775,"diff_hunk":"@@ -0,0 +1,36 @@\n+module Tasks\n+  class ExportData\n+    def initialize(file, stdout)\n+      @file = file\n+      @stdout = stdout\n+    end\n+\n+    def export_all\n+      total = Reservation.count\n+\n+      Reservation.all.each.with_index(1) do |reservation, index|\n+        file.puts(reservation.to_json)\n+\n+        print_progress(index, total)\n+      end\n+\n+      stdout.puts\n+    end\n+\n+  private","path":"lib/tasks/export_data.rb","position":20,"original_position":20,"commit_id":"7eb19d1bca3557b85229d0ab7931b401b04ccd19","original_commit_id":"7eb19d1bca3557b85229d0ab7931b401b04ccd19","user":{"login":"benlovell","id":41963,"avatar_url":"https://avatars.githubusercontent.com/u/41963?v=3","gravatar_id":"","url":"https://api.github.com/users/benlovell","html_url":"https://github.com/benlovell","followers_url":"https://api.github.com/users/benlovell/followers","following_url":"https://api.github.com/users/benlovell/following{/other_user}","gists_url":"https://api.github.com/users/benlovell/gists{/gist_id}","starred_url":"https://api.github.com/users/benlovell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benlovell/subscriptions","organizations_url":"https://api.github.com/users/benlovell/orgs","repos_url":"https://api.github.com/users/benlovell/repos","events_url":"https://api.github.com/users/benlovell/events{/privacy}","received_events_url":"https://api.github.com/users/benlovell/received_events","type":"User","site_admin":false},"body":"The style guide says to remove the whitespace line below the `private` keyword. It's not something I tend to agree with, or that is generally seen elsewhere but there you go. ","created_at":"2015-10-23T10:32:10Z","updated_at":"2015-10-23T10:32:10Z","html_url":"https://github.com/alphagov/url-arbiter/pull/26#discussion_r42851775","pull_request_url":"https://api.github.com/repos/alphagov/url-arbiter/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/alphagov/url-arbiter/pulls/comments/42851775"},"html":{"href":"https://github.com/alphagov/url-arbiter/pull/26#discussion_r42851775"},"pull_request":{"href":"https://api.github.com/repos/alphagov/url-arbiter/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/url-arbiter/pulls/26","id":48563832,"html_url":"https://github.com/alphagov/url-arbiter/pull/26","diff_url":"https://github.com/alphagov/url-arbiter/pull/26.diff","patch_url":"https://github.com/alphagov/url-arbiter/pull/26.patch","issue_url":"https://api.github.com/repos/alphagov/url-arbiter/issues/26","number":26,"state":"open","locked":false,"title":"Add rake task to export all reservations.","user":{"login":"danielroseman","id":131395,"avatar_url":"https://avatars.githubusercontent.com/u/131395?v=3","gravatar_id":"","url":"https://api.github.com/users/danielroseman","html_url":"https://github.com/danielroseman","followers_url":"https://api.github.com/users/danielroseman/followers","following_url":"https://api.github.com/users/danielroseman/following{/other_user}","gists_url":"https://api.github.com/users/danielroseman/gists{/gist_id}","starred_url":"https://api.github.com/users/danielroseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielroseman/subscriptions","organizations_url":"https://api.github.com/users/danielroseman/orgs","repos_url":"https://api.github.com/users/danielroseman/repos","events_url":"https://api.github.com/users/danielroseman/events{/privacy}","received_events_url":"https://api.github.com/users/danielroseman/received_events","type":"User","site_admin":false},"body":"This produces a file with one JSON document per line in ./tmp, intended for importing into publishing-api.","created_at":"2015-10-23T10:23:37Z","updated_at":"2015-10-23T10:32:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1851e960302daad9cd43b28bd96a27deef94443","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/url-arbiter/pulls/26/commits","review_comments_url":"https://api.github.com/repos/alphagov/url-arbiter/pulls/26/comments","review_comment_url":"https://api.github.com/repos/alphagov/url-arbiter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/url-arbiter/issues/26/comments","statuses_url":"https://api.github.com/repos/alphagov/url-arbiter/statuses/7eb19d1bca3557b85229d0ab7931b401b04ccd19","head":{"label":"alphagov:export-data","ref":"export-data","sha":"7eb19d1bca3557b85229d0ab7931b401b04ccd19","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":22725140,"name":"url-arbiter","full_name":"alphagov/url-arbiter","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/url-arbiter","description":"Minimal API to arbitrate URLs on GOV.UK.","fork":false,"url":"https://api.github.com/repos/alphagov/url-arbiter","forks_url":"https://api.github.com/repos/alphagov/url-arbiter/forks","keys_url":"https://api.github.com/repos/alphagov/url-arbiter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/url-arbiter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/url-arbiter/teams","hooks_url":"https://api.github.com/repos/alphagov/url-arbiter/hooks","issue_events_url":"https://api.github.com/repos/alphagov/url-arbiter/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/url-arbiter/events","assignees_url":"https://api.github.com/repos/alphagov/url-arbiter/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/url-arbiter/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/url-arbiter/tags","blobs_url":"https://api.github.com/repos/alphagov/url-arbiter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/url-arbiter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/url-arbiter/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/url-arbiter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/url-arbiter/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/url-arbiter/languages","stargazers_url":"https://api.github.com/repos/alphagov/url-arbiter/stargazers","contributors_url":"https://api.github.com/repos/alphagov/url-arbiter/contributors","subscribers_url":"https://api.github.com/repos/alphagov/url-arbiter/subscribers","subscription_url":"https://api.github.com/repos/alphagov/url-arbiter/subscription","commits_url":"https://api.github.com/repos/alphagov/url-arbiter/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/url-arbiter/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/url-arbiter/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/url-arbiter/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/url-arbiter/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/url-arbiter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/url-arbiter/merges","archive_url":"https://api.github.com/repos/alphagov/url-arbiter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/url-arbiter/downloads","issues_url":"https://api.github.com/repos/alphagov/url-arbiter/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/url-arbiter/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/url-arbiter/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/url-arbiter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/url-arbiter/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/url-arbiter/releases{/id}","created_at":"2014-08-07T14:53:17Z","updated_at":"2015-04-24T13:18:40Z","pushed_at":"2015-10-23T10:23:39Z","git_url":"git://github.com/alphagov/url-arbiter.git","ssh_url":"git@github.com:alphagov/url-arbiter.git","clone_url":"https://github.com/alphagov/url-arbiter.git","svn_url":"https://github.com/alphagov/url-arbiter","homepage":"","size":612,"stargazers_count":1,"watchers_count":1,"language":"Ruby","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":1,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"976e77828d8d182848742e6972bd9967567299c7","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":22725140,"name":"url-arbiter","full_name":"alphagov/url-arbiter","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/url-arbiter","description":"Minimal API to arbitrate URLs on GOV.UK.","fork":false,"url":"https://api.github.com/repos/alphagov/url-arbiter","forks_url":"https://api.github.com/repos/alphagov/url-arbiter/forks","keys_url":"https://api.github.com/repos/alphagov/url-arbiter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/url-arbiter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/url-arbiter/teams","hooks_url":"https://api.github.com/repos/alphagov/url-arbiter/hooks","issue_events_url":"https://api.github.com/repos/alphagov/url-arbiter/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/url-arbiter/events","assignees_url":"https://api.github.com/repos/alphagov/url-arbiter/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/url-arbiter/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/url-arbiter/tags","blobs_url":"https://api.github.com/repos/alphagov/url-arbiter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/url-arbiter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/url-arbiter/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/url-arbiter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/url-arbiter/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/url-arbiter/languages","stargazers_url":"https://api.github.com/repos/alphagov/url-arbiter/stargazers","contributors_url":"https://api.github.com/repos/alphagov/url-arbiter/contributors","subscribers_url":"https://api.github.com/repos/alphagov/url-arbiter/subscribers","subscription_url":"https://api.github.com/repos/alphagov/url-arbiter/subscription","commits_url":"https://api.github.com/repos/alphagov/url-arbiter/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/url-arbiter/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/url-arbiter/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/url-arbiter/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/url-arbiter/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/url-arbiter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/url-arbiter/merges","archive_url":"https://api.github.com/repos/alphagov/url-arbiter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/url-arbiter/downloads","issues_url":"https://api.github.com/repos/alphagov/url-arbiter/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/url-arbiter/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/url-arbiter/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/url-arbiter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/url-arbiter/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/url-arbiter/releases{/id}","created_at":"2014-08-07T14:53:17Z","updated_at":"2015-04-24T13:18:40Z","pushed_at":"2015-10-23T10:23:39Z","git_url":"git://github.com/alphagov/url-arbiter.git","ssh_url":"git@github.com:alphagov/url-arbiter.git","clone_url":"https://github.com/alphagov/url-arbiter.git","svn_url":"https://github.com/alphagov/url-arbiter","homepage":"","size":612,"stargazers_count":1,"watchers_count":1,"language":"Ruby","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":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/url-arbiter/pulls/26"},"html":{"href":"https://github.com/alphagov/url-arbiter/pull/26"},"issue":{"href":"https://api.github.com/repos/alphagov/url-arbiter/issues/26"},"comments":{"href":"https://api.github.com/repos/alphagov/url-arbiter/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/url-arbiter/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/url-arbiter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/url-arbiter/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/url-arbiter/statuses/7eb19d1bca3557b85229d0ab7931b401b04ccd19"}}}}