README.txt
[gitlive] / Netrc.js
index b28f18a..52f287e 100644 (file)
--- a/Netrc.js
+++ b/Netrc.js
@@ -1,14 +1,26 @@
 const GLib = imports.gi.GLib;
 
-const File  = imports['../File.js'].File;
-
+const File  = imports.File.File;
 
+/**
+ * usage:
+ * var cfg = Netrc.forHost('www.google.com');
+ * var uname = cfg.login
+ * var pass = cfg.password
+ *
+ *
+ */
 Netrc = {
     
     forHost: function(name)
     {
-        return this.data[name];
-    }
+        try {
+            return this._data[name];
+        } catch(e) {
+            throw "Host " + name + " was not found in netrc file (or parser could not read file..)\n";
+        }
+    
+    },
     
     _data : {},
     /**
@@ -36,13 +48,13 @@ Netrc = {
            authdata[line.machine] = line;
             
         });
-        this.data = authdata;
+        this._data = authdata;
          
-    },
+    }
     
   
     
     
 }
-//
+// load the file up.
 Netrc._load();
\ No newline at end of file