GitHub PullRequestReviewCommentEvent at 2014-10-31 15:18:35
Repository: homebrew
Actor: mikemcquaid
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/19672416","id":19672416,"diff_hunk":"@@ -0,0 +1,80 @@\n+require \"formula\"\n+\n+class Ip2location < Formula\n+  homepage \"http://www.ip2location.com\"\n+  url \"https://github.com/velikanov/ip2location/archive/v7.0.0.4.tar.gz\"\n+  sha1 \"1c84fcec378c3a833f14294ed221cf6e9ed38af4\"\n+\n+  def install\n+    lib.mkpath\n+    system \"./configure\", \"--prefix=#{prefix}\"\n+    system \"make\"\n+    system \"make\", \"install\"\n+\n+    include.install \"IP2Loc_DBInterface.h\", \"IP2Location.h\"\n+\n+    ip2location_data = Pathname.new \"#{var}/IP2Location\"\n+    ip2location_data.mkpath\n+    ip2location_data.install \"country_test_ipv4_data.txt\"\n+\n+    legacy_data = Pathname.new \"#{HOMEBREW_PREFIX}/share/IP2Location\"\n+    legacy_data.mkpath unless legacy_data.exist? or legacy_data.symlink?\n+  end\n+\n+  test do\n+    system \"curl\", \"-O\", \"http://www.ip2location.com/downloads/sample.bin.db1.zip\"\n+    system \"unzip\", \"-o\", \"sample.bin.db1.zip\"\n+\n+    ip2location_data = Pathname.new \"#{var}/IP2Location\"\n+\n+    legacy_data = Pathname.new \"#{HOMEBREW_PREFIX}/share/IP2Location\"\n+    legacy_data.install \"IP-COUNTRY-SAMPLE.BIN\"\n+\n+    (testpath/'test.cpp').write <<-EOS.undent\n+      #include <stdio.h>\n+      #include <string.h>\n+      #include <IP2Location.h>\n+      int main() {\n+        FILE *f4;\n+        char ipAddress[30];\n+        char expectedCountry[3];\n+        int failed = 0;\n+        int test_num = 1;\n+\n+        IP2Location *IP2Location4 = IP2Location_open(\"#{legacy_data}/IP-COUNTRY-SAMPLE.BIN\");\n+        IP2LocationRecord *record4 = NULL;\n+\n+        if(IP2Location_open_mem(IP2Location4, IP2LOCATION_SHARED_MEMORY) == -1)\n+        {\n+          fprintf(stderr, \"IPv4: Call to IP2Location_open_mem failed\\\\n\");\n+        }\n+\n+        f4 = fopen(\"#{ip2location_data}/country_test_ipv4_data.txt\", \"r\");\n+\n+        while (fscanf(f4, \"%s\", ipAddress) != EOF) {\n+          fscanf(f4, \"%s\", expectedCountry);\n+          record4 = IP2Location_get_all(IP2Location4, ipAddress);\n+\n+          if (record4 != NULL) {\n+            if (strcmp(expectedCountry, record4->country_short) != 0) {\n+              fprintf(stderr, \"Test IPv4 Address %s (Test %d) failed. We got %s but expected %s,\\\\n\", ipAddress, test_num, record4->country_short, expectedCountry);\n+              failed++;\n+            } else {\n+              fprintf(stdout, \"Test IPv4 Address %s (Test %d) passed. We got %s as expected\\\\n\", ipAddress, test_num, record4->country_short);\n+            }\n+\n+            IP2Location_free_record(record4);\n+            test_num++;\n+          }\n+        }\n+\n+        fclose(f4);\n+        IP2Location_close(IP2Location4);\n+\n+        return failed;\n+      }\n+    EOS","path":"Library/Formula/ip2location.rb","position":76,"original_position":76,"commit_id":"ba9818528e7527f2294828a163be296ed5c3511f","original_commit_id":"ba9818528e7527f2294828a163be296ed5c3511f","user":{"login":"mikemcquaid","id":125011,"avatar_url":"https://avatars.githubusercontent.com/u/125011?v=2","gravatar_id":"","url":"https://api.github.com/users/mikemcquaid","html_url":"https://github.com/mikemcquaid","followers_url":"https://api.github.com/users/mikemcquaid/followers","following_url":"https://api.github.com/users/mikemcquaid/following{/other_user}","gists_url":"https://api.github.com/users/mikemcquaid/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemcquaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemcquaid/subscriptions","organizations_url":"https://api.github.com/users/mikemcquaid/orgs","repos_url":"https://api.github.com/users/mikemcquaid/repos","events_url":"https://api.github.com/users/mikemcquaid/events{/privacy}","received_events_url":"https://api.github.com/users/mikemcquaid/received_events","type":"User","site_admin":true},"body":"Would be good if we could slim this down a bit; we don't need to e.g. do any error checking in here.","created_at":"2014-10-31T15:18:35Z","updated_at":"2014-10-31T15:18:35Z","html_url":"https://github.com/Homebrew/homebrew/pull/33758#discussion_r19672416","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/33758","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/19672416"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/33758#discussion_r19672416"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/33758"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/33758","id":23633579,"html_url":"https://github.com/Homebrew/homebrew/pull/33758","diff_url":"https://github.com/Homebrew/homebrew/pull/33758.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/33758.patch","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/33758","number":33758,"state":"open","locked":false,"title":"ip2location v7.0.0 (new formula)","user":{"login":"velikanov","id":4798469,"avatar_url":"https://avatars.githubusercontent.com/u/4798469?v=2","gravatar_id":"","url":"https://api.github.com/users/velikanov","html_url":"https://github.com/velikanov","followers_url":"https://api.github.com/users/velikanov/followers","following_url":"https://api.github.com/users/velikanov/following{/other_user}","gists_url":"https://api.github.com/users/velikanov/gists{/gist_id}","starred_url":"https://api.github.com/users/velikanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/velikanov/subscriptions","organizations_url":"https://api.github.com/users/velikanov/orgs","repos_url":"https://api.github.com/users/velikanov/repos","events_url":"https://api.github.com/users/velikanov/events{/privacy}","received_events_url":"https://api.github.com/users/velikanov/received_events","type":"User","site_admin":false},"body":"ip2location v7.0.0 geolocation library","created_at":"2014-10-30T19:55:24Z","updated_at":"2014-10-31T15:18:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d028cfedb5eb89a35e5354442b2d61034ebb1c06","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/33758/commits","review_comments_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/33758/comments","review_comment_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/33758/comments","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/ba9818528e7527f2294828a163be296ed5c3511f","head":{"label":"velikanov:ip2location","ref":"ip2location","sha":"ba9818528e7527f2294828a163be296ed5c3511f","user":{"login":"velikanov","id":4798469,"avatar_url":"https://avatars.githubusercontent.com/u/4798469?v=2","gravatar_id":"","url":"https://api.github.com/users/velikanov","html_url":"https://github.com/velikanov","followers_url":"https://api.github.com/users/velikanov/followers","following_url":"https://api.github.com/users/velikanov/following{/other_user}","gists_url":"https://api.github.com/users/velikanov/gists{/gist_id}","starred_url":"https://api.github.com/users/velikanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/velikanov/subscriptions","organizations_url":"https://api.github.com/users/velikanov/orgs","repos_url":"https://api.github.com/users/velikanov/repos","events_url":"https://api.github.com/users/velikanov/events{/privacy}","received_events_url":"https://api.github.com/users/velikanov/received_events","type":"User","site_admin":false},"repo":{"id":25987103,"name":"homebrew","full_name":"velikanov/homebrew","owner":{"login":"velikanov","id":4798469,"avatar_url":"https://avatars.githubusercontent.com/u/4798469?v=2","gravatar_id":"","url":"https://api.github.com/users/velikanov","html_url":"https://github.com/velikanov","followers_url":"https://api.github.com/users/velikanov/followers","following_url":"https://api.github.com/users/velikanov/following{/other_user}","gists_url":"https://api.github.com/users/velikanov/gists{/gist_id}","starred_url":"https://api.github.com/users/velikanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/velikanov/subscriptions","organizations_url":"https://api.github.com/users/velikanov/orgs","repos_url":"https://api.github.com/users/velikanov/repos","events_url":"https://api.github.com/users/velikanov/events{/privacy}","received_events_url":"https://api.github.com/users/velikanov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/velikanov/homebrew","description":"The missing package manager for OS X.","fork":true,"url":"https://api.github.com/repos/velikanov/homebrew","forks_url":"https://api.github.com/repos/velikanov/homebrew/forks","keys_url":"https://api.github.com/repos/velikanov/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/velikanov/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/velikanov/homebrew/teams","hooks_url":"https://api.github.com/repos/velikanov/homebrew/hooks","issue_events_url":"https://api.github.com/repos/velikanov/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/velikanov/homebrew/events","assignees_url":"https://api.github.com/repos/velikanov/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/velikanov/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/velikanov/homebrew/tags","blobs_url":"https://api.github.com/repos/velikanov/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/velikanov/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/velikanov/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/velikanov/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/velikanov/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/velikanov/homebrew/languages","stargazers_url":"https://api.github.com/repos/velikanov/homebrew/stargazers","contributors_url":"https://api.github.com/repos/velikanov/homebrew/contributors","subscribers_url":"https://api.github.com/repos/velikanov/homebrew/subscribers","subscription_url":"https://api.github.com/repos/velikanov/homebrew/subscription","commits_url":"https://api.github.com/repos/velikanov/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/velikanov/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/velikanov/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/velikanov/homebrew/issues/comments/{number}","contents_url":"https://api.github.com/repos/velikanov/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/velikanov/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/velikanov/homebrew/merges","archive_url":"https://api.github.com/repos/velikanov/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/velikanov/homebrew/downloads","issues_url":"https://api.github.com/repos/velikanov/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/velikanov/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/velikanov/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/velikanov/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/velikanov/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/velikanov/homebrew/releases{/id}","created_at":"2014-10-30T19:49:48Z","updated_at":"2014-10-30T18:51:15Z","pushed_at":"2014-10-31T15:04:34Z","git_url":"git://github.com/velikanov/homebrew.git","ssh_url":"git@github.com:velikanov/homebrew.git","clone_url":"https://github.com/velikanov/homebrew.git","svn_url":"https://github.com/velikanov/homebrew","homepage":"http://brew.sh","size":46844,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":false,"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":"master"}},"base":{"label":"Homebrew:master","ref":"master","sha":"23bdce600e0fcfcdcb85ae02c76061a26d1f1148","user":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=2","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"repo":{"id":206084,"name":"homebrew","full_name":"Homebrew/homebrew","owner":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=2","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Homebrew/homebrew","description":"The missing package manager for OS X.","fork":false,"url":"https://api.github.com/repos/Homebrew/homebrew","forks_url":"https://api.github.com/repos/Homebrew/homebrew/forks","keys_url":"https://api.github.com/repos/Homebrew/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/homebrew/teams","hooks_url":"https://api.github.com/repos/Homebrew/homebrew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/homebrew/events","assignees_url":"https://api.github.com/repos/Homebrew/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/homebrew/tags","blobs_url":"https://api.github.com/repos/Homebrew/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/homebrew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/homebrew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/homebrew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/homebrew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/homebrew/subscription","commits_url":"https://api.github.com/repos/Homebrew/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments/{number}","contents_url":"https://api.github.com/repos/Homebrew/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/homebrew/merges","archive_url":"https://api.github.com/repos/Homebrew/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/homebrew/downloads","issues_url":"https://api.github.com/repos/Homebrew/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/homebrew/releases{/id}","created_at":"2009-05-20T19:38:37Z","updated_at":"2014-10-31T08:59:51Z","pushed_at":"2014-10-31T15:15:30Z","git_url":"git://github.com/Homebrew/homebrew.git","ssh_url":"git@github.com:Homebrew/homebrew.git","clone_url":"https://github.com/Homebrew/homebrew.git","svn_url":"https://github.com/Homebrew/homebrew","homepage":"http://brew.sh","size":1236072,"stargazers_count":19850,"watchers_count":19850,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":9833,"mirror_url":null,"open_issues_count":245,"forks":9833,"open_issues":245,"watchers":19850,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/33758"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/33758"},"issue":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/33758"},"comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/33758/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/33758/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/33758/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/homebrew/statuses/ba9818528e7527f2294828a163be296ed5c3511f"}}}}