{"action":"opened","issue":{"url":"https://api.github.com/repos/osuosl/rimesync/issues/2","repository_url":"https://api.github.com/repos/osuosl/rimesync","labels_url":"https://api.github.com/repos/osuosl/rimesync/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/osuosl/rimesync/issues/2/comments","events_url":"https://api.github.com/repos/osuosl/rimesync/issues/2/events","html_url":"https://github.com/osuosl/rimesync/issues/2","id":166411801,"number":2,"title":"Error if time['duration'] = \"1\"","user":{"login":"iCHAIT","id":8472314,"avatar_url":"https://avatars.githubusercontent.com/u/8472314?v=3","gravatar_id":"","url":"https://api.github.com/users/iCHAIT","html_url":"https://github.com/iCHAIT","followers_url":"https://api.github.com/users/iCHAIT/followers","following_url":"https://api.github.com/users/iCHAIT/following{/other_user}","gists_url":"https://api.github.com/users/iCHAIT/gists{/gist_id}","starred_url":"https://api.github.com/users/iCHAIT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iCHAIT/subscriptions","organizations_url":"https://api.github.com/users/iCHAIT/orgs","repos_url":"https://api.github.com/users/iCHAIT/repos","events_url":"https://api.github.com/users/iCHAIT/events{/privacy}","received_events_url":"https://api.github.com/users/iCHAIT/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-19T19:17:12Z","updated_at":"2016-07-19T19:17:12Z","closed_at":null,"body":"If time hash is - \r\n\r\ntime = Hash[\r\n     'duration' => \"1\",\r\n     'user' => 'ichait',\r\n     'project' => 'log',\r\n     'activities' => ['docs'],\r\n     'notes' => 'Worked on documentation.',\r\n     'issue_uri' => 'https://github.com/osuosl/log/issues',\r\n     'date_worked' => '2014-04-17'\r\n]\r\n\r\nIt gives an error because the line -\r\n\r\n `t = Time.strptime(duration, '%Hh%Mm')`\r\n\r\nbreaks as it expects the string to have a `h` or a `m`\r\n\r\n**Possible solutions** -\r\n1. Put a condition and check if the string contains only an integer, if it does then simply `time['duration'].to_i`\r\n2. Use regex to parse string, if it contains only integer."}}
{"actor":{"display_login":"iCHAIT"}}