{"action":"created","comment":{"url":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/comments/27784974","id":27784974,"diff_hunk":"@@ -0,0 +1,72 @@\n+require 'uri'\n+require 'net/https'\n+\n+module RubyPushNotifications\n+  module MPNS\n+    # Encapsulates a connection to the MPNS service\n+    # Responsible for final connection with the service.\n+    #\n+    class MPNSConnection\n+\n+      # @private Content-Type HTTP Header string\n+      CONTENT_TYPE_HEADER  = 'Content-Type'\n+\n+      # @private text/xml content type\n+      X_NOTIFICATION_CLASS = 'X-NotificationClass'\n+\n+      # @private Windows Phone Target\n+      X_WINDOWSPHONE_TARGET = 'X-WindowsPhone-Target'\n+\n+      # @private text/xml content type\n+      XML_CONTENT_TYPE     = 'text/xml'\n+\n+      # @private Enumators for notification types\n+      BASEBATCH = { tile: 1, toast: 2, raw: 3 }\n+\n+      # @private Enumators for delay\n+      BATCHADDS = { delay450: 10, delay900: 20 }\n+\n+      # @private Windows Phone Target Types\n+      WP_TARGETS = { toast: 'toast', tile: 'token' }\n+\n+      # Issues a POST request to the MPNS send endpoint to\n+      # submit the given notifications.\n+      #\n+      # @param n [MPNSNotification]. The notification object to POST\n+      # @param cert [String]. Contents of the PEM encoded certificate\n+      # @return [Array]. The response of post\n+      # (http://msdn.microsoft.com/pt-br/library/windows/apps/ff941099)\n+      def self.post(n, cert)","path":"lib/ruby-push-notifications/mpns/mpns_connection.rb","position":39,"original_position":39,"commit_id":"2d9ebaaa1745bc7eb3e6b5d151c2f86dc70da1c4","original_commit_id":"2d9ebaaa1745bc7eb3e6b5d151c2f86dc70da1c4","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":"Assignment Branch Condition size for post is too high. [33.87/15]","created_at":"2015-04-06T04:47:06Z","updated_at":"2015-04-06T04:47:06Z","html_url":"https://github.com/calonso/ruby-push-notifications/pull/3#discussion_r27784974","pull_request_url":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/comments/27784974"},"html":{"href":"https://github.com/calonso/ruby-push-notifications/pull/3#discussion_r27784974"},"pull_request":{"href":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/3","id":32655997,"html_url":"https://github.com/calonso/ruby-push-notifications/pull/3","diff_url":"https://github.com/calonso/ruby-push-notifications/pull/3.diff","patch_url":"https://github.com/calonso/ruby-push-notifications/pull/3.patch","issue_url":"https://api.github.com/repos/calonso/ruby-push-notifications/issues/3","number":3,"state":"open","locked":false,"title":"MPNS Implementation","user":{"login":"lazaronixon","id":2651240,"avatar_url":"https://avatars.githubusercontent.com/u/2651240?v=3","gravatar_id":"","url":"https://api.github.com/users/lazaronixon","html_url":"https://github.com/lazaronixon","followers_url":"https://api.github.com/users/lazaronixon/followers","following_url":"https://api.github.com/users/lazaronixon/following{/other_user}","gists_url":"https://api.github.com/users/lazaronixon/gists{/gist_id}","starred_url":"https://api.github.com/users/lazaronixon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazaronixon/subscriptions","organizations_url":"https://api.github.com/users/lazaronixon/orgs","repos_url":"https://api.github.com/users/lazaronixon/repos","events_url":"https://api.github.com/users/lazaronixon/events{/privacy}","received_events_url":"https://api.github.com/users/lazaronixon/received_events","type":"User","site_admin":false},"body":"Microsoft Push Notification Service","created_at":"2015-04-05T23:07:35Z","updated_at":"2015-04-06T04:47:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63c3060c3e1b3c9693be97911cd4278f085a184d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/3/commits","review_comments_url":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/3/comments","review_comment_url":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/comments{/number}","comments_url":"https://api.github.com/repos/calonso/ruby-push-notifications/issues/3/comments","statuses_url":"https://api.github.com/repos/calonso/ruby-push-notifications/statuses/2d9ebaaa1745bc7eb3e6b5d151c2f86dc70da1c4","head":{"label":"lazaronixon:mpns","ref":"mpns","sha":"2d9ebaaa1745bc7eb3e6b5d151c2f86dc70da1c4","user":{"login":"lazaronixon","id":2651240,"avatar_url":"https://avatars.githubusercontent.com/u/2651240?v=3","gravatar_id":"","url":"https://api.github.com/users/lazaronixon","html_url":"https://github.com/lazaronixon","followers_url":"https://api.github.com/users/lazaronixon/followers","following_url":"https://api.github.com/users/lazaronixon/following{/other_user}","gists_url":"https://api.github.com/users/lazaronixon/gists{/gist_id}","starred_url":"https://api.github.com/users/lazaronixon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazaronixon/subscriptions","organizations_url":"https://api.github.com/users/lazaronixon/orgs","repos_url":"https://api.github.com/users/lazaronixon/repos","events_url":"https://api.github.com/users/lazaronixon/events{/privacy}","received_events_url":"https://api.github.com/users/lazaronixon/received_events","type":"User","site_admin":false},"repo":{"id":33416567,"name":"ruby-push-notifications","full_name":"lazaronixon/ruby-push-notifications","owner":{"login":"lazaronixon","id":2651240,"avatar_url":"https://avatars.githubusercontent.com/u/2651240?v=3","gravatar_id":"","url":"https://api.github.com/users/lazaronixon","html_url":"https://github.com/lazaronixon","followers_url":"https://api.github.com/users/lazaronixon/followers","following_url":"https://api.github.com/users/lazaronixon/following{/other_user}","gists_url":"https://api.github.com/users/lazaronixon/gists{/gist_id}","starred_url":"https://api.github.com/users/lazaronixon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazaronixon/subscriptions","organizations_url":"https://api.github.com/users/lazaronixon/orgs","repos_url":"https://api.github.com/users/lazaronixon/repos","events_url":"https://api.github.com/users/lazaronixon/events{/privacy}","received_events_url":"https://api.github.com/users/lazaronixon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lazaronixon/ruby-push-notifications","description":"iOS & Android Push Notifications made easy!!","fork":true,"url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications","forks_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/forks","keys_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/teams","hooks_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/hooks","issue_events_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/issues/events{/number}","events_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/events","assignees_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/assignees{/user}","branches_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/branches{/branch}","tags_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/tags","blobs_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/git/refs{/sha}","trees_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/statuses/{sha}","languages_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/languages","stargazers_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/stargazers","contributors_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/contributors","subscribers_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/subscribers","subscription_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/subscription","commits_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/commits{/sha}","git_commits_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/git/commits{/sha}","comments_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/comments{/number}","issue_comment_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/issues/comments{/number}","contents_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/contents/{+path}","compare_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/merges","archive_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/downloads","issues_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/issues{/number}","pulls_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/pulls{/number}","milestones_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/milestones{/number}","notifications_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/labels{/name}","releases_url":"https://api.github.com/repos/lazaronixon/ruby-push-notifications/releases{/id}","created_at":"2015-04-04T19:02:16Z","updated_at":"2015-04-04T19:02:16Z","pushed_at":"2015-04-06T04:46:59Z","git_url":"git://github.com/lazaronixon/ruby-push-notifications.git","ssh_url":"git@github.com:lazaronixon/ruby-push-notifications.git","clone_url":"https://github.com/lazaronixon/ruby-push-notifications.git","svn_url":"https://github.com/lazaronixon/ruby-push-notifications","homepage":"https://rubygems.org/gems/ruby-push-notifications","size":260,"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":"calonso:master","ref":"master","sha":"0061ecb085b8b18266347250efe2eb1a0a95650c","user":{"login":"calonso","id":2392041,"avatar_url":"https://avatars.githubusercontent.com/u/2392041?v=3","gravatar_id":"","url":"https://api.github.com/users/calonso","html_url":"https://github.com/calonso","followers_url":"https://api.github.com/users/calonso/followers","following_url":"https://api.github.com/users/calonso/following{/other_user}","gists_url":"https://api.github.com/users/calonso/gists{/gist_id}","starred_url":"https://api.github.com/users/calonso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calonso/subscriptions","organizations_url":"https://api.github.com/users/calonso/orgs","repos_url":"https://api.github.com/users/calonso/repos","events_url":"https://api.github.com/users/calonso/events{/privacy}","received_events_url":"https://api.github.com/users/calonso/received_events","type":"User","site_admin":false},"repo":{"id":31062956,"name":"ruby-push-notifications","full_name":"calonso/ruby-push-notifications","owner":{"login":"calonso","id":2392041,"avatar_url":"https://avatars.githubusercontent.com/u/2392041?v=3","gravatar_id":"","url":"https://api.github.com/users/calonso","html_url":"https://github.com/calonso","followers_url":"https://api.github.com/users/calonso/followers","following_url":"https://api.github.com/users/calonso/following{/other_user}","gists_url":"https://api.github.com/users/calonso/gists{/gist_id}","starred_url":"https://api.github.com/users/calonso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calonso/subscriptions","organizations_url":"https://api.github.com/users/calonso/orgs","repos_url":"https://api.github.com/users/calonso/repos","events_url":"https://api.github.com/users/calonso/events{/privacy}","received_events_url":"https://api.github.com/users/calonso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calonso/ruby-push-notifications","description":"iOS & Android Push Notifications made easy!!","fork":false,"url":"https://api.github.com/repos/calonso/ruby-push-notifications","forks_url":"https://api.github.com/repos/calonso/ruby-push-notifications/forks","keys_url":"https://api.github.com/repos/calonso/ruby-push-notifications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calonso/ruby-push-notifications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calonso/ruby-push-notifications/teams","hooks_url":"https://api.github.com/repos/calonso/ruby-push-notifications/hooks","issue_events_url":"https://api.github.com/repos/calonso/ruby-push-notifications/issues/events{/number}","events_url":"https://api.github.com/repos/calonso/ruby-push-notifications/events","assignees_url":"https://api.github.com/repos/calonso/ruby-push-notifications/assignees{/user}","branches_url":"https://api.github.com/repos/calonso/ruby-push-notifications/branches{/branch}","tags_url":"https://api.github.com/repos/calonso/ruby-push-notifications/tags","blobs_url":"https://api.github.com/repos/calonso/ruby-push-notifications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calonso/ruby-push-notifications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calonso/ruby-push-notifications/git/refs{/sha}","trees_url":"https://api.github.com/repos/calonso/ruby-push-notifications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calonso/ruby-push-notifications/statuses/{sha}","languages_url":"https://api.github.com/repos/calonso/ruby-push-notifications/languages","stargazers_url":"https://api.github.com/repos/calonso/ruby-push-notifications/stargazers","contributors_url":"https://api.github.com/repos/calonso/ruby-push-notifications/contributors","subscribers_url":"https://api.github.com/repos/calonso/ruby-push-notifications/subscribers","subscription_url":"https://api.github.com/repos/calonso/ruby-push-notifications/subscription","commits_url":"https://api.github.com/repos/calonso/ruby-push-notifications/commits{/sha}","git_commits_url":"https://api.github.com/repos/calonso/ruby-push-notifications/git/commits{/sha}","comments_url":"https://api.github.com/repos/calonso/ruby-push-notifications/comments{/number}","issue_comment_url":"https://api.github.com/repos/calonso/ruby-push-notifications/issues/comments{/number}","contents_url":"https://api.github.com/repos/calonso/ruby-push-notifications/contents/{+path}","compare_url":"https://api.github.com/repos/calonso/ruby-push-notifications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calonso/ruby-push-notifications/merges","archive_url":"https://api.github.com/repos/calonso/ruby-push-notifications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calonso/ruby-push-notifications/downloads","issues_url":"https://api.github.com/repos/calonso/ruby-push-notifications/issues{/number}","pulls_url":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls{/number}","milestones_url":"https://api.github.com/repos/calonso/ruby-push-notifications/milestones{/number}","notifications_url":"https://api.github.com/repos/calonso/ruby-push-notifications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calonso/ruby-push-notifications/labels{/name}","releases_url":"https://api.github.com/repos/calonso/ruby-push-notifications/releases{/id}","created_at":"2015-02-20T11:56:32Z","updated_at":"2015-04-06T02:57:49Z","pushed_at":"2015-04-06T04:47:00Z","git_url":"git://github.com/calonso/ruby-push-notifications.git","ssh_url":"git@github.com:calonso/ruby-push-notifications.git","clone_url":"https://github.com/calonso/ruby-push-notifications.git","svn_url":"https://github.com/calonso/ruby-push-notifications","homepage":"https://rubygems.org/gems/ruby-push-notifications","size":260,"stargazers_count":179,"watchers_count":179,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":179,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/3"},"html":{"href":"https://github.com/calonso/ruby-push-notifications/pull/3"},"issue":{"href":"https://api.github.com/repos/calonso/ruby-push-notifications/issues/3"},"comments":{"href":"https://api.github.com/repos/calonso/ruby-push-notifications/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/calonso/ruby-push-notifications/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/calonso/ruby-push-notifications/statuses/2d9ebaaa1745bc7eb3e6b5d151c2f86dc70da1c4"}}}}