GitHub PullRequestReviewCommentEvent at 2014-05-30 01:06:19
Repository: cassette
Actor: charlax
Payload: {"comment":{"url":"https://api.github.com/repos/uber/cassette/pulls/comments/13213018","id":13213018,"diff_hunk":"@@ -84,18 +104,51 @@ def save_to_cache(self, file_hash, data):\n         }\n \n     def write_to_file(self):\n+        if self.is_directory:\n+            self.write_to_directory()\n+        else:\n+            self.write_to_single_file()\n+\n+        self.is_dirty = False\n+\n+    def write_to_directory(self):\n+        \"\"\"Write mocked response to a directory of files.\"\"\"\n+\n+        # Here key=request, value=response\n+        for cassette_name, response in self.data.items():\n+            filename = self.generate_filename(cassette_name)\n+            # TODO: abstract encoding type\n+            # Serialize the items via YAML\n+            encoded_str = self.dump(response.to_dict())\n+\n+            try:\n+                with open(os.path.join(self.filename, filename), 'w+') as f:","path":"cassette/cassette_library.py","position":85,"original_position":85,"commit_id":"91e11cfe45cfef033adc18647f9d5cbf97730cc6","original_commit_id":"91e11cfe45cfef033adc18647f9d5cbf97730cc6","user":{"login":"charlax","id":120501,"avatar_url":"https://avatars.githubusercontent.com/u/120501?","gravatar_id":"6cb6006443689284ac4a9c630c2ac3a9","url":"https://api.github.com/users/charlax","html_url":"https://github.com/charlax","followers_url":"https://api.github.com/users/charlax/followers","following_url":"https://api.github.com/users/charlax/following{/other_user}","gists_url":"https://api.github.com/users/charlax/gists{/gist_id}","starred_url":"https://api.github.com/users/charlax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlax/subscriptions","organizations_url":"https://api.github.com/users/charlax/orgs","repos_url":"https://api.github.com/users/charlax/repos","events_url":"https://api.github.com/users/charlax/events{/privacy}","received_events_url":"https://api.github.com/users/charlax/received_events","type":"User","site_admin":false},"body":"\"w\"","created_at":"2014-05-30T01:06:19Z","updated_at":"2014-05-30T01:06:19Z","html_url":"https://github.com/uber/cassette/pull/13#discussion_r13213018","pull_request_url":"https://api.github.com/repos/uber/cassette/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/uber/cassette/pulls/comments/13213018"},"html":{"href":"https://github.com/uber/cassette/pull/13#discussion_r13213018"},"pull_request":{"href":"https://api.github.com/repos/uber/cassette/pulls/13"}}}}