From: Alan Knowles Date: Wed, 23 May 2012 15:18:06 +0000 (+0800) Subject: tests/soup.js X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=604fc56e790b7ddfb20bcde4f7848748cd53aece tests/soup.js --- diff --git a/tests/soup.js b/tests/soup.js index 131ad06f..5f8a9c27 100644 --- a/tests/soup.js +++ b/tests/soup.js @@ -7,7 +7,22 @@ var session = new Soup.SessionSync(); File = imports['../File.js'].File; var netrc = File.read(GLib.get_home_dir() + "/.netrc"); -print(netrc); +var lines = []; +netrc.split("\n").foreach(function(nl) { + var line = {}; + var k = false; + nl.split(/\s+/).foreach(function(kv) { + if (!k) { + k = kv; + return + } + line[k] = kv + k = false; + }); + + lines[line.machine] = line; + +}); // Soup.URI is a struct. var uri = new Soup.URI.c_new("http://www.roojs.com/admin.php/Roo/person");