{"action":"created","comment":{"url":"https://api.github.com/repos/twingly/twingly-url/pulls/comments/78956036","id":78956036,"diff_hunk":"@@ -37,6 +37,41 @@ url.host                # => \"www.twingly.co.uk\"\n url.origin              # => \"http://www.twingly.co.uk\"\n url.path                # => \"/search\"\n url.without_scheme      # => \"//www.twingly.co.uk/search\"\n+url.userinfo            # => \"\"\n+url.user                # => \"\"\n+url.password            # => \"\"\n+url.valid?              # => \"true\"\n+\n+url = Twingly::URL.parse(\"http://räksmörgås.макдональдс.рф/foo\")\n+url.scheme              # => \"http\"\n+url.trd                 # => \"räksmörgås\"\n+url.sld                 # => \"макдональдс\"\n+url.tld                 # => \"рф\"\n+url.ttld                # => \"рф\"\n+url.domain              # => \"макдональдс.рф\"\n+url.host                # => \"räksmörgås.макдональдс.рф\"\n+url.origin              # => \"http://xn--rksmrgs-5wao1o.xn--80aalb1aicli8a5i.xn--p1ai\"\n+url.path                # => \"/foo\"\n+url.without_scheme      # => \"//räksmörgås.макдональдс.рф/foo\"","path":"README.md","position":19,"original_position":19,"commit_id":"640f88ceb7126d6e748c779b1fc75cb259c4107c","original_commit_id":"640f88ceb7126d6e748c779b1fc75cb259c4107c","user":{"login":"dentarg","id":42626,"avatar_url":"https://avatars.githubusercontent.com/u/42626?v=3","gravatar_id":"","url":"https://api.github.com/users/dentarg","html_url":"https://github.com/dentarg","followers_url":"https://api.github.com/users/dentarg/followers","following_url":"https://api.github.com/users/dentarg/following{/other_user}","gists_url":"https://api.github.com/users/dentarg/gists{/gist_id}","starred_url":"https://api.github.com/users/dentarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dentarg/subscriptions","organizations_url":"https://api.github.com/users/dentarg/orgs","repos_url":"https://api.github.com/users/dentarg/repos","events_url":"https://api.github.com/users/dentarg/events{/privacy}","received_events_url":"https://api.github.com/users/dentarg/received_events","type":"User","site_admin":false},"body":"Sure, I was thinking of showing normalization examples of these URLs as another section below, but maybe inline is better?","created_at":"2016-09-15T12:55:08Z","updated_at":"2016-09-15T12:55:08Z","html_url":"https://github.com/twingly/twingly-url/pull/90#discussion_r78956036","pull_request_url":"https://api.github.com/repos/twingly/twingly-url/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/twingly/twingly-url/pulls/comments/78956036"},"html":{"href":"https://github.com/twingly/twingly-url/pull/90#discussion_r78956036"},"pull_request":{"href":"https://api.github.com/repos/twingly/twingly-url/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/twingly/twingly-url/pulls/90","id":84625457,"html_url":"https://github.com/twingly/twingly-url/pull/90","diff_url":"https://github.com/twingly/twingly-url/pull/90.diff","patch_url":"https://github.com/twingly/twingly-url/pull/90.patch","issue_url":"https://api.github.com/repos/twingly/twingly-url/issues/90","number":90,"state":"open","locked":false,"title":"Use PublicSuffix 2 to improve normalized behaviour (fix #89)","user":{"login":"dentarg","id":42626,"avatar_url":"https://avatars.githubusercontent.com/u/42626?v=3","gravatar_id":"","url":"https://api.github.com/users/dentarg","html_url":"https://github.com/dentarg","followers_url":"https://api.github.com/users/dentarg/followers","following_url":"https://api.github.com/users/dentarg/following{/other_user}","gists_url":"https://api.github.com/users/dentarg/gists{/gist_id}","starred_url":"https://api.github.com/users/dentarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dentarg/subscriptions","organizations_url":"https://api.github.com/users/dentarg/orgs","repos_url":"https://api.github.com/users/dentarg/repos","events_url":"https://api.github.com/users/dentarg/events{/privacy}","received_events_url":"https://api.github.com/users/dentarg/received_events","type":"User","site_admin":false},"body":"This PR ensure correct behaviour for normalized URLs (fixes #89), but it also changes the behaviour for non- normalized URL objects, see these snippets ([original comment](https://github.com/twingly/twingly-url/pull/90#issuecomment-247021829)):\r\n\r\nPrevious version (4.2.0):\r\n\r\n```Ruby\r\n[1] pry(main)> u1 = Twingly::URL.parse(\"https://www.foo.ایران.ir/bar\")\r\n=> #<Twingly::URL:0x3fd876a72dd8 https://www.foo.ایران.ir/bar>\r\n[2] pry(main)> u2 = Twingly::URL.parse(\"https://www.foo.xn--mgba3a4f16a.ir/bar\")\r\n=> #<Twingly::URL:0x3fd8767d277c https://www.foo.xn--mgba3a4f16a.ir/bar>\r\n[3] pry(main)>\r\n[4] pry(main)> u1.to_s\r\n=> \"https://www.foo.ایران.ir/bar\"\r\n[5] pry(main)> u2.to_s\r\n=> \"https://www.foo.xn--mgba3a4f16a.ir/bar\"\r\n[6] pry(main)>\r\n[7] pry(main)> u1.domain\r\n=> \"foo.ایران.ir\"\r\n[8] pry(main)> u2.domain\r\n=> \"foo.ایران.ir\"\r\n[9] pry(main)>\r\n[10] pry(main)> u1.tld\r\n=> \"ایران.ir\"\r\n[11] pry(main)> u2.tld\r\n=> \"ایران.ir\"\r\n```\r\n\r\nThis version:\r\n\r\n```Ruby\r\n[1] pry(main)> u1 = Twingly::URL.parse(\"https://www.foo.ایران.ir/bar\")\r\n=> #<Twingly::URL:0x3fc621fd5454 https://www.foo.ایران.ir/bar>\r\n[2] pry(main)> u2 = Twingly::URL.parse(\"https://www.foo.xn--mgba3a4f16a.ir/bar\")\r\n=> #<Twingly::URL:0x3fc621fb855c https://www.foo.xn--mgba3a4f16a.ir/bar>\r\n[3] pry(main)>\r\n[4] pry(main)> u1.to_s\r\n=> \"https://www.foo.ایران.ir/bar\"\r\n[5] pry(main)> u2.to_s\r\n=> \"https://www.foo.xn--mgba3a4f16a.ir/bar\"\r\n[6] pry(main)>\r\n[7] pry(main)> u1.domain\r\n=> \"foo.ایران.ir\"\r\n[8] pry(main)> u2.domain\r\n=> \"foo.xn--mgba3a4f16a.ir\"\r\n[9] pry(main)>\r\n[10] pry(main)> u1.tld\r\n=> \"ایران.ir\"\r\n[11] pry(main)> u2.tld\r\n=> \"xn--mgba3a4f16a.ir\"\r\n```\r\n\r\n---\r\n\r\n_Original description_\r\n\r\n~~So, yes, this increases the load time quite a bit... :)~~ Not true anymore (see 2bd6447) Haven't run the profiler yet, but we could do that.\r\n\r\nI'm open to suggestions about how we should deal with the extending of the default list, I just did something to get the discussion started.\r\n\r\n---\r\n\r\nRelated to #71. Close #85 and #89.","created_at":"2016-09-09T10:07:21Z","updated_at":"2016-09-15T12:55:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8323edae65ddfe59a08da682fe11c5e8495f2ea9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/twingly/twingly-url/pulls/90/commits","review_comments_url":"https://api.github.com/repos/twingly/twingly-url/pulls/90/comments","review_comment_url":"https://api.github.com/repos/twingly/twingly-url/pulls/comments{/number}","comments_url":"https://api.github.com/repos/twingly/twingly-url/issues/90/comments","statuses_url":"https://api.github.com/repos/twingly/twingly-url/statuses/640f88ceb7126d6e748c779b1fc75cb259c4107c","head":{"label":"twingly:public_suffix-2","ref":"public_suffix-2","sha":"640f88ceb7126d6e748c779b1fc75cb259c4107c","user":{"login":"twingly","id":280263,"avatar_url":"https://avatars.githubusercontent.com/u/280263?v=3","gravatar_id":"","url":"https://api.github.com/users/twingly","html_url":"https://github.com/twingly","followers_url":"https://api.github.com/users/twingly/followers","following_url":"https://api.github.com/users/twingly/following{/other_user}","gists_url":"https://api.github.com/users/twingly/gists{/gist_id}","starred_url":"https://api.github.com/users/twingly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twingly/subscriptions","organizations_url":"https://api.github.com/users/twingly/orgs","repos_url":"https://api.github.com/users/twingly/repos","events_url":"https://api.github.com/users/twingly/events{/privacy}","received_events_url":"https://api.github.com/users/twingly/received_events","type":"Organization","site_admin":false},"repo":{"id":12944580,"name":"twingly-url","full_name":"twingly/twingly-url","owner":{"login":"twingly","id":280263,"avatar_url":"https://avatars.githubusercontent.com/u/280263?v=3","gravatar_id":"","url":"https://api.github.com/users/twingly","html_url":"https://github.com/twingly","followers_url":"https://api.github.com/users/twingly/followers","following_url":"https://api.github.com/users/twingly/following{/other_user}","gists_url":"https://api.github.com/users/twingly/gists{/gist_id}","starred_url":"https://api.github.com/users/twingly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twingly/subscriptions","organizations_url":"https://api.github.com/users/twingly/orgs","repos_url":"https://api.github.com/users/twingly/repos","events_url":"https://api.github.com/users/twingly/events{/privacy}","received_events_url":"https://api.github.com/users/twingly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twingly/twingly-url","description":":link: Twingly URL tools","fork":false,"url":"https://api.github.com/repos/twingly/twingly-url","forks_url":"https://api.github.com/repos/twingly/twingly-url/forks","keys_url":"https://api.github.com/repos/twingly/twingly-url/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twingly/twingly-url/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twingly/twingly-url/teams","hooks_url":"https://api.github.com/repos/twingly/twingly-url/hooks","issue_events_url":"https://api.github.com/repos/twingly/twingly-url/issues/events{/number}","events_url":"https://api.github.com/repos/twingly/twingly-url/events","assignees_url":"https://api.github.com/repos/twingly/twingly-url/assignees{/user}","branches_url":"https://api.github.com/repos/twingly/twingly-url/branches{/branch}","tags_url":"https://api.github.com/repos/twingly/twingly-url/tags","blobs_url":"https://api.github.com/repos/twingly/twingly-url/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twingly/twingly-url/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twingly/twingly-url/git/refs{/sha}","trees_url":"https://api.github.com/repos/twingly/twingly-url/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twingly/twingly-url/statuses/{sha}","languages_url":"https://api.github.com/repos/twingly/twingly-url/languages","stargazers_url":"https://api.github.com/repos/twingly/twingly-url/stargazers","contributors_url":"https://api.github.com/repos/twingly/twingly-url/contributors","subscribers_url":"https://api.github.com/repos/twingly/twingly-url/subscribers","subscription_url":"https://api.github.com/repos/twingly/twingly-url/subscription","commits_url":"https://api.github.com/repos/twingly/twingly-url/commits{/sha}","git_commits_url":"https://api.github.com/repos/twingly/twingly-url/git/commits{/sha}","comments_url":"https://api.github.com/repos/twingly/twingly-url/comments{/number}","issue_comment_url":"https://api.github.com/repos/twingly/twingly-url/issues/comments{/number}","contents_url":"https://api.github.com/repos/twingly/twingly-url/contents/{+path}","compare_url":"https://api.github.com/repos/twingly/twingly-url/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twingly/twingly-url/merges","archive_url":"https://api.github.com/repos/twingly/twingly-url/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twingly/twingly-url/downloads","issues_url":"https://api.github.com/repos/twingly/twingly-url/issues{/number}","pulls_url":"https://api.github.com/repos/twingly/twingly-url/pulls{/number}","milestones_url":"https://api.github.com/repos/twingly/twingly-url/milestones{/number}","notifications_url":"https://api.github.com/repos/twingly/twingly-url/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twingly/twingly-url/labels{/name}","releases_url":"https://api.github.com/repos/twingly/twingly-url/releases{/id}","deployments_url":"https://api.github.com/repos/twingly/twingly-url/deployments","created_at":"2013-09-19T08:59:22Z","updated_at":"2016-05-23T09:50:48Z","pushed_at":"2016-09-15T12:12:06Z","git_url":"git://github.com/twingly/twingly-url.git","ssh_url":"git@github.com:twingly/twingly-url.git","clone_url":"https://github.com/twingly/twingly-url.git","svn_url":"https://github.com/twingly/twingly-url","homepage":"https://rubygems.org/gems/twingly-url","size":154,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":26,"forks":0,"open_issues":26,"watchers":2,"default_branch":"master"}},"base":{"label":"twingly:master","ref":"master","sha":"67be6287d4f0e9fbbc042050e9d8161cac6675c6","user":{"login":"twingly","id":280263,"avatar_url":"https://avatars.githubusercontent.com/u/280263?v=3","gravatar_id":"","url":"https://api.github.com/users/twingly","html_url":"https://github.com/twingly","followers_url":"https://api.github.com/users/twingly/followers","following_url":"https://api.github.com/users/twingly/following{/other_user}","gists_url":"https://api.github.com/users/twingly/gists{/gist_id}","starred_url":"https://api.github.com/users/twingly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twingly/subscriptions","organizations_url":"https://api.github.com/users/twingly/orgs","repos_url":"https://api.github.com/users/twingly/repos","events_url":"https://api.github.com/users/twingly/events{/privacy}","received_events_url":"https://api.github.com/users/twingly/received_events","type":"Organization","site_admin":false},"repo":{"id":12944580,"name":"twingly-url","full_name":"twingly/twingly-url","owner":{"login":"twingly","id":280263,"avatar_url":"https://avatars.githubusercontent.com/u/280263?v=3","gravatar_id":"","url":"https://api.github.com/users/twingly","html_url":"https://github.com/twingly","followers_url":"https://api.github.com/users/twingly/followers","following_url":"https://api.github.com/users/twingly/following{/other_user}","gists_url":"https://api.github.com/users/twingly/gists{/gist_id}","starred_url":"https://api.github.com/users/twingly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twingly/subscriptions","organizations_url":"https://api.github.com/users/twingly/orgs","repos_url":"https://api.github.com/users/twingly/repos","events_url":"https://api.github.com/users/twingly/events{/privacy}","received_events_url":"https://api.github.com/users/twingly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twingly/twingly-url","description":":link: Twingly URL tools","fork":false,"url":"https://api.github.com/repos/twingly/twingly-url","forks_url":"https://api.github.com/repos/twingly/twingly-url/forks","keys_url":"https://api.github.com/repos/twingly/twingly-url/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twingly/twingly-url/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twingly/twingly-url/teams","hooks_url":"https://api.github.com/repos/twingly/twingly-url/hooks","issue_events_url":"https://api.github.com/repos/twingly/twingly-url/issues/events{/number}","events_url":"https://api.github.com/repos/twingly/twingly-url/events","assignees_url":"https://api.github.com/repos/twingly/twingly-url/assignees{/user}","branches_url":"https://api.github.com/repos/twingly/twingly-url/branches{/branch}","tags_url":"https://api.github.com/repos/twingly/twingly-url/tags","blobs_url":"https://api.github.com/repos/twingly/twingly-url/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twingly/twingly-url/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twingly/twingly-url/git/refs{/sha}","trees_url":"https://api.github.com/repos/twingly/twingly-url/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twingly/twingly-url/statuses/{sha}","languages_url":"https://api.github.com/repos/twingly/twingly-url/languages","stargazers_url":"https://api.github.com/repos/twingly/twingly-url/stargazers","contributors_url":"https://api.github.com/repos/twingly/twingly-url/contributors","subscribers_url":"https://api.github.com/repos/twingly/twingly-url/subscribers","subscription_url":"https://api.github.com/repos/twingly/twingly-url/subscription","commits_url":"https://api.github.com/repos/twingly/twingly-url/commits{/sha}","git_commits_url":"https://api.github.com/repos/twingly/twingly-url/git/commits{/sha}","comments_url":"https://api.github.com/repos/twingly/twingly-url/comments{/number}","issue_comment_url":"https://api.github.com/repos/twingly/twingly-url/issues/comments{/number}","contents_url":"https://api.github.com/repos/twingly/twingly-url/contents/{+path}","compare_url":"https://api.github.com/repos/twingly/twingly-url/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twingly/twingly-url/merges","archive_url":"https://api.github.com/repos/twingly/twingly-url/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twingly/twingly-url/downloads","issues_url":"https://api.github.com/repos/twingly/twingly-url/issues{/number}","pulls_url":"https://api.github.com/repos/twingly/twingly-url/pulls{/number}","milestones_url":"https://api.github.com/repos/twingly/twingly-url/milestones{/number}","notifications_url":"https://api.github.com/repos/twingly/twingly-url/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twingly/twingly-url/labels{/name}","releases_url":"https://api.github.com/repos/twingly/twingly-url/releases{/id}","deployments_url":"https://api.github.com/repos/twingly/twingly-url/deployments","created_at":"2013-09-19T08:59:22Z","updated_at":"2016-05-23T09:50:48Z","pushed_at":"2016-09-15T12:12:06Z","git_url":"git://github.com/twingly/twingly-url.git","ssh_url":"git@github.com:twingly/twingly-url.git","clone_url":"https://github.com/twingly/twingly-url.git","svn_url":"https://github.com/twingly/twingly-url","homepage":"https://rubygems.org/gems/twingly-url","size":154,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":26,"forks":0,"open_issues":26,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twingly/twingly-url/pulls/90"},"html":{"href":"https://github.com/twingly/twingly-url/pull/90"},"issue":{"href":"https://api.github.com/repos/twingly/twingly-url/issues/90"},"comments":{"href":"https://api.github.com/repos/twingly/twingly-url/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/twingly/twingly-url/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/twingly/twingly-url/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/twingly/twingly-url/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/twingly/twingly-url/statuses/640f88ceb7126d6e748c779b1fc75cb259c4107c"}}}}
{"actor":{"display_login":"dentarg"}}