tests/tickets.js
[gitlive] / tests / tickets.js
index a459564..b54be34 100644 (file)
@@ -3,8 +3,14 @@
  * let's see if we can pull a list of tickets from the tracker..
  *
  */
+
+GI      = imports.gi.GIRepository
 GLib        = imports.gi.GLib;
 
+// we add this in, as it appears to get lost sometimes if we set it using the ENV. variable in builder.sh
+GI.IRepository.prepend_search_path(GLib.get_home_dir() + '/.Builder/girepository-1.1');
+
+Soup = imports.gi.Soup ;
 
 
 File = imports['../File.js'].File;
@@ -29,16 +35,18 @@ Tickets = {
         
     },
     
-    fetchBugs : function()
+    fetchBugs : function(url)
     {
-        var session = new Soup.SessionSync();
+        Tickets.parseNetrc();
+        var ar = url.split('/');
+        print(JSON.stringify(ar, null, 4));
         
-        var status = session.send_message(
-            new Soup.Message({
+        var session = new Soup.SessionSync();
+        var request = new Soup.Message({
                 method:"GET",
-                uri:new Soup.URI.c_new("http://roojs.com/mtrack.php/Bugs")
-            })                                          
-        );
+                uri:new Soup.URI.c_new()
+            });
+        var status = session.send_message(request); 
         
         var data = request.response_body.data;
         print(data);
@@ -49,7 +57,7 @@ Tickets = {
     
 }
 
-Tickets.parseNetrc();
+
 //print ( JSON.stringify(Tickets.machines) );
 
-Tickets.fetchBugs();
+Tickets.fetchBugs("http://roojs.com/mtrack.php/Bugs");