GitHub PullRequestReviewCommentEvent at 2014-04-03 16:30:45
Repository: cuttlefish
Actor: joedevivo
Payload: {"comment":{"url":"https://api.github.com/repos/basho/cuttlefish/pulls/comments/11259728","id":11259728,"diff_hunk":"@@ -373,6 +375,27 @@ engage_cuttlefish(ParsedArgs) ->\n \n     end.\n \n+-spec prune(file:name_all(), integer()) -> ok.\n+prune(Filename, MaxHistory) ->\n+    %% A Filename comes in /Abs/Path/To/something.YYYY.MM.DD.HH.mm.SS.ext\n+    %% We want `ls /Abs/Path/To/something.*.ext and delete all but the most\n+    %% recent MaxHistory\n+    Path = filename:dirname(Filename),\n+    Ext = filename:extension(Filename),\n+    Base = hd(string:tokens(filename:basename(Filename, Ext), \".\")),\n+    Files =\n+        lists:sort(filelib:wildcard(Base ++ \".*\" ++ Ext, Path)),\n+\n+    delete([ filename:join([Path, F]) || F <- Files], MaxHistory),\n+    ok.\n+\n+-spec delete(file:name_all(), integer()) -> ok.\n+delete(Files, MaxHistory) when length(Files) =< MaxHistory ->\n+    ok;\n+delete([File|Files], MaxHistory) ->\n+    _ = file:delete(File),","path":"src/cuttlefish_escript.erl","position":73,"original_position":73,"commit_id":"0d5c077847fb503bc40bcfb3fba3ac4e404946d3","original_commit_id":"0d5c077847fb503bc40bcfb3fba3ac4e404946d3","user":{"login":"joedevivo","id":55951,"avatar_url":"https://avatars.githubusercontent.com/u/55951?","gravatar_id":"4cc53ac6da2d152ba123265fbb3d1304","url":"https://api.github.com/users/joedevivo","html_url":"https://github.com/joedevivo","followers_url":"https://api.github.com/users/joedevivo/followers","following_url":"https://api.github.com/users/joedevivo/following{/other_user}","gists_url":"https://api.github.com/users/joedevivo/gists{/gist_id}","starred_url":"https://api.github.com/users/joedevivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joedevivo/subscriptions","organizations_url":"https://api.github.com/users/joedevivo/orgs","repos_url":"https://api.github.com/users/joedevivo/repos","events_url":"https://api.github.com/users/joedevivo/events{/privacy}","received_events_url":"https://api.github.com/users/joedevivo/received_events","type":"User","site_admin":false},"body":"At the point the failure would happen, the only thing left to do is write the generated file, and if by some miracle that still passes, I want it to happen.","created_at":"2014-04-03T16:30:45Z","updated_at":"2014-04-03T16:30:45Z","html_url":"https://github.com/basho/cuttlefish/pull/91#discussion_r11259728","pull_request_url":"https://api.github.com/repos/basho/cuttlefish/pulls/91","_links":{"self":{"href":"https://api.github.com/repos/basho/cuttlefish/pulls/comments/11259728"},"html":{"href":"https://github.com/basho/cuttlefish/pull/91#discussion_r11259728"},"pull_request":{"href":"https://api.github.com/repos/basho/cuttlefish/pulls/91"}}}}