{"action":"created","comment":{"url":"https://api.github.com/repos/fnando/browser/pulls/comments/48685039","id":48685039,"diff_hunk":"@@ -0,0 +1,157 @@\n+class Browser\n+  class Platform\n+    attr_reader :ua\n+\n+    def initialize(ua)\n+      @ua = ua\n+    end\n+\n+    def subject\n+      @subject ||= [\n+        AdobeAir.new(ua),\n+        ChromeOS.new(ua),\n+        WindowsMobile.new(ua),\n+        WindowsPhone.new(ua),\n+        Android.new(ua),\n+        BlackBerry.new(ua),\n+        IOS.new(ua),\n+        Mac.new(ua),\n+        FirefoxOS.new(ua),\n+        Windows.new(ua),\n+        Linux.new(ua),\n+        Other.new(ua)\n+      ].find(&:match?)","path":"lib/browser/platform.rb","position":23,"original_position":23,"commit_id":"b067937492f938ec4185ba4a8ee726abb0b8bb56","original_commit_id":"b067937492f938ec4185ba4a8ee726abb0b8bb56","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer `detect` over `find`.","created_at":"2016-01-02T14:45:46Z","updated_at":"2016-01-02T14:45:46Z","html_url":"https://github.com/fnando/browser/pull/204#discussion_r48685039","pull_request_url":"https://api.github.com/repos/fnando/browser/pulls/204","_links":{"self":{"href":"https://api.github.com/repos/fnando/browser/pulls/comments/48685039"},"html":{"href":"https://github.com/fnando/browser/pull/204#discussion_r48685039"},"pull_request":{"href":"https://api.github.com/repos/fnando/browser/pulls/204"}}},"pull_request":{"url":"https://api.github.com/repos/fnando/browser/pulls/204","id":54906954,"html_url":"https://github.com/fnando/browser/pull/204","diff_url":"https://github.com/fnando/browser/pull/204.diff","patch_url":"https://github.com/fnando/browser/pull/204.patch","issue_url":"https://api.github.com/repos/fnando/browser/issues/204","number":204,"state":"open","locked":false,"title":"These changes isolate things that aren't browser related into their own objects.","user":{"login":"fnando","id":3009,"avatar_url":"https://avatars.githubusercontent.com/u/3009?v=3","gravatar_id":"","url":"https://api.github.com/users/fnando","html_url":"https://github.com/fnando","followers_url":"https://api.github.com/users/fnando/followers","following_url":"https://api.github.com/users/fnando/following{/other_user}","gists_url":"https://api.github.com/users/fnando/gists{/gist_id}","starred_url":"https://api.github.com/users/fnando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnando/subscriptions","organizations_url":"https://api.github.com/users/fnando/orgs","repos_url":"https://api.github.com/users/fnando/repos","events_url":"https://api.github.com/users/fnando/events{/privacy}","received_events_url":"https://api.github.com/users/fnando/received_events","type":"User","site_admin":false},"body":"- Platform (software) information is now accessible through `Browser#platform`.\n- Device (hardware) information is now accessible through `Browser#device`.\n- Bot information is now accessible through `Browser#bot`.\n\nI've cleaned up some things and optimized others (like only loading list of bots when you actually access the `Browser#bot?` method).\n\nThese changes aren't backward compatible but won't affect most users that just need to detect and get the browser info.","created_at":"2016-01-02T14:42:35Z","updated_at":"2016-01-02T14:45:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed34ab8640a3a8b19b5bd365f13be98756e5e1bb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fnando/browser/pulls/204/commits","review_comments_url":"https://api.github.com/repos/fnando/browser/pulls/204/comments","review_comment_url":"https://api.github.com/repos/fnando/browser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fnando/browser/issues/204/comments","statuses_url":"https://api.github.com/repos/fnando/browser/statuses/b067937492f938ec4185ba4a8ee726abb0b8bb56","head":{"label":"fnando:organize","ref":"organize","sha":"b067937492f938ec4185ba4a8ee726abb0b8bb56","user":{"login":"fnando","id":3009,"avatar_url":"https://avatars.githubusercontent.com/u/3009?v=3","gravatar_id":"","url":"https://api.github.com/users/fnando","html_url":"https://github.com/fnando","followers_url":"https://api.github.com/users/fnando/followers","following_url":"https://api.github.com/users/fnando/following{/other_user}","gists_url":"https://api.github.com/users/fnando/gists{/gist_id}","starred_url":"https://api.github.com/users/fnando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnando/subscriptions","organizations_url":"https://api.github.com/users/fnando/orgs","repos_url":"https://api.github.com/users/fnando/repos","events_url":"https://api.github.com/users/fnando/events{/privacy}","received_events_url":"https://api.github.com/users/fnando/received_events","type":"User","site_admin":false},"repo":{"id":779276,"name":"browser","full_name":"fnando/browser","owner":{"login":"fnando","id":3009,"avatar_url":"https://avatars.githubusercontent.com/u/3009?v=3","gravatar_id":"","url":"https://api.github.com/users/fnando","html_url":"https://github.com/fnando","followers_url":"https://api.github.com/users/fnando/followers","following_url":"https://api.github.com/users/fnando/following{/other_user}","gists_url":"https://api.github.com/users/fnando/gists{/gist_id}","starred_url":"https://api.github.com/users/fnando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnando/subscriptions","organizations_url":"https://api.github.com/users/fnando/orgs","repos_url":"https://api.github.com/users/fnando/repos","events_url":"https://api.github.com/users/fnando/events{/privacy}","received_events_url":"https://api.github.com/users/fnando/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fnando/browser","description":"Do some browser detection with Ruby. Includes ActionController integration.","fork":false,"url":"https://api.github.com/repos/fnando/browser","forks_url":"https://api.github.com/repos/fnando/browser/forks","keys_url":"https://api.github.com/repos/fnando/browser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fnando/browser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fnando/browser/teams","hooks_url":"https://api.github.com/repos/fnando/browser/hooks","issue_events_url":"https://api.github.com/repos/fnando/browser/issues/events{/number}","events_url":"https://api.github.com/repos/fnando/browser/events","assignees_url":"https://api.github.com/repos/fnando/browser/assignees{/user}","branches_url":"https://api.github.com/repos/fnando/browser/branches{/branch}","tags_url":"https://api.github.com/repos/fnando/browser/tags","blobs_url":"https://api.github.com/repos/fnando/browser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fnando/browser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fnando/browser/git/refs{/sha}","trees_url":"https://api.github.com/repos/fnando/browser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fnando/browser/statuses/{sha}","languages_url":"https://api.github.com/repos/fnando/browser/languages","stargazers_url":"https://api.github.com/repos/fnando/browser/stargazers","contributors_url":"https://api.github.com/repos/fnando/browser/contributors","subscribers_url":"https://api.github.com/repos/fnando/browser/subscribers","subscription_url":"https://api.github.com/repos/fnando/browser/subscription","commits_url":"https://api.github.com/repos/fnando/browser/commits{/sha}","git_commits_url":"https://api.github.com/repos/fnando/browser/git/commits{/sha}","comments_url":"https://api.github.com/repos/fnando/browser/comments{/number}","issue_comment_url":"https://api.github.com/repos/fnando/browser/issues/comments{/number}","contents_url":"https://api.github.com/repos/fnando/browser/contents/{+path}","compare_url":"https://api.github.com/repos/fnando/browser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fnando/browser/merges","archive_url":"https://api.github.com/repos/fnando/browser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fnando/browser/downloads","issues_url":"https://api.github.com/repos/fnando/browser/issues{/number}","pulls_url":"https://api.github.com/repos/fnando/browser/pulls{/number}","milestones_url":"https://api.github.com/repos/fnando/browser/milestones{/number}","notifications_url":"https://api.github.com/repos/fnando/browser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fnando/browser/labels{/name}","releases_url":"https://api.github.com/repos/fnando/browser/releases{/id}","created_at":"2010-07-16T17:25:01Z","updated_at":"2015-12-31T19:03:15Z","pushed_at":"2016-01-02T14:45:28Z","git_url":"git://github.com/fnando/browser.git","ssh_url":"git@github.com:fnando/browser.git","clone_url":"https://github.com/fnando/browser.git","svn_url":"https://github.com/fnando/browser","homepage":"","size":661,"stargazers_count":1088,"watchers_count":1088,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":205,"mirror_url":null,"open_issues_count":31,"forks":205,"open_issues":31,"watchers":1088,"default_branch":"master"}},"base":{"label":"fnando:master","ref":"master","sha":"810e743e22cb446ecbfb1db14aff81fd73e76017","user":{"login":"fnando","id":3009,"avatar_url":"https://avatars.githubusercontent.com/u/3009?v=3","gravatar_id":"","url":"https://api.github.com/users/fnando","html_url":"https://github.com/fnando","followers_url":"https://api.github.com/users/fnando/followers","following_url":"https://api.github.com/users/fnando/following{/other_user}","gists_url":"https://api.github.com/users/fnando/gists{/gist_id}","starred_url":"https://api.github.com/users/fnando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnando/subscriptions","organizations_url":"https://api.github.com/users/fnando/orgs","repos_url":"https://api.github.com/users/fnando/repos","events_url":"https://api.github.com/users/fnando/events{/privacy}","received_events_url":"https://api.github.com/users/fnando/received_events","type":"User","site_admin":false},"repo":{"id":779276,"name":"browser","full_name":"fnando/browser","owner":{"login":"fnando","id":3009,"avatar_url":"https://avatars.githubusercontent.com/u/3009?v=3","gravatar_id":"","url":"https://api.github.com/users/fnando","html_url":"https://github.com/fnando","followers_url":"https://api.github.com/users/fnando/followers","following_url":"https://api.github.com/users/fnando/following{/other_user}","gists_url":"https://api.github.com/users/fnando/gists{/gist_id}","starred_url":"https://api.github.com/users/fnando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnando/subscriptions","organizations_url":"https://api.github.com/users/fnando/orgs","repos_url":"https://api.github.com/users/fnando/repos","events_url":"https://api.github.com/users/fnando/events{/privacy}","received_events_url":"https://api.github.com/users/fnando/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fnando/browser","description":"Do some browser detection with Ruby. Includes ActionController integration.","fork":false,"url":"https://api.github.com/repos/fnando/browser","forks_url":"https://api.github.com/repos/fnando/browser/forks","keys_url":"https://api.github.com/repos/fnando/browser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fnando/browser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fnando/browser/teams","hooks_url":"https://api.github.com/repos/fnando/browser/hooks","issue_events_url":"https://api.github.com/repos/fnando/browser/issues/events{/number}","events_url":"https://api.github.com/repos/fnando/browser/events","assignees_url":"https://api.github.com/repos/fnando/browser/assignees{/user}","branches_url":"https://api.github.com/repos/fnando/browser/branches{/branch}","tags_url":"https://api.github.com/repos/fnando/browser/tags","blobs_url":"https://api.github.com/repos/fnando/browser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fnando/browser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fnando/browser/git/refs{/sha}","trees_url":"https://api.github.com/repos/fnando/browser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fnando/browser/statuses/{sha}","languages_url":"https://api.github.com/repos/fnando/browser/languages","stargazers_url":"https://api.github.com/repos/fnando/browser/stargazers","contributors_url":"https://api.github.com/repos/fnando/browser/contributors","subscribers_url":"https://api.github.com/repos/fnando/browser/subscribers","subscription_url":"https://api.github.com/repos/fnando/browser/subscription","commits_url":"https://api.github.com/repos/fnando/browser/commits{/sha}","git_commits_url":"https://api.github.com/repos/fnando/browser/git/commits{/sha}","comments_url":"https://api.github.com/repos/fnando/browser/comments{/number}","issue_comment_url":"https://api.github.com/repos/fnando/browser/issues/comments{/number}","contents_url":"https://api.github.com/repos/fnando/browser/contents/{+path}","compare_url":"https://api.github.com/repos/fnando/browser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fnando/browser/merges","archive_url":"https://api.github.com/repos/fnando/browser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fnando/browser/downloads","issues_url":"https://api.github.com/repos/fnando/browser/issues{/number}","pulls_url":"https://api.github.com/repos/fnando/browser/pulls{/number}","milestones_url":"https://api.github.com/repos/fnando/browser/milestones{/number}","notifications_url":"https://api.github.com/repos/fnando/browser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fnando/browser/labels{/name}","releases_url":"https://api.github.com/repos/fnando/browser/releases{/id}","created_at":"2010-07-16T17:25:01Z","updated_at":"2015-12-31T19:03:15Z","pushed_at":"2016-01-02T14:45:28Z","git_url":"git://github.com/fnando/browser.git","ssh_url":"git@github.com:fnando/browser.git","clone_url":"https://github.com/fnando/browser.git","svn_url":"https://github.com/fnando/browser","homepage":"","size":661,"stargazers_count":1088,"watchers_count":1088,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":205,"mirror_url":null,"open_issues_count":31,"forks":205,"open_issues":31,"watchers":1088,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fnando/browser/pulls/204"},"html":{"href":"https://github.com/fnando/browser/pull/204"},"issue":{"href":"https://api.github.com/repos/fnando/browser/issues/204"},"comments":{"href":"https://api.github.com/repos/fnando/browser/issues/204/comments"},"review_comments":{"href":"https://api.github.com/repos/fnando/browser/pulls/204/comments"},"review_comment":{"href":"https://api.github.com/repos/fnando/browser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fnando/browser/pulls/204/commits"},"statuses":{"href":"https://api.github.com/repos/fnando/browser/statuses/b067937492f938ec4185ba4a8ee726abb0b8bb56"}}}}