From 604fc56e790b7ddfb20bcde4f7848748cd53aece Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 23 May 2012 23:18:06 +0800 Subject: [PATCH] tests/soup.js --- tests/soup.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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"); -- 2.39.2