-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponsibility.js
38 lines (32 loc) · 982 Bytes
/
responsibility.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
responsibility = {}
responsibility.getTests = function()
{
url = "responsibility";
downloadData(url, responsibility.recieveTests);
}
responsibility.recieveTests = function(xhr)
{
var fileData = xhr.responseText.split("\n");
currentTest = "";
responsibility.tests = {}
for (var i = 0; i < fileData.length; i++) {
if (currentTest == "") {
currentTest = "/" + fileData[i];
responsibility.tests[currentTest] = []
} else if (fileData[i] == "###") {
currentTest = "";
} else {
var name = emailParse(fileData[i]);
if (name != "" && typeof(developers.list[name]) != "undefined" && responsibility.tests[currentTest].indexOf(name) == -1)
responsibility.tests[currentTest].push(name);
}
}
tests.distribute();
}
function emailParse(str)
{
parts = str.split("@");
if (parts.length != 2)
return "";
return parts[0];
}