{"action":"created","comment":{"url":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/comments/61122484","id":61122484,"diff_hunk":"@@ -51,30 +51,33 @@ class FasciaAPIService: NSObject {\n     func callBasicAPI(\n         path: String,\n         method: Alamofire.Method,\n-        params: [String: AnyObject]?) -> Observable<(NSData, NSHTTPURLResponse)> {\n+        params: [String: AnyObject]?) -> Observable<AnyObject> {\n \n         let request = configureManager().request(method, APIHost + path, parameters: params, encoding: .JSON, headers: nil).request\n         if let request = request {\n-            return configureManager().session.rx_response(request)\n+            return configureManager().session.rx_JSON(request)\n         } else {\n             fatalError(\"Invalid Request\")\n         }\n \n     }\n \n     func updateSession() {\n-        callBasicAPI(\"/session\", method: .POST, params: nil)\n-            .subscribeOn(Scheduler.sharedInstance.backgroundScheduler)\n-            .observeOn(Scheduler.sharedInstance.mainScheduler)\n-            .subscribeNext({ (data, response) -> Void in\n-                let cookies = NSHTTPCookie.cookiesWithResponseHeaderFields(response.allHeaderFields as! [String:String], forURL: (response.URL)!)\n-                for i in 0 ..< cookies.count {\n-                    NSHTTPCookieStorage.sharedHTTPCookieStorage().setCookie(cookies[i])\n-                }\n-                let cookiesData: NSData = NSKeyedArchiver.archivedDataWithRootObject(NSHTTPCookieStorage.sharedHTTPCookieStorage().cookies!)\n-                NSUserDefaults.standardUserDefaults().setObject(cookiesData, forKey: self.CookieKey)\n-            })\n-        .addDisposableTo(disposeBag)\n+        let request = configureManager().request(.POST, APIHost + \"/session\", parameters: nil, encoding: .JSON, headers: nil).request\n+        if let request = request {\n+            configureManager().session.rx_response(request)\n+                .subscribeOn(Scheduler.sharedInstance.backgroundScheduler)\n+                .observeOn(Scheduler.sharedInstance.mainScheduler)\n+                .subscribeNext({ (data, response) -> Void in\n+                    let cookies = NSHTTPCookie.cookiesWithResponseHeaderFields(response.allHeaderFields as! [String:String], forURL: (response.URL)!)\n+                    for i in 0 ..< cookies.count {\n+                        NSHTTPCookieStorage.sharedHTTPCookieStorage().setCookie(cookies[i])\n+                    }\n+                    let cookiesData: NSData = NSKeyedArchiver.archivedDataWithRootObject(NSHTTPCookieStorage.sharedHTTPCookieStorage().cookies!)","path":"fascia-ios/Services/FasciaAPIService.swift","position":40,"original_position":40,"commit_id":"c4aad91b5b6b29a6cd75325202b62790ba2429c5","original_commit_id":"c4aad91b5b6b29a6cd75325202b62790ba2429c5","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line Length Violation: Line should be 100 characters or less: currently 144 characters (line_length)","created_at":"2016-04-26T16:54:41Z","updated_at":"2016-04-26T16:54:41Z","html_url":"https://github.com/h3poteto/fascia-ios/pull/2#discussion_r61122484","pull_request_url":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/comments/61122484"},"html":{"href":"https://github.com/h3poteto/fascia-ios/pull/2#discussion_r61122484"},"pull_request":{"href":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/2","id":67920832,"html_url":"https://github.com/h3poteto/fascia-ios/pull/2","diff_url":"https://github.com/h3poteto/fascia-ios/pull/2.diff","patch_url":"https://github.com/h3poteto/fascia-ios/pull/2.patch","issue_url":"https://api.github.com/repos/h3poteto/fascia-ios/issues/2","number":2,"state":"open","locked":false,"title":"closes #1 projectのAPIを叩いて，project一覧を表示する","user":{"login":"h3poteto","id":4631959,"avatar_url":"https://avatars.githubusercontent.com/u/4631959?v=3","gravatar_id":"","url":"https://api.github.com/users/h3poteto","html_url":"https://github.com/h3poteto","followers_url":"https://api.github.com/users/h3poteto/followers","following_url":"https://api.github.com/users/h3poteto/following{/other_user}","gists_url":"https://api.github.com/users/h3poteto/gists{/gist_id}","starred_url":"https://api.github.com/users/h3poteto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h3poteto/subscriptions","organizations_url":"https://api.github.com/users/h3poteto/orgs","repos_url":"https://api.github.com/users/h3poteto/repos","events_url":"https://api.github.com/users/h3poteto/events{/privacy}","received_events_url":"https://api.github.com/users/h3poteto/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-26T16:54:31Z","updated_at":"2016-04-26T16:54:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"838d551dc6f38e550508ba2ea0635545fbb8a15c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/2/commits","review_comments_url":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/2/comments","review_comment_url":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/h3poteto/fascia-ios/issues/2/comments","statuses_url":"https://api.github.com/repos/h3poteto/fascia-ios/statuses/c4aad91b5b6b29a6cd75325202b62790ba2429c5","head":{"label":"h3poteto:iss-1","ref":"iss-1","sha":"c4aad91b5b6b29a6cd75325202b62790ba2429c5","user":{"login":"h3poteto","id":4631959,"avatar_url":"https://avatars.githubusercontent.com/u/4631959?v=3","gravatar_id":"","url":"https://api.github.com/users/h3poteto","html_url":"https://github.com/h3poteto","followers_url":"https://api.github.com/users/h3poteto/followers","following_url":"https://api.github.com/users/h3poteto/following{/other_user}","gists_url":"https://api.github.com/users/h3poteto/gists{/gist_id}","starred_url":"https://api.github.com/users/h3poteto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h3poteto/subscriptions","organizations_url":"https://api.github.com/users/h3poteto/orgs","repos_url":"https://api.github.com/users/h3poteto/repos","events_url":"https://api.github.com/users/h3poteto/events{/privacy}","received_events_url":"https://api.github.com/users/h3poteto/received_events","type":"User","site_admin":false},"repo":{"id":56702618,"name":"fascia-ios","full_name":"h3poteto/fascia-ios","owner":{"login":"h3poteto","id":4631959,"avatar_url":"https://avatars.githubusercontent.com/u/4631959?v=3","gravatar_id":"","url":"https://api.github.com/users/h3poteto","html_url":"https://github.com/h3poteto","followers_url":"https://api.github.com/users/h3poteto/followers","following_url":"https://api.github.com/users/h3poteto/following{/other_user}","gists_url":"https://api.github.com/users/h3poteto/gists{/gist_id}","starred_url":"https://api.github.com/users/h3poteto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h3poteto/subscriptions","organizations_url":"https://api.github.com/users/h3poteto/orgs","repos_url":"https://api.github.com/users/h3poteto/repos","events_url":"https://api.github.com/users/h3poteto/events{/privacy}","received_events_url":"https://api.github.com/users/h3poteto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/h3poteto/fascia-ios","description":"","fork":false,"url":"https://api.github.com/repos/h3poteto/fascia-ios","forks_url":"https://api.github.com/repos/h3poteto/fascia-ios/forks","keys_url":"https://api.github.com/repos/h3poteto/fascia-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h3poteto/fascia-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h3poteto/fascia-ios/teams","hooks_url":"https://api.github.com/repos/h3poteto/fascia-ios/hooks","issue_events_url":"https://api.github.com/repos/h3poteto/fascia-ios/issues/events{/number}","events_url":"https://api.github.com/repos/h3poteto/fascia-ios/events","assignees_url":"https://api.github.com/repos/h3poteto/fascia-ios/assignees{/user}","branches_url":"https://api.github.com/repos/h3poteto/fascia-ios/branches{/branch}","tags_url":"https://api.github.com/repos/h3poteto/fascia-ios/tags","blobs_url":"https://api.github.com/repos/h3poteto/fascia-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h3poteto/fascia-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h3poteto/fascia-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/h3poteto/fascia-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h3poteto/fascia-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/h3poteto/fascia-ios/languages","stargazers_url":"https://api.github.com/repos/h3poteto/fascia-ios/stargazers","contributors_url":"https://api.github.com/repos/h3poteto/fascia-ios/contributors","subscribers_url":"https://api.github.com/repos/h3poteto/fascia-ios/subscribers","subscription_url":"https://api.github.com/repos/h3poteto/fascia-ios/subscription","commits_url":"https://api.github.com/repos/h3poteto/fascia-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/h3poteto/fascia-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/h3poteto/fascia-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/h3poteto/fascia-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/h3poteto/fascia-ios/contents/{+path}","compare_url":"https://api.github.com/repos/h3poteto/fascia-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h3poteto/fascia-ios/merges","archive_url":"https://api.github.com/repos/h3poteto/fascia-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h3poteto/fascia-ios/downloads","issues_url":"https://api.github.com/repos/h3poteto/fascia-ios/issues{/number}","pulls_url":"https://api.github.com/repos/h3poteto/fascia-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/h3poteto/fascia-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/h3poteto/fascia-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h3poteto/fascia-ios/labels{/name}","releases_url":"https://api.github.com/repos/h3poteto/fascia-ios/releases{/id}","deployments_url":"https://api.github.com/repos/h3poteto/fascia-ios/deployments","created_at":"2016-04-20T16:20:53Z","updated_at":"2016-04-20T16:21:12Z","pushed_at":"2016-04-26T16:54:31Z","git_url":"git://github.com/h3poteto/fascia-ios.git","ssh_url":"git@github.com:h3poteto/fascia-ios.git","clone_url":"https://github.com/h3poteto/fascia-ios.git","svn_url":"https://github.com/h3poteto/fascia-ios","homepage":null,"size":23,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"h3poteto:master","ref":"master","sha":"405926b4f4d399165c9e19d7540f206ac8f09b1e","user":{"login":"h3poteto","id":4631959,"avatar_url":"https://avatars.githubusercontent.com/u/4631959?v=3","gravatar_id":"","url":"https://api.github.com/users/h3poteto","html_url":"https://github.com/h3poteto","followers_url":"https://api.github.com/users/h3poteto/followers","following_url":"https://api.github.com/users/h3poteto/following{/other_user}","gists_url":"https://api.github.com/users/h3poteto/gists{/gist_id}","starred_url":"https://api.github.com/users/h3poteto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h3poteto/subscriptions","organizations_url":"https://api.github.com/users/h3poteto/orgs","repos_url":"https://api.github.com/users/h3poteto/repos","events_url":"https://api.github.com/users/h3poteto/events{/privacy}","received_events_url":"https://api.github.com/users/h3poteto/received_events","type":"User","site_admin":false},"repo":{"id":56702618,"name":"fascia-ios","full_name":"h3poteto/fascia-ios","owner":{"login":"h3poteto","id":4631959,"avatar_url":"https://avatars.githubusercontent.com/u/4631959?v=3","gravatar_id":"","url":"https://api.github.com/users/h3poteto","html_url":"https://github.com/h3poteto","followers_url":"https://api.github.com/users/h3poteto/followers","following_url":"https://api.github.com/users/h3poteto/following{/other_user}","gists_url":"https://api.github.com/users/h3poteto/gists{/gist_id}","starred_url":"https://api.github.com/users/h3poteto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h3poteto/subscriptions","organizations_url":"https://api.github.com/users/h3poteto/orgs","repos_url":"https://api.github.com/users/h3poteto/repos","events_url":"https://api.github.com/users/h3poteto/events{/privacy}","received_events_url":"https://api.github.com/users/h3poteto/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/h3poteto/fascia-ios","description":"","fork":false,"url":"https://api.github.com/repos/h3poteto/fascia-ios","forks_url":"https://api.github.com/repos/h3poteto/fascia-ios/forks","keys_url":"https://api.github.com/repos/h3poteto/fascia-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h3poteto/fascia-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h3poteto/fascia-ios/teams","hooks_url":"https://api.github.com/repos/h3poteto/fascia-ios/hooks","issue_events_url":"https://api.github.com/repos/h3poteto/fascia-ios/issues/events{/number}","events_url":"https://api.github.com/repos/h3poteto/fascia-ios/events","assignees_url":"https://api.github.com/repos/h3poteto/fascia-ios/assignees{/user}","branches_url":"https://api.github.com/repos/h3poteto/fascia-ios/branches{/branch}","tags_url":"https://api.github.com/repos/h3poteto/fascia-ios/tags","blobs_url":"https://api.github.com/repos/h3poteto/fascia-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h3poteto/fascia-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h3poteto/fascia-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/h3poteto/fascia-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h3poteto/fascia-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/h3poteto/fascia-ios/languages","stargazers_url":"https://api.github.com/repos/h3poteto/fascia-ios/stargazers","contributors_url":"https://api.github.com/repos/h3poteto/fascia-ios/contributors","subscribers_url":"https://api.github.com/repos/h3poteto/fascia-ios/subscribers","subscription_url":"https://api.github.com/repos/h3poteto/fascia-ios/subscription","commits_url":"https://api.github.com/repos/h3poteto/fascia-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/h3poteto/fascia-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/h3poteto/fascia-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/h3poteto/fascia-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/h3poteto/fascia-ios/contents/{+path}","compare_url":"https://api.github.com/repos/h3poteto/fascia-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h3poteto/fascia-ios/merges","archive_url":"https://api.github.com/repos/h3poteto/fascia-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h3poteto/fascia-ios/downloads","issues_url":"https://api.github.com/repos/h3poteto/fascia-ios/issues{/number}","pulls_url":"https://api.github.com/repos/h3poteto/fascia-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/h3poteto/fascia-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/h3poteto/fascia-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h3poteto/fascia-ios/labels{/name}","releases_url":"https://api.github.com/repos/h3poteto/fascia-ios/releases{/id}","deployments_url":"https://api.github.com/repos/h3poteto/fascia-ios/deployments","created_at":"2016-04-20T16:20:53Z","updated_at":"2016-04-20T16:21:12Z","pushed_at":"2016-04-26T16:54:31Z","git_url":"git://github.com/h3poteto/fascia-ios.git","ssh_url":"git@github.com:h3poteto/fascia-ios.git","clone_url":"https://github.com/h3poteto/fascia-ios.git","svn_url":"https://github.com/h3poteto/fascia-ios","homepage":null,"size":23,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/2"},"html":{"href":"https://github.com/h3poteto/fascia-ios/pull/2"},"issue":{"href":"https://api.github.com/repos/h3poteto/fascia-ios/issues/2"},"comments":{"href":"https://api.github.com/repos/h3poteto/fascia-ios/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/h3poteto/fascia-ios/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/h3poteto/fascia-ios/statuses/c4aad91b5b6b29a6cd75325202b62790ba2429c5"}}}}