{"action":"created","comment":{"url":"https://api.github.com/repos/sep/ollert/pulls/comments/24746976","id":24746976,"diff_hunk":"@@ -0,0 +1,38 @@\n+module Util","path":"utils/fetchers/fetcher.rb","position":1,"original_position":1,"commit_id":"1285097ec0c5de8022b2bb6db68bd6cdd5d86e83","original_commit_id":"1285097ec0c5de8022b2bb6db68bd6cdd5d86e83","user":{"login":"larryprice","id":1653573,"avatar_url":"https://avatars.githubusercontent.com/u/1653573?v=3","gravatar_id":"","url":"https://api.github.com/users/larryprice","html_url":"https://github.com/larryprice","followers_url":"https://api.github.com/users/larryprice/followers","following_url":"https://api.github.com/users/larryprice/following{/other_user}","gists_url":"https://api.github.com/users/larryprice/gists{/gist_id}","starred_url":"https://api.github.com/users/larryprice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larryprice/subscriptions","organizations_url":"https://api.github.com/users/larryprice/orgs","repos_url":"https://api.github.com/users/larryprice/repos","events_url":"https://api.github.com/users/larryprice/events{/privacy}","received_events_url":"https://api.github.com/users/larryprice/received_events","type":"User","site_admin":false},"body":"module name is `Util` but directory name is `utils`. I'd like to see the module name be `Utils`, unelss you had a particular reason to do otherwise.","created_at":"2015-02-16T12:08:05Z","updated_at":"2015-02-16T12:08:05Z","html_url":"https://github.com/sep/ollert/pull/9#discussion_r24746976","pull_request_url":"https://api.github.com/repos/sep/ollert/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/sep/ollert/pulls/comments/24746976"},"html":{"href":"https://github.com/sep/ollert/pull/9#discussion_r24746976"},"pull_request":{"href":"https://api.github.com/repos/sep/ollert/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/sep/ollert/pulls/9","id":29265713,"html_url":"https://github.com/sep/ollert/pull/9","diff_url":"https://github.com/sep/ollert/pull/9.diff","patch_url":"https://github.com/sep/ollert/pull/9.patch","issue_url":"https://api.github.com/repos/sep/ollert/issues/9","number":9,"state":"open","locked":false,"title":"List switches","user":{"login":"leviwilson","id":574434,"avatar_url":"https://avatars.githubusercontent.com/u/574434?v=3","gravatar_id":"","url":"https://api.github.com/users/leviwilson","html_url":"https://github.com/leviwilson","followers_url":"https://api.github.com/users/leviwilson/followers","following_url":"https://api.github.com/users/leviwilson/following{/other_user}","gists_url":"https://api.github.com/users/leviwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/leviwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leviwilson/subscriptions","organizations_url":"https://api.github.com/users/leviwilson/orgs","repos_url":"https://api.github.com/users/leviwilson/repos","events_url":"https://api.github.com/users/leviwilson/events{/privacy}","received_events_url":"https://api.github.com/users/leviwilson/received_events","type":"User","site_admin":false},"body":"## Description\r\nAdded a \"Time Spent in Lists\" chart that aggregates the average times that cards are living in each individual list by both total days and business days (excluding weekends).\r\n\r\n![time_spent](https://cloud.githubusercontent.com/assets/574434/6188092/eba08134-b35b-11e4-8edf-2d3c5265f0cb.png)\r\n\r\n## Libraries Added\r\n*  `underscore.js` - does the heavy lifting for calculating the averages that cards live in lists\r\n*  `business_time` - ruby gem that calculates business days between different dates\r\n*  `chronic` - used in testing to make tests less brittle when calculating dates that span weekends\r\n*  `require_all` - used to make it less verbose to pull in files into the application\r\n\r\n## Additional Setup\r\n### Integration Tests\r\nI've added an integration test to verify that I am mapping things properly back from Trello responses. The `test:spec` task runs all of the rspec tests that are `~integration=true`, while the `test:integration` only runs `integration=true`. To run them you need to setup the environment variables `INTEGRATION_KEY` and `INTEGRATION_TOKEN`.\r\n\r\nAdditionally I found that with encrypted environment variables, others who are not allowed access to the upstream repository do not have access to them (so non-committers cannot expose private information) so the cucumber tests will not run in travis-ci for forked branches.\r\n\r\n### testem\r\nI've added a JavaScript test suite that uses `testem`. I added instructions on setting it up to the README.\r\n\r\n## Classes Introduced\r\n### Ruby\r\n*  `Util::Fetcher` - fetching data from `Trello::Client` was done in different places in the app. I made this mixin that shares similar functionality as was required in the other places. Added specs around it. It also has the ability to project JSON into a Ruby class (using `json_into` extension that `ruby-trello` provides\r\n*  `Util::Analyzers::TimeSpent` - aggregates list changes, grouped by `card_id`, and totals up the time spent in each list for each card\r\n*  `Util::ListAction` - model that is used to project the JSON response for list changes to make it easier to work with the data (rather than `Hash` objects). This also `extend`s Util::Fetcher to load list changes from Trello\r\n\r\n### JavaScript\r\n*  `Ollert.TimeSpent` - class introduced that computes the averages on the client-side for cards\r\n*  `ListChangesChartBuilder` - builds the Highcharts graph from the data calculates from `Ollert.TimeSpent.average`\r\n\r\n## Notes\r\nI went back and forth about what I wanted to do with the data, but in the end I am thinking that it is more valuable to send slightly more information back from this response and have it processed on the client. In the future I could see using this information to do some sort of drilldown chart in Highcharts. At some point I'm thinking that you would have the ability to drill down into a particular list to look at _all_ of the card times that are spent in the list and potentially link to cards to check them out in Trello).","created_at":"2015-02-13T13:53:23Z","updated_at":"2015-02-16T12:08:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7431c0f3b86a3e04bbad8490ecfa4bbaef7a33a9","assignee":{"login":"larryprice","id":1653573,"avatar_url":"https://avatars.githubusercontent.com/u/1653573?v=3","gravatar_id":"","url":"https://api.github.com/users/larryprice","html_url":"https://github.com/larryprice","followers_url":"https://api.github.com/users/larryprice/followers","following_url":"https://api.github.com/users/larryprice/following{/other_user}","gists_url":"https://api.github.com/users/larryprice/gists{/gist_id}","starred_url":"https://api.github.com/users/larryprice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larryprice/subscriptions","organizations_url":"https://api.github.com/users/larryprice/orgs","repos_url":"https://api.github.com/users/larryprice/repos","events_url":"https://api.github.com/users/larryprice/events{/privacy}","received_events_url":"https://api.github.com/users/larryprice/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/sep/ollert/pulls/9/commits","review_comments_url":"https://api.github.com/repos/sep/ollert/pulls/9/comments","review_comment_url":"https://api.github.com/repos/sep/ollert/pulls/comments/{number}","comments_url":"https://api.github.com/repos/sep/ollert/issues/9/comments","statuses_url":"https://api.github.com/repos/sep/ollert/statuses/1285097ec0c5de8022b2bb6db68bd6cdd5d86e83","head":{"label":"leviwilson:list_switches","ref":"list_switches","sha":"1285097ec0c5de8022b2bb6db68bd6cdd5d86e83","user":{"login":"leviwilson","id":574434,"avatar_url":"https://avatars.githubusercontent.com/u/574434?v=3","gravatar_id":"","url":"https://api.github.com/users/leviwilson","html_url":"https://github.com/leviwilson","followers_url":"https://api.github.com/users/leviwilson/followers","following_url":"https://api.github.com/users/leviwilson/following{/other_user}","gists_url":"https://api.github.com/users/leviwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/leviwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leviwilson/subscriptions","organizations_url":"https://api.github.com/users/leviwilson/orgs","repos_url":"https://api.github.com/users/leviwilson/repos","events_url":"https://api.github.com/users/leviwilson/events{/privacy}","received_events_url":"https://api.github.com/users/leviwilson/received_events","type":"User","site_admin":false},"repo":{"id":30022716,"name":"ollert","full_name":"leviwilson/ollert","owner":{"login":"leviwilson","id":574434,"avatar_url":"https://avatars.githubusercontent.com/u/574434?v=3","gravatar_id":"","url":"https://api.github.com/users/leviwilson","html_url":"https://github.com/leviwilson","followers_url":"https://api.github.com/users/leviwilson/followers","following_url":"https://api.github.com/users/leviwilson/following{/other_user}","gists_url":"https://api.github.com/users/leviwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/leviwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leviwilson/subscriptions","organizations_url":"https://api.github.com/users/leviwilson/orgs","repos_url":"https://api.github.com/users/leviwilson/repos","events_url":"https://api.github.com/users/leviwilson/events{/privacy}","received_events_url":"https://api.github.com/users/leviwilson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leviwilson/ollert","description":"https://ollertapp.com","fork":true,"url":"https://api.github.com/repos/leviwilson/ollert","forks_url":"https://api.github.com/repos/leviwilson/ollert/forks","keys_url":"https://api.github.com/repos/leviwilson/ollert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leviwilson/ollert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leviwilson/ollert/teams","hooks_url":"https://api.github.com/repos/leviwilson/ollert/hooks","issue_events_url":"https://api.github.com/repos/leviwilson/ollert/issues/events{/number}","events_url":"https://api.github.com/repos/leviwilson/ollert/events","assignees_url":"https://api.github.com/repos/leviwilson/ollert/assignees{/user}","branches_url":"https://api.github.com/repos/leviwilson/ollert/branches{/branch}","tags_url":"https://api.github.com/repos/leviwilson/ollert/tags","blobs_url":"https://api.github.com/repos/leviwilson/ollert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leviwilson/ollert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leviwilson/ollert/git/refs{/sha}","trees_url":"https://api.github.com/repos/leviwilson/ollert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leviwilson/ollert/statuses/{sha}","languages_url":"https://api.github.com/repos/leviwilson/ollert/languages","stargazers_url":"https://api.github.com/repos/leviwilson/ollert/stargazers","contributors_url":"https://api.github.com/repos/leviwilson/ollert/contributors","subscribers_url":"https://api.github.com/repos/leviwilson/ollert/subscribers","subscription_url":"https://api.github.com/repos/leviwilson/ollert/subscription","commits_url":"https://api.github.com/repos/leviwilson/ollert/commits{/sha}","git_commits_url":"https://api.github.com/repos/leviwilson/ollert/git/commits{/sha}","comments_url":"https://api.github.com/repos/leviwilson/ollert/comments{/number}","issue_comment_url":"https://api.github.com/repos/leviwilson/ollert/issues/comments/{number}","contents_url":"https://api.github.com/repos/leviwilson/ollert/contents/{+path}","compare_url":"https://api.github.com/repos/leviwilson/ollert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leviwilson/ollert/merges","archive_url":"https://api.github.com/repos/leviwilson/ollert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leviwilson/ollert/downloads","issues_url":"https://api.github.com/repos/leviwilson/ollert/issues{/number}","pulls_url":"https://api.github.com/repos/leviwilson/ollert/pulls{/number}","milestones_url":"https://api.github.com/repos/leviwilson/ollert/milestones{/number}","notifications_url":"https://api.github.com/repos/leviwilson/ollert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leviwilson/ollert/labels{/name}","releases_url":"https://api.github.com/repos/leviwilson/ollert/releases{/id}","created_at":"2015-01-29T14:07:15Z","updated_at":"2015-02-13T05:00:29Z","pushed_at":"2015-02-15T20:43:51Z","git_url":"git://github.com/leviwilson/ollert.git","ssh_url":"git@github.com:leviwilson/ollert.git","clone_url":"https://github.com/leviwilson/ollert.git","svn_url":"https://github.com/leviwilson/ollert","homepage":null,"size":14410,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sep:master","ref":"master","sha":"e736c1b3c9c4bbafdae55d16b63d64b3bff9a809","user":{"login":"sep","id":320318,"avatar_url":"https://avatars.githubusercontent.com/u/320318?v=3","gravatar_id":"","url":"https://api.github.com/users/sep","html_url":"https://github.com/sep","followers_url":"https://api.github.com/users/sep/followers","following_url":"https://api.github.com/users/sep/following{/other_user}","gists_url":"https://api.github.com/users/sep/gists{/gist_id}","starred_url":"https://api.github.com/users/sep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sep/subscriptions","organizations_url":"https://api.github.com/users/sep/orgs","repos_url":"https://api.github.com/users/sep/repos","events_url":"https://api.github.com/users/sep/events{/privacy}","received_events_url":"https://api.github.com/users/sep/received_events","type":"Organization","site_admin":false},"repo":{"id":30020248,"name":"ollert","full_name":"sep/ollert","owner":{"login":"sep","id":320318,"avatar_url":"https://avatars.githubusercontent.com/u/320318?v=3","gravatar_id":"","url":"https://api.github.com/users/sep","html_url":"https://github.com/sep","followers_url":"https://api.github.com/users/sep/followers","following_url":"https://api.github.com/users/sep/following{/other_user}","gists_url":"https://api.github.com/users/sep/gists{/gist_id}","starred_url":"https://api.github.com/users/sep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sep/subscriptions","organizations_url":"https://api.github.com/users/sep/orgs","repos_url":"https://api.github.com/users/sep/repos","events_url":"https://api.github.com/users/sep/events{/privacy}","received_events_url":"https://api.github.com/users/sep/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sep/ollert","description":"https://ollertapp.com","fork":false,"url":"https://api.github.com/repos/sep/ollert","forks_url":"https://api.github.com/repos/sep/ollert/forks","keys_url":"https://api.github.com/repos/sep/ollert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sep/ollert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sep/ollert/teams","hooks_url":"https://api.github.com/repos/sep/ollert/hooks","issue_events_url":"https://api.github.com/repos/sep/ollert/issues/events{/number}","events_url":"https://api.github.com/repos/sep/ollert/events","assignees_url":"https://api.github.com/repos/sep/ollert/assignees{/user}","branches_url":"https://api.github.com/repos/sep/ollert/branches{/branch}","tags_url":"https://api.github.com/repos/sep/ollert/tags","blobs_url":"https://api.github.com/repos/sep/ollert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sep/ollert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sep/ollert/git/refs{/sha}","trees_url":"https://api.github.com/repos/sep/ollert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sep/ollert/statuses/{sha}","languages_url":"https://api.github.com/repos/sep/ollert/languages","stargazers_url":"https://api.github.com/repos/sep/ollert/stargazers","contributors_url":"https://api.github.com/repos/sep/ollert/contributors","subscribers_url":"https://api.github.com/repos/sep/ollert/subscribers","subscription_url":"https://api.github.com/repos/sep/ollert/subscription","commits_url":"https://api.github.com/repos/sep/ollert/commits{/sha}","git_commits_url":"https://api.github.com/repos/sep/ollert/git/commits{/sha}","comments_url":"https://api.github.com/repos/sep/ollert/comments{/number}","issue_comment_url":"https://api.github.com/repos/sep/ollert/issues/comments/{number}","contents_url":"https://api.github.com/repos/sep/ollert/contents/{+path}","compare_url":"https://api.github.com/repos/sep/ollert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sep/ollert/merges","archive_url":"https://api.github.com/repos/sep/ollert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sep/ollert/downloads","issues_url":"https://api.github.com/repos/sep/ollert/issues{/number}","pulls_url":"https://api.github.com/repos/sep/ollert/pulls{/number}","milestones_url":"https://api.github.com/repos/sep/ollert/milestones{/number}","notifications_url":"https://api.github.com/repos/sep/ollert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sep/ollert/labels{/name}","releases_url":"https://api.github.com/repos/sep/ollert/releases{/id}","created_at":"2015-01-29T13:03:09Z","updated_at":"2015-02-11T16:55:38Z","pushed_at":"2015-02-11T13:54:05Z","git_url":"git://github.com/sep/ollert.git","ssh_url":"git@github.com:sep/ollert.git","clone_url":"https://github.com/sep/ollert.git","svn_url":"https://github.com/sep/ollert","homepage":null,"size":14360,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sep/ollert/pulls/9"},"html":{"href":"https://github.com/sep/ollert/pull/9"},"issue":{"href":"https://api.github.com/repos/sep/ollert/issues/9"},"comments":{"href":"https://api.github.com/repos/sep/ollert/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/sep/ollert/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/sep/ollert/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/sep/ollert/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/sep/ollert/statuses/1285097ec0c5de8022b2bb6db68bd6cdd5d86e83"}}}}