-class RooTicket : Object
+public class RooTicket : Object
{
public string project_id_name;
+ public string summaryToBranchName()
+ {
+ // first 5 words of summary..
+ var regex = new Regex ("[^A-Za-z0-9 ]+");
+ var str = regex.replace(this.summary, this.summary.length,0, "");
+ string[] words = Regex.split_simple ("[ \t]+", str);
+ var ret = "";
+ for (var i =0; i< (words.length > 5 ? 5 : words.length); i++) {
+ ret += ret.length > 0 ? "_" : "";
+ ret += words[i];
+ }
+ return ret;
+ }
+ public string usernameLocal()
+ {
+ // git username is an email addres... - so this reutrns the local part..
+ //?? assumes that all members are under the same domain... normally the case......
+ return RooTicket.singleton().username.split("@")[0];
+
+ }
+
+
public void addTicket(Json.Object t)
{
var add = new RooTicket();
}
return null;
- }
+ }
+
public void loadTickets()
{
}
GLib.debug("found password?");
// we are gussing....
- username = bits[3];
- password = bits[5];
+
RooTicket.singleton().username = bits[3];
RooTicket.singleton().password = bits[5];
}
}
- public Gee.ArrayList<RooTicket> tickets; // only available for singletonn.
-
+
var authCode = Base64.encode ("%s:%s".printf(rs.username, rs.password).data);
message.request_headers.append("Authorization", "Basic %s".printf(authCode));
}
+
+