{"action":"created","comment":{"url":"https://api.github.com/repos/roqua/physiqual/pulls/comments/45347464","id":45347464,"diff_hunk":"@@ -0,0 +1,28 @@\n+module Physiqual\n+  module ExportsHelper\n+    def assert_service_provider\n+      provider_options = [GoogleToken.csrf_token, FitbitToken.csrf_token]\n+      fail Errors::ServiceProviderNotFoundError unless provider_options.include?(params[:provider])\n+    end\n+\n+    def assert_data_source\n+      data_source_options = %w(heart_rate calories steps activities sleep)\n+\n+      fail(Errors::InvalidParamsError, 'data source') unless data_source_options.include?(params[:data_source])\n+    end\n+\n+    def assert_first_measurement\n+      fail(Errors::InvalidParamsError, 'first measurement missing') unless params[:first_measurement]\n+      m = /^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})/.match(params[:first_measurement])\n+      fail(Errors::InvalidParamsError, 'incorrect format of first measurement') unless m\n+      params[:first_measurement] = Time.new(m[1], m[2], m[3], m[4], m[5]).in_time_zone\n+    end\n+\n+    def assert_number_of_days\n+      fail(Errors::InvalidParamsError, 'number of day missings') unless params[:number_of_days]","path":"app/helpers/physiqual/exports_helper.rb","position":22,"original_position":22,"commit_id":"a534c4276e53508658ca922f3b29201304e50396","original_commit_id":"a534c4276e53508658ca922f3b29201304e50396","user":{"login":"emerencia","id":607965,"avatar_url":"https://avatars.githubusercontent.com/u/607965?v=3","gravatar_id":"","url":"https://api.github.com/users/emerencia","html_url":"https://github.com/emerencia","followers_url":"https://api.github.com/users/emerencia/followers","following_url":"https://api.github.com/users/emerencia/following{/other_user}","gists_url":"https://api.github.com/users/emerencia/gists{/gist_id}","starred_url":"https://api.github.com/users/emerencia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emerencia/subscriptions","organizations_url":"https://api.github.com/users/emerencia/orgs","repos_url":"https://api.github.com/users/emerencia/repos","events_url":"https://api.github.com/users/emerencia/events{/privacy}","received_events_url":"https://api.github.com/users/emerencia/received_events","type":"User","site_admin":false},"body":"missings","created_at":"2015-11-19T14:37:04Z","updated_at":"2015-11-19T14:37:04Z","html_url":"https://github.com/roqua/physiqual/pull/52#discussion_r45347464","pull_request_url":"https://api.github.com/repos/roqua/physiqual/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/roqua/physiqual/pulls/comments/45347464"},"html":{"href":"https://github.com/roqua/physiqual/pull/52#discussion_r45347464"},"pull_request":{"href":"https://api.github.com/repos/roqua/physiqual/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/roqua/physiqual/pulls/52","id":51226412,"html_url":"https://github.com/roqua/physiqual/pull/52","diff_url":"https://github.com/roqua/physiqual/pull/52.diff","patch_url":"https://github.com/roqua/physiqual/pull/52.patch","issue_url":"https://api.github.com/repos/roqua/physiqual/issues/52","number":52,"state":"open","locked":false,"title":"Update gem to use omniauth","user":{"login":"frbl","id":617574,"avatar_url":"https://avatars.githubusercontent.com/u/617574?v=3","gravatar_id":"","url":"https://api.github.com/users/frbl","html_url":"https://github.com/frbl","followers_url":"https://api.github.com/users/frbl/followers","following_url":"https://api.github.com/users/frbl/following{/other_user}","gists_url":"https://api.github.com/users/frbl/gists{/gist_id}","starred_url":"https://api.github.com/users/frbl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frbl/subscriptions","organizations_url":"https://api.github.com/users/frbl/orgs","repos_url":"https://api.github.com/users/frbl/repos","events_url":"https://api.github.com/users/frbl/events{/privacy}","received_events_url":"https://api.github.com/users/frbl/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-19T14:09:34Z","updated_at":"2015-11-19T14:37:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50f0cd6f0582a5dec6885a3dd03f13a7209f7806","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/roqua/physiqual/pulls/52/commits","review_comments_url":"https://api.github.com/repos/roqua/physiqual/pulls/52/comments","review_comment_url":"https://api.github.com/repos/roqua/physiqual/pulls/comments{/number}","comments_url":"https://api.github.com/repos/roqua/physiqual/issues/52/comments","statuses_url":"https://api.github.com/repos/roqua/physiqual/statuses/a534c4276e53508658ca922f3b29201304e50396","head":{"label":"roqua:fb-update-to-omniauth","ref":"fb-update-to-omniauth","sha":"a534c4276e53508658ca922f3b29201304e50396","user":{"login":"roqua","id":598697,"avatar_url":"https://avatars.githubusercontent.com/u/598697?v=3","gravatar_id":"","url":"https://api.github.com/users/roqua","html_url":"https://github.com/roqua","followers_url":"https://api.github.com/users/roqua/followers","following_url":"https://api.github.com/users/roqua/following{/other_user}","gists_url":"https://api.github.com/users/roqua/gists{/gist_id}","starred_url":"https://api.github.com/users/roqua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roqua/subscriptions","organizations_url":"https://api.github.com/users/roqua/orgs","repos_url":"https://api.github.com/users/roqua/repos","events_url":"https://api.github.com/users/roqua/events{/privacy}","received_events_url":"https://api.github.com/users/roqua/received_events","type":"Organization","site_admin":false},"repo":{"id":40968813,"name":"physiqual","full_name":"roqua/physiqual","owner":{"login":"roqua","id":598697,"avatar_url":"https://avatars.githubusercontent.com/u/598697?v=3","gravatar_id":"","url":"https://api.github.com/users/roqua","html_url":"https://github.com/roqua","followers_url":"https://api.github.com/users/roqua/followers","following_url":"https://api.github.com/users/roqua/following{/other_user}","gists_url":"https://api.github.com/users/roqua/gists{/gist_id}","starred_url":"https://api.github.com/users/roqua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roqua/subscriptions","organizations_url":"https://api.github.com/users/roqua/orgs","repos_url":"https://api.github.com/users/roqua/repos","events_url":"https://api.github.com/users/roqua/events{/privacy}","received_events_url":"https://api.github.com/users/roqua/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/roqua/physiqual","description":"Ruby Engine for merging various datasources with diary questionnaire data","fork":false,"url":"https://api.github.com/repos/roqua/physiqual","forks_url":"https://api.github.com/repos/roqua/physiqual/forks","keys_url":"https://api.github.com/repos/roqua/physiqual/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roqua/physiqual/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roqua/physiqual/teams","hooks_url":"https://api.github.com/repos/roqua/physiqual/hooks","issue_events_url":"https://api.github.com/repos/roqua/physiqual/issues/events{/number}","events_url":"https://api.github.com/repos/roqua/physiqual/events","assignees_url":"https://api.github.com/repos/roqua/physiqual/assignees{/user}","branches_url":"https://api.github.com/repos/roqua/physiqual/branches{/branch}","tags_url":"https://api.github.com/repos/roqua/physiqual/tags","blobs_url":"https://api.github.com/repos/roqua/physiqual/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roqua/physiqual/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roqua/physiqual/git/refs{/sha}","trees_url":"https://api.github.com/repos/roqua/physiqual/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roqua/physiqual/statuses/{sha}","languages_url":"https://api.github.com/repos/roqua/physiqual/languages","stargazers_url":"https://api.github.com/repos/roqua/physiqual/stargazers","contributors_url":"https://api.github.com/repos/roqua/physiqual/contributors","subscribers_url":"https://api.github.com/repos/roqua/physiqual/subscribers","subscription_url":"https://api.github.com/repos/roqua/physiqual/subscription","commits_url":"https://api.github.com/repos/roqua/physiqual/commits{/sha}","git_commits_url":"https://api.github.com/repos/roqua/physiqual/git/commits{/sha}","comments_url":"https://api.github.com/repos/roqua/physiqual/comments{/number}","issue_comment_url":"https://api.github.com/repos/roqua/physiqual/issues/comments{/number}","contents_url":"https://api.github.com/repos/roqua/physiqual/contents/{+path}","compare_url":"https://api.github.com/repos/roqua/physiqual/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roqua/physiqual/merges","archive_url":"https://api.github.com/repos/roqua/physiqual/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roqua/physiqual/downloads","issues_url":"https://api.github.com/repos/roqua/physiqual/issues{/number}","pulls_url":"https://api.github.com/repos/roqua/physiqual/pulls{/number}","milestones_url":"https://api.github.com/repos/roqua/physiqual/milestones{/number}","notifications_url":"https://api.github.com/repos/roqua/physiqual/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roqua/physiqual/labels{/name}","releases_url":"https://api.github.com/repos/roqua/physiqual/releases{/id}","created_at":"2015-08-18T11:44:44Z","updated_at":"2015-09-20T08:07:30Z","pushed_at":"2015-11-19T14:33:44Z","git_url":"git://github.com/roqua/physiqual.git","ssh_url":"git@github.com:roqua/physiqual.git","clone_url":"https://github.com/roqua/physiqual.git","svn_url":"https://github.com/roqua/physiqual","homepage":null,"size":1206,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":1,"default_branch":"master"}},"base":{"label":"roqua:master","ref":"master","sha":"37ccdf55b4e9aa8c07e5189c889398512f08ea77","user":{"login":"roqua","id":598697,"avatar_url":"https://avatars.githubusercontent.com/u/598697?v=3","gravatar_id":"","url":"https://api.github.com/users/roqua","html_url":"https://github.com/roqua","followers_url":"https://api.github.com/users/roqua/followers","following_url":"https://api.github.com/users/roqua/following{/other_user}","gists_url":"https://api.github.com/users/roqua/gists{/gist_id}","starred_url":"https://api.github.com/users/roqua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roqua/subscriptions","organizations_url":"https://api.github.com/users/roqua/orgs","repos_url":"https://api.github.com/users/roqua/repos","events_url":"https://api.github.com/users/roqua/events{/privacy}","received_events_url":"https://api.github.com/users/roqua/received_events","type":"Organization","site_admin":false},"repo":{"id":40968813,"name":"physiqual","full_name":"roqua/physiqual","owner":{"login":"roqua","id":598697,"avatar_url":"https://avatars.githubusercontent.com/u/598697?v=3","gravatar_id":"","url":"https://api.github.com/users/roqua","html_url":"https://github.com/roqua","followers_url":"https://api.github.com/users/roqua/followers","following_url":"https://api.github.com/users/roqua/following{/other_user}","gists_url":"https://api.github.com/users/roqua/gists{/gist_id}","starred_url":"https://api.github.com/users/roqua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roqua/subscriptions","organizations_url":"https://api.github.com/users/roqua/orgs","repos_url":"https://api.github.com/users/roqua/repos","events_url":"https://api.github.com/users/roqua/events{/privacy}","received_events_url":"https://api.github.com/users/roqua/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/roqua/physiqual","description":"Ruby Engine for merging various datasources with diary questionnaire data","fork":false,"url":"https://api.github.com/repos/roqua/physiqual","forks_url":"https://api.github.com/repos/roqua/physiqual/forks","keys_url":"https://api.github.com/repos/roqua/physiqual/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roqua/physiqual/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roqua/physiqual/teams","hooks_url":"https://api.github.com/repos/roqua/physiqual/hooks","issue_events_url":"https://api.github.com/repos/roqua/physiqual/issues/events{/number}","events_url":"https://api.github.com/repos/roqua/physiqual/events","assignees_url":"https://api.github.com/repos/roqua/physiqual/assignees{/user}","branches_url":"https://api.github.com/repos/roqua/physiqual/branches{/branch}","tags_url":"https://api.github.com/repos/roqua/physiqual/tags","blobs_url":"https://api.github.com/repos/roqua/physiqual/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roqua/physiqual/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roqua/physiqual/git/refs{/sha}","trees_url":"https://api.github.com/repos/roqua/physiqual/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roqua/physiqual/statuses/{sha}","languages_url":"https://api.github.com/repos/roqua/physiqual/languages","stargazers_url":"https://api.github.com/repos/roqua/physiqual/stargazers","contributors_url":"https://api.github.com/repos/roqua/physiqual/contributors","subscribers_url":"https://api.github.com/repos/roqua/physiqual/subscribers","subscription_url":"https://api.github.com/repos/roqua/physiqual/subscription","commits_url":"https://api.github.com/repos/roqua/physiqual/commits{/sha}","git_commits_url":"https://api.github.com/repos/roqua/physiqual/git/commits{/sha}","comments_url":"https://api.github.com/repos/roqua/physiqual/comments{/number}","issue_comment_url":"https://api.github.com/repos/roqua/physiqual/issues/comments{/number}","contents_url":"https://api.github.com/repos/roqua/physiqual/contents/{+path}","compare_url":"https://api.github.com/repos/roqua/physiqual/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roqua/physiqual/merges","archive_url":"https://api.github.com/repos/roqua/physiqual/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roqua/physiqual/downloads","issues_url":"https://api.github.com/repos/roqua/physiqual/issues{/number}","pulls_url":"https://api.github.com/repos/roqua/physiqual/pulls{/number}","milestones_url":"https://api.github.com/repos/roqua/physiqual/milestones{/number}","notifications_url":"https://api.github.com/repos/roqua/physiqual/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roqua/physiqual/labels{/name}","releases_url":"https://api.github.com/repos/roqua/physiqual/releases{/id}","created_at":"2015-08-18T11:44:44Z","updated_at":"2015-09-20T08:07:30Z","pushed_at":"2015-11-19T14:33:44Z","git_url":"git://github.com/roqua/physiqual.git","ssh_url":"git@github.com:roqua/physiqual.git","clone_url":"https://github.com/roqua/physiqual.git","svn_url":"https://github.com/roqua/physiqual","homepage":null,"size":1206,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/roqua/physiqual/pulls/52"},"html":{"href":"https://github.com/roqua/physiqual/pull/52"},"issue":{"href":"https://api.github.com/repos/roqua/physiqual/issues/52"},"comments":{"href":"https://api.github.com/repos/roqua/physiqual/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/roqua/physiqual/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/roqua/physiqual/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/roqua/physiqual/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/roqua/physiqual/statuses/a534c4276e53508658ca922f3b29201304e50396"}}}}