<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>apps/jsdoc/README.txt</filename>
    </added>
    <added>
      <filename>apps/jsdoc/actions.js</filename>
    </added>
    <added>
      <filename>apps/jsdoc/config.js</filename>
    </added>
    <added>
      <filename>apps/jsdoc/config/jetty.xml</filename>
    </added>
    <added>
      <filename>apps/jsdoc/config/log4j.properties</filename>
    </added>
    <added>
      <filename>apps/jsdoc/main.js</filename>
    </added>
    <added>
      <filename>apps/jsdoc/skins/base.html</filename>
    </added>
    <added>
      <filename>apps/jsdoc/skins/index.html</filename>
    </added>
    <added>
      <filename>apps/jsdoc/skins/module.html</filename>
    </added>
    <added>
      <filename>apps/jsdoc/static/style.css</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -5,22 +5,27 @@ importClass(org.helma.repository.FileRepository);
 importClass(org.helma.repository.FileResource);
 
 /**
- * Get a list of resources with the given path prefix, optionally descending into subdirectories.
+ * Get a script repository from the given path
  * @param path {String} the base path
- * @param recursive {Boolean} whether to descend into subdirectories
- * @return an Array of Resource objects
+ * @return an script repository
  */
-exports.getScriptResources = function(path, recursive) {
-    var file = new File(path);
-    var list;
-    if (!file.exists()) {
-        return [];
-    } else if (file.isDirectory()) {
-        list = new ScriptableList(new FileRepository(file).getResources(Boolean(recursive)));
-    } else {
-        list = [new FileResource(new java.io.File(path))];
+exports.ScriptRepository = function(path) {
+    return new ScriptRepository(path);
+}
+
+function ScriptRepository(path) {
+    var repo = path instanceof org.helma.repository.Repository ?
+               path : new FileRepository(new java.io.File(path));
+
+    this.getScriptResources = function(recurse) {
+        var list = new ScriptableList(repo.getResources(Boolean(recurse)));
+        return list.filter(function(r) {return r.name.endsWith('.js');});
     }
-    return list.filter(function(resource) resource.name.endsWith(&quot;.js&quot;));
+
+    this.getScriptResource = function(path) {
+        return repo.getResource(path);
+    }
+
 }
 
 /**</diff>
      <filename>modules/helma/jsdoc.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bee5876ab650b3ab5a070dab0285cd225407af2e</id>
    </parent>
  </parents>
  <author>
    <name>Hannes Walln&#246;fer</name>
    <email>hannesw@gmail.com</email>
  </author>
  <url>http://github.com/hns/helma-ng/commit/22790aa6949ca4a4f3028823e03797acc8ccf34b</url>
  <id>22790aa6949ca4a4f3028823e03797acc8ccf34b</id>
  <committed-date>2009-07-01T07:38:04-07:00</committed-date>
  <authored-date>2009-07-01T07:38:04-07:00</authored-date>
  <message>Rather rough initial sketch of jsdoc app.</message>
  <tree>e003b611674d98cb534e9b2db5d44a225a2cabdf</tree>
  <committer>
    <name>Hannes Walln&#246;fer</name>
    <email>hannesw@gmail.com</email>
  </committer>
</commit>
