{"action":"created","comment":{"url":"https://api.github.com/repos/podigee/device_detector/pulls/comments/29044134","id":29044134,"diff_hunk":"@@ -14,23 +14,14 @@ def metadata_string\n \n     def extract_metadata\n       user_agent.match(regex) do |match_data|\n-        replace_metadata_string_with(match_data)\n+        metadata_string.gsub(/\\$(\\d)/) do\n+          match_data[$1.to_i].to_s\n+        end.strip","path":"lib/device_detector/metadata_extractor.rb","position":7,"original_position":7,"commit_id":"80b831d6cf78ebe176c021d69738e46ff5569cbe","original_commit_id":"80b831d6cf78ebe176c021d69738e46ff5569cbe","user":{"login":"skaes","id":17514,"avatar_url":"https://avatars.githubusercontent.com/u/17514?v=3","gravatar_id":"","url":"https://api.github.com/users/skaes","html_url":"https://github.com/skaes","followers_url":"https://api.github.com/users/skaes/followers","following_url":"https://api.github.com/users/skaes/following{/other_user}","gists_url":"https://api.github.com/users/skaes/gists{/gist_id}","starred_url":"https://api.github.com/users/skaes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skaes/subscriptions","organizations_url":"https://api.github.com/users/skaes/orgs","repos_url":"https://api.github.com/users/skaes/repos","events_url":"https://api.github.com/users/skaes/events{/privacy}","received_events_url":"https://api.github.com/users/skaes/received_events","type":"User","site_admin":false},"body":"I don't agree. `replace_meta_data_with` was a horrible name to begin with.","created_at":"2015-04-24T12:26:41Z","updated_at":"2015-04-24T12:26:41Z","html_url":"https://github.com/podigee/device_detector/pull/12#discussion_r29044134","pull_request_url":"https://api.github.com/repos/podigee/device_detector/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/podigee/device_detector/pulls/comments/29044134"},"html":{"href":"https://github.com/podigee/device_detector/pull/12#discussion_r29044134"},"pull_request":{"href":"https://api.github.com/repos/podigee/device_detector/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/podigee/device_detector/pulls/12","id":33443610,"html_url":"https://github.com/podigee/device_detector/pull/12","diff_url":"https://github.com/podigee/device_detector/pull/12.diff","patch_url":"https://github.com/podigee/device_detector/pull/12.patch","issue_url":"https://api.github.com/repos/podigee/device_detector/issues/12","number":12,"state":"open","locked":false,"title":"Bugfixes","user":{"login":"skaes","id":17514,"avatar_url":"https://avatars.githubusercontent.com/u/17514?v=3","gravatar_id":"","url":"https://api.github.com/users/skaes","html_url":"https://github.com/skaes","followers_url":"https://api.github.com/users/skaes/followers","following_url":"https://api.github.com/users/skaes/following{/other_user}","gists_url":"https://api.github.com/users/skaes/gists{/gist_id}","starred_url":"https://api.github.com/users/skaes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skaes/subscriptions","organizations_url":"https://api.github.com/users/skaes/orgs","repos_url":"https://api.github.com/users/skaes/repos","events_url":"https://api.github.com/users/skaes/events{/privacy}","received_events_url":"https://api.github.com/users/skaes/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nI had started using your gem in one of my projects, but found that many devices are not properly recognized. I have found out that about 70% of all tests of the original user agent fixtures fail. Which is really sad.\r\n\r\nThe problems are caused by flattening all regular expressions from the regex yaml files and using this flat list. This is wrong; in particular\r\n* the devices yaml files contain a two level regex structure, both of which need to match for a succesful detection\r\n* the device/televisions.yml file must not be used unless the user agent matches a regular expression containing the string \"HbbTV/\"\r\n* the ruby device detector needs additional ruby logic to match the piwik detector\r\n\r\nIn order to fix all these problems, I have added the whole set of fixtures and test which are used in the piwik project. I have also rearranged the regex yaml file structure to correspond to the piwik project and added a rake task to simplify updating the regex db.\r\n\r\nPlease let me know what you think.","created_at":"2015-04-16T12:02:24Z","updated_at":"2015-04-24T12:26:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5784eaa416afe95d8a6a69c3327b5749549ec8a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/podigee/device_detector/pulls/12/commits","review_comments_url":"https://api.github.com/repos/podigee/device_detector/pulls/12/comments","review_comment_url":"https://api.github.com/repos/podigee/device_detector/pulls/comments{/number}","comments_url":"https://api.github.com/repos/podigee/device_detector/issues/12/comments","statuses_url":"https://api.github.com/repos/podigee/device_detector/statuses/80b831d6cf78ebe176c021d69738e46ff5569cbe","head":{"label":"skaes:bugfixes-tntc","ref":"bugfixes-tntc","sha":"80b831d6cf78ebe176c021d69738e46ff5569cbe","user":{"login":"skaes","id":17514,"avatar_url":"https://avatars.githubusercontent.com/u/17514?v=3","gravatar_id":"","url":"https://api.github.com/users/skaes","html_url":"https://github.com/skaes","followers_url":"https://api.github.com/users/skaes/followers","following_url":"https://api.github.com/users/skaes/following{/other_user}","gists_url":"https://api.github.com/users/skaes/gists{/gist_id}","starred_url":"https://api.github.com/users/skaes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skaes/subscriptions","organizations_url":"https://api.github.com/users/skaes/orgs","repos_url":"https://api.github.com/users/skaes/repos","events_url":"https://api.github.com/users/skaes/events{/privacy}","received_events_url":"https://api.github.com/users/skaes/received_events","type":"User","site_admin":false},"repo":{"id":33055128,"name":"device_detector","full_name":"skaes/device_detector","owner":{"login":"skaes","id":17514,"avatar_url":"https://avatars.githubusercontent.com/u/17514?v=3","gravatar_id":"","url":"https://api.github.com/users/skaes","html_url":"https://github.com/skaes","followers_url":"https://api.github.com/users/skaes/followers","following_url":"https://api.github.com/users/skaes/following{/other_user}","gists_url":"https://api.github.com/users/skaes/gists{/gist_id}","starred_url":"https://api.github.com/users/skaes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skaes/subscriptions","organizations_url":"https://api.github.com/users/skaes/orgs","repos_url":"https://api.github.com/users/skaes/repos","events_url":"https://api.github.com/users/skaes/events{/privacy}","received_events_url":"https://api.github.com/users/skaes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/skaes/device_detector","description":"DeviceDetector is a precise and fast user agent parser and device detector written in Ruby","fork":true,"url":"https://api.github.com/repos/skaes/device_detector","forks_url":"https://api.github.com/repos/skaes/device_detector/forks","keys_url":"https://api.github.com/repos/skaes/device_detector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skaes/device_detector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skaes/device_detector/teams","hooks_url":"https://api.github.com/repos/skaes/device_detector/hooks","issue_events_url":"https://api.github.com/repos/skaes/device_detector/issues/events{/number}","events_url":"https://api.github.com/repos/skaes/device_detector/events","assignees_url":"https://api.github.com/repos/skaes/device_detector/assignees{/user}","branches_url":"https://api.github.com/repos/skaes/device_detector/branches{/branch}","tags_url":"https://api.github.com/repos/skaes/device_detector/tags","blobs_url":"https://api.github.com/repos/skaes/device_detector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skaes/device_detector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skaes/device_detector/git/refs{/sha}","trees_url":"https://api.github.com/repos/skaes/device_detector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skaes/device_detector/statuses/{sha}","languages_url":"https://api.github.com/repos/skaes/device_detector/languages","stargazers_url":"https://api.github.com/repos/skaes/device_detector/stargazers","contributors_url":"https://api.github.com/repos/skaes/device_detector/contributors","subscribers_url":"https://api.github.com/repos/skaes/device_detector/subscribers","subscription_url":"https://api.github.com/repos/skaes/device_detector/subscription","commits_url":"https://api.github.com/repos/skaes/device_detector/commits{/sha}","git_commits_url":"https://api.github.com/repos/skaes/device_detector/git/commits{/sha}","comments_url":"https://api.github.com/repos/skaes/device_detector/comments{/number}","issue_comment_url":"https://api.github.com/repos/skaes/device_detector/issues/comments{/number}","contents_url":"https://api.github.com/repos/skaes/device_detector/contents/{+path}","compare_url":"https://api.github.com/repos/skaes/device_detector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skaes/device_detector/merges","archive_url":"https://api.github.com/repos/skaes/device_detector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skaes/device_detector/downloads","issues_url":"https://api.github.com/repos/skaes/device_detector/issues{/number}","pulls_url":"https://api.github.com/repos/skaes/device_detector/pulls{/number}","milestones_url":"https://api.github.com/repos/skaes/device_detector/milestones{/number}","notifications_url":"https://api.github.com/repos/skaes/device_detector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skaes/device_detector/labels{/name}","releases_url":"https://api.github.com/repos/skaes/device_detector/releases{/id}","created_at":"2015-03-29T00:01:33Z","updated_at":"2015-03-29T00:01:33Z","pushed_at":"2015-04-16T14:10:32Z","git_url":"git://github.com/skaes/device_detector.git","ssh_url":"git@github.com:skaes/device_detector.git","clone_url":"https://github.com/skaes/device_detector.git","svn_url":"https://github.com/skaes/device_detector","homepage":"","size":359,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"podigee:develop","ref":"develop","sha":"e4e31708caea367e10c1dc837d30d453cb2e5459","user":{"login":"podigee","id":5193039,"avatar_url":"https://avatars.githubusercontent.com/u/5193039?v=3","gravatar_id":"","url":"https://api.github.com/users/podigee","html_url":"https://github.com/podigee","followers_url":"https://api.github.com/users/podigee/followers","following_url":"https://api.github.com/users/podigee/following{/other_user}","gists_url":"https://api.github.com/users/podigee/gists{/gist_id}","starred_url":"https://api.github.com/users/podigee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/podigee/subscriptions","organizations_url":"https://api.github.com/users/podigee/orgs","repos_url":"https://api.github.com/users/podigee/repos","events_url":"https://api.github.com/users/podigee/events{/privacy}","received_events_url":"https://api.github.com/users/podigee/received_events","type":"Organization","site_admin":false},"repo":{"id":28181393,"name":"device_detector","full_name":"podigee/device_detector","owner":{"login":"podigee","id":5193039,"avatar_url":"https://avatars.githubusercontent.com/u/5193039?v=3","gravatar_id":"","url":"https://api.github.com/users/podigee","html_url":"https://github.com/podigee","followers_url":"https://api.github.com/users/podigee/followers","following_url":"https://api.github.com/users/podigee/following{/other_user}","gists_url":"https://api.github.com/users/podigee/gists{/gist_id}","starred_url":"https://api.github.com/users/podigee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/podigee/subscriptions","organizations_url":"https://api.github.com/users/podigee/orgs","repos_url":"https://api.github.com/users/podigee/repos","events_url":"https://api.github.com/users/podigee/events{/privacy}","received_events_url":"https://api.github.com/users/podigee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/podigee/device_detector","description":"DeviceDetector is a precise and fast user agent parser and device detector written in Ruby","fork":false,"url":"https://api.github.com/repos/podigee/device_detector","forks_url":"https://api.github.com/repos/podigee/device_detector/forks","keys_url":"https://api.github.com/repos/podigee/device_detector/keys{/key_id}","collaborators_url":"https://api.github.com/repos/podigee/device_detector/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/podigee/device_detector/teams","hooks_url":"https://api.github.com/repos/podigee/device_detector/hooks","issue_events_url":"https://api.github.com/repos/podigee/device_detector/issues/events{/number}","events_url":"https://api.github.com/repos/podigee/device_detector/events","assignees_url":"https://api.github.com/repos/podigee/device_detector/assignees{/user}","branches_url":"https://api.github.com/repos/podigee/device_detector/branches{/branch}","tags_url":"https://api.github.com/repos/podigee/device_detector/tags","blobs_url":"https://api.github.com/repos/podigee/device_detector/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/podigee/device_detector/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/podigee/device_detector/git/refs{/sha}","trees_url":"https://api.github.com/repos/podigee/device_detector/git/trees{/sha}","statuses_url":"https://api.github.com/repos/podigee/device_detector/statuses/{sha}","languages_url":"https://api.github.com/repos/podigee/device_detector/languages","stargazers_url":"https://api.github.com/repos/podigee/device_detector/stargazers","contributors_url":"https://api.github.com/repos/podigee/device_detector/contributors","subscribers_url":"https://api.github.com/repos/podigee/device_detector/subscribers","subscription_url":"https://api.github.com/repos/podigee/device_detector/subscription","commits_url":"https://api.github.com/repos/podigee/device_detector/commits{/sha}","git_commits_url":"https://api.github.com/repos/podigee/device_detector/git/commits{/sha}","comments_url":"https://api.github.com/repos/podigee/device_detector/comments{/number}","issue_comment_url":"https://api.github.com/repos/podigee/device_detector/issues/comments{/number}","contents_url":"https://api.github.com/repos/podigee/device_detector/contents/{+path}","compare_url":"https://api.github.com/repos/podigee/device_detector/compare/{base}...{head}","merges_url":"https://api.github.com/repos/podigee/device_detector/merges","archive_url":"https://api.github.com/repos/podigee/device_detector/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/podigee/device_detector/downloads","issues_url":"https://api.github.com/repos/podigee/device_detector/issues{/number}","pulls_url":"https://api.github.com/repos/podigee/device_detector/pulls{/number}","milestones_url":"https://api.github.com/repos/podigee/device_detector/milestones{/number}","notifications_url":"https://api.github.com/repos/podigee/device_detector/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/podigee/device_detector/labels{/name}","releases_url":"https://api.github.com/repos/podigee/device_detector/releases{/id}","created_at":"2014-12-18T11:47:17Z","updated_at":"2015-04-24T07:04:33Z","pushed_at":"2015-04-16T14:10:32Z","git_url":"git://github.com/podigee/device_detector.git","ssh_url":"git@github.com:podigee/device_detector.git","clone_url":"https://github.com/podigee/device_detector.git","svn_url":"https://github.com/podigee/device_detector","homepage":"","size":709,"stargazers_count":235,"watchers_count":235,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":4,"forks":11,"open_issues":4,"watchers":235,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/podigee/device_detector/pulls/12"},"html":{"href":"https://github.com/podigee/device_detector/pull/12"},"issue":{"href":"https://api.github.com/repos/podigee/device_detector/issues/12"},"comments":{"href":"https://api.github.com/repos/podigee/device_detector/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/podigee/device_detector/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/podigee/device_detector/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/podigee/device_detector/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/podigee/device_detector/statuses/80b831d6cf78ebe176c021d69738e46ff5569cbe"}}}}