xpcomcore-rubygem 0.3.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. data/README.markdown +14 -0
  2. data/Rakefile +13 -11
  3. data/VERSION +1 -1
  4. data/bin/xpcomcore +7 -0
  5. data/lib/xpcomcore-rubygem.rb +9 -0
  6. data/lib/xpcomcore-rubygem/commands.rb +54 -0
  7. data/lib/xpcomcore-rubygem/commands/generate.rb +23 -0
  8. data/lib/xpcomcore-rubygem/commands/generate/application.rb +63 -0
  9. data/lib/xpcomcore-rubygem/commands/generate/jeweler_builder_command.rb +108 -0
  10. data/lib/xpcomcore-rubygem/commands/generate/library.rb +25 -0
  11. data/lib/xpcomcore-rubygem/commands/generate/template_helpers.rb +78 -0
  12. data/lib/xpcomcore-rubygem/commands/launch.rb +129 -0
  13. data/templates/application/application.ini.erb +12 -0
  14. data/templates/application/chrome/chrome.manifest.erb +1 -0
  15. data/templates/application/chrome/content/xul/main_window.xul.erb +6 -0
  16. data/{extension → templates/application}/components/bootstrapper.js +1 -1
  17. data/templates/application/defaults/preferences/prefs.js.erb +7 -0
  18. data/templates/shared/jsdoc_doc_task.erb +7 -0
  19. data/templates/shared/xultestrunner_test_task.erb +7 -0
  20. data/xpcomcore-rubygem.gemspec +48 -136
  21. data/xpcomcore/Rakefile +42 -19
  22. data/xpcomcore/bootstrapper.js +1 -3
  23. data/xpcomcore/{VERSION.yml → build_properties.yml} +3 -0
  24. data/xpcomcore/components/XPCOMCore.js +0 -2
  25. data/xpcomcore/doc/files.html +10 -10
  26. data/xpcomcore/doc/index.html +17 -17
  27. data/xpcomcore/doc/symbols/_global_.html +10 -9
  28. data/xpcomcore/doc/symbols/{Error.html → error.html} +10 -9
  29. data/xpcomcore/doc/symbols/{File.html → file.html} +13 -12
  30. data/xpcomcore/doc/symbols/{File.NoSuchFileError.html → file.nosuchfileerror.html} +13 -12
  31. data/xpcomcore/doc/symbols/{Kernel.html → kernel.html} +48 -47
  32. data/xpcomcore/doc/symbols/{LoadError.html → loaderror.html} +13 -12
  33. data/xpcomcore/doc/symbols/{SelfConceptError.html → selfconcepterror.html} +13 -12
  34. data/xpcomcore/doc/symbols/{Sys.html → sys.html} +12 -11
  35. data/xpcomcore/doc/symbols/{XPCBuiltins.html → xpcbuiltins.html} +11 -10
  36. metadata +61 -135
  37. data/README.rdoc +0 -18
  38. data/bin/xpcomcore-firefox +0 -4
  39. data/bin/xpcomcore-rubygem-install +0 -205
  40. data/extension/README.txt +0 -1
  41. data/extension/install.rdf +0 -16
  42. data/xpcomcore/etc/jsdoc-toolkit/README.txt +0 -186
  43. data/xpcomcore/etc/jsdoc-toolkit/app/frame.js +0 -33
  44. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Chain.js +0 -102
  45. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Dumper.js +0 -144
  46. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Hash.js +0 -84
  47. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Link.js +0 -153
  48. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Namespace.js +0 -10
  49. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Opt.js +0 -134
  50. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Reflection.js +0 -26
  51. data/xpcomcore/etc/jsdoc-toolkit/app/frame/String.js +0 -93
  52. data/xpcomcore/etc/jsdoc-toolkit/app/frame/Testrun.js +0 -129
  53. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/FOODOC.js +0 -26
  54. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC.js +0 -26
  55. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +0 -159
  56. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +0 -16
  57. data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +0 -292
  58. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC.js +0 -104
  59. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +0 -200
  60. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +0 -294
  61. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +0 -126
  62. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +0 -109
  63. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Lang.js +0 -144
  64. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Parser.js +0 -145
  65. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +0 -33
  66. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +0 -645
  67. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +0 -241
  68. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +0 -41
  69. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Token.js +0 -18
  70. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +0 -332
  71. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +0 -133
  72. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Util.js +0 -32
  73. data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Walker.js +0 -474
  74. data/xpcomcore/etc/jsdoc-toolkit/app/main.js +0 -111
  75. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/commentSrcJson.js +0 -20
  76. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/frameworkPrototype.js +0 -16
  77. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/functionCall.js +0 -10
  78. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/publishSrcHilite.js +0 -62
  79. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/symbolLink.js +0 -10
  80. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagParamConfig.js +0 -31
  81. data/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagSynonyms.js +0 -43
  82. data/xpcomcore/etc/jsdoc-toolkit/app/run.js +0 -348
  83. data/xpcomcore/etc/jsdoc-toolkit/app/t/TestDoc.js +0 -144
  84. data/xpcomcore/etc/jsdoc-toolkit/app/t/runner.js +0 -13
  85. data/xpcomcore/etc/jsdoc-toolkit/app/test.js +0 -325
  86. data/xpcomcore/etc/jsdoc-toolkit/app/test/addon.js +0 -24
  87. data/xpcomcore/etc/jsdoc-toolkit/app/test/anon_inner.js +0 -14
  88. data/xpcomcore/etc/jsdoc-toolkit/app/test/augments.js +0 -31
  89. data/xpcomcore/etc/jsdoc-toolkit/app/test/augments2.js +0 -26
  90. data/xpcomcore/etc/jsdoc-toolkit/app/test/borrows.js +0 -46
  91. data/xpcomcore/etc/jsdoc-toolkit/app/test/borrows2.js +0 -23
  92. data/xpcomcore/etc/jsdoc-toolkit/app/test/config.js +0 -22
  93. data/xpcomcore/etc/jsdoc-toolkit/app/test/constructs.js +0 -18
  94. data/xpcomcore/etc/jsdoc-toolkit/app/test/encoding.js +0 -10
  95. data/xpcomcore/etc/jsdoc-toolkit/app/test/encoding_other.js +0 -12
  96. data/xpcomcore/etc/jsdoc-toolkit/app/test/event.js +0 -54
  97. data/xpcomcore/etc/jsdoc-toolkit/app/test/exports.js +0 -14
  98. data/xpcomcore/etc/jsdoc-toolkit/app/test/functions_anon.js +0 -39
  99. data/xpcomcore/etc/jsdoc-toolkit/app/test/functions_nested.js +0 -33
  100. data/xpcomcore/etc/jsdoc-toolkit/app/test/global.js +0 -13
  101. data/xpcomcore/etc/jsdoc-toolkit/app/test/globals.js +0 -25
  102. data/xpcomcore/etc/jsdoc-toolkit/app/test/ignore.js +0 -10
  103. data/xpcomcore/etc/jsdoc-toolkit/app/test/inner.js +0 -16
  104. data/xpcomcore/etc/jsdoc-toolkit/app/test/jsdoc_test.js +0 -477
  105. data/xpcomcore/etc/jsdoc-toolkit/app/test/lend.js +0 -33
  106. data/xpcomcore/etc/jsdoc-toolkit/app/test/memberof.js +0 -19
  107. data/xpcomcore/etc/jsdoc-toolkit/app/test/memberof_constructor.js +0 -17
  108. data/xpcomcore/etc/jsdoc-toolkit/app/test/module.js +0 -17
  109. data/xpcomcore/etc/jsdoc-toolkit/app/test/name.js +0 -19
  110. data/xpcomcore/etc/jsdoc-toolkit/app/test/namespace_nested.js +0 -23
  111. data/xpcomcore/etc/jsdoc-toolkit/app/test/nocode.js +0 -13
  112. data/xpcomcore/etc/jsdoc-toolkit/app/test/oblit_anon.js +0 -20
  113. data/xpcomcore/etc/jsdoc-toolkit/app/test/overview.js +0 -20
  114. data/xpcomcore/etc/jsdoc-toolkit/app/test/param_inline.js +0 -37
  115. data/xpcomcore/etc/jsdoc-toolkit/app/test/params_optional.js +0 -8
  116. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype.js +0 -17
  117. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_nested.js +0 -9
  118. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit.js +0 -13
  119. data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +0 -24
  120. data/xpcomcore/etc/jsdoc-toolkit/app/test/public.js +0 -10
  121. data/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/code.js +0 -5
  122. data/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/notcode.txt +0 -5
  123. data/xpcomcore/etc/jsdoc-toolkit/app/test/shared.js +0 -42
  124. data/xpcomcore/etc/jsdoc-toolkit/app/test/shared2.js +0 -2
  125. data/xpcomcore/etc/jsdoc-toolkit/app/test/shortcuts.js +0 -22
  126. data/xpcomcore/etc/jsdoc-toolkit/app/test/static_this.js +0 -13
  127. data/xpcomcore/etc/jsdoc-toolkit/app/test/synonyms.js +0 -31
  128. data/xpcomcore/etc/jsdoc-toolkit/app/test/tosource.js +0 -23
  129. data/xpcomcore/etc/jsdoc-toolkit/app/test/variable_redefine.js +0 -14
  130. data/xpcomcore/etc/jsdoc-toolkit/changes.txt +0 -96
  131. data/xpcomcore/etc/jsdoc-toolkit/conf/sample.conf +0 -31
  132. data/xpcomcore/etc/jsdoc-toolkit/java/build.xml +0 -36
  133. data/xpcomcore/etc/jsdoc-toolkit/java/build_1.4.xml +0 -36
  134. data/xpcomcore/etc/jsdoc-toolkit/java/classes/js.jar +0 -0
  135. data/xpcomcore/etc/jsdoc-toolkit/java/src/JsDebugRun.java +0 -21
  136. data/xpcomcore/etc/jsdoc-toolkit/java/src/JsRun.java +0 -21
  137. data/xpcomcore/etc/jsdoc-toolkit/jsdebug.jar +0 -0
  138. data/xpcomcore/etc/jsdoc-toolkit/jsrun.jar +0 -0
  139. data/xpcomcore/etc/jsdoc-toolkit/jsrun.sh +0 -52
  140. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +0 -17
  141. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +0 -56
  142. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/class.tmpl +0 -646
  143. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/index.tmpl +0 -39
  144. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/publish.js +0 -200
  145. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/default.css +0 -162
  146. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/header.html +0 -2
  147. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/index.html +0 -19
  148. data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +0 -35
@@ -1,111 +0,0 @@
1
- /**
2
- * @version $Id: main.js 795 2009-06-19 07:03:22Z micmath $
3
- */
4
-
5
- function main() {
6
- IO.include("lib/JSDOC.js");
7
- IO.includeDir("plugins/");
8
-
9
- // process the options
10
-
11
- // the -c option: options are defined in a configuration file
12
- if (JSDOC.opt.c) {
13
- eval("JSDOC.conf = " + IO.readFile(JSDOC.opt.c));
14
-
15
- LOG.inform("Using configuration file at '"+JSDOC.opt.c+"'.");
16
-
17
- for (var c in JSDOC.conf) {
18
- if (c !== "D" && !defined(JSDOC.opt[c])) { // commandline overrules config file
19
- JSDOC.opt[c] = JSDOC.conf[c];
20
- }
21
- }
22
-
23
- if (typeof JSDOC.conf["_"] != "undefined") {
24
- JSDOC.opt["_"] = JSDOC.opt["_"].concat(JSDOC.conf["_"]);
25
- }
26
-
27
- LOG.inform("With configuration: ");
28
- for (var o in JSDOC.opt) {
29
- LOG.inform(" "+o+": "+JSDOC.opt[o]);
30
- }
31
- }
32
-
33
- // be verbose
34
- if (JSDOC.opt.v) LOG.verbose = true;
35
-
36
- // send log messages to a file
37
- if (JSDOC.opt.o) LOG.out = IO.open(JSDOC.opt.o);
38
-
39
- // run the unit tests
40
- if (JSDOC.opt.T) {
41
- LOG.inform("JsDoc Toolkit running in test mode at "+new Date()+".");
42
- IO.include("frame/Testrun.js");
43
- IO.include("test.js");
44
- }
45
- else {
46
- // a template must be defined and must be a directory path
47
- if (!JSDOC.opt.t && System.getProperty("jsdoc.template.dir")) {
48
- JSDOC.opt.t = System.getProperty("jsdoc.template.dir");
49
- }
50
- if (JSDOC.opt.t && !JSDOC.opt.t.charAt(JSDOC.opt.t.length-1).match(/[\\\/]/)) {
51
- JSDOC.opt.t += SYS.slash;
52
- }
53
-
54
- // verbose messages about the options we were given
55
- LOG.inform("JsDoc Toolkit main() running at "+new Date()+".");
56
- LOG.inform("With options: ");
57
- for (var o in JSDOC.opt) {
58
- LOG.inform(" "+o+": "+JSDOC.opt[o]);
59
- }
60
-
61
- // initialize and build a symbolSet from your code
62
- JSDOC.JsDoc();
63
-
64
- // debugger's option: dump the entire symbolSet produced from your code
65
- if (JSDOC.opt.Z) {
66
- LOG.warn("So you want to see the data structure, eh? This might hang if you have circular refs...");
67
- IO.include("frame/Dumper.js");
68
- var symbols = JSDOC.JsDoc.symbolSet.toArray();
69
- for (var i = 0, l = symbols.length; i < l; i++) {
70
- var symbol = symbols[i];
71
- print("// symbol: " + symbol.alias);
72
- print(symbol.serialize());
73
- }
74
- }
75
- else {
76
- if (typeof JSDOC.opt.t != "undefined") {
77
- try {
78
- // a file named "publish.js" must exist in the template directory
79
- load(JSDOC.opt.t+"publish.js");
80
-
81
- // and must define a function named "publish"
82
- if (!publish) {
83
- LOG.warn("No publish() function is defined in that template so nothing to do.");
84
- }
85
- else {
86
- // which will be called with the symbolSet produced from your code
87
- publish(JSDOC.JsDoc.symbolSet);
88
- }
89
- }
90
- catch(e) {
91
- LOG.warn("Sorry, that doesn't seem to be a valid template: "+JSDOC.opt.t+"publish.js : "+e);
92
- }
93
- }
94
- else {
95
- LOG.warn("No template given. Might as well read the usage notes.");
96
- JSDOC.usage();
97
- }
98
- }
99
- }
100
-
101
- // notify of any warnings
102
- if (!JSDOC.opt.q && LOG.warnings.length) {
103
- print(LOG.warnings.length+" warning"+(LOG.warnings.length != 1? "s":"")+".");
104
- }
105
-
106
- // stop sending log messages to a file
107
- if (LOG.out) {
108
- LOG.out.flush();
109
- LOG.out.close();
110
- }
111
- }
@@ -1,20 +0,0 @@
1
- JSDOC.PluginManager.registerPlugin(
2
- "JSDOC.commentSrcJson",
3
- {
4
- onDocCommentSrc: function(comment) {
5
- var json;
6
- if (/^\s*@json\b/.test(comment)) {
7
- comment.src = new String(comment.src).replace("@json", "");
8
-
9
- eval("json = "+comment.src);
10
- var tagged = "";
11
- for (var i in json) {
12
- var tag = json[i];
13
- // todo handle cases where tag is an object
14
- tagged += "@"+i+" "+tag+"\n";
15
- }
16
- comment.src = tagged;
17
- }
18
- }
19
- }
20
- );
@@ -1,16 +0,0 @@
1
- JSDOC.PluginManager.registerPlugin(
2
- "JSDOC.frameworkPrototype",
3
- {
4
- onPrototypeClassCreate: function(classCreator) {
5
- var desc = "";
6
- if (classCreator.comment) {
7
- desc = classCreator.comment;
8
- }
9
- var insert = desc+"/** @name "+classCreator.name+"\n@constructor\n@scope "+classCreator.name+".prototype */"
10
-
11
- insert = insert.replace(/\*\/\/\*\*/g, "\n");
12
- /*DEBUG*///print("insert is "+insert);
13
- classCreator.addComment.data = insert;
14
- }
15
- }
16
- );
@@ -1,10 +0,0 @@
1
- JSDOC.PluginManager.registerPlugin(
2
- "JSDOC.functionCall",
3
- {
4
- onFunctionCall: function(functionCall) {
5
- if (functionCall.name == "dojo.define" && functionCall.arg1) {
6
- functionCall.doc = "/** @lends "+eval(functionCall.arg1)+".prototype */";
7
- }
8
- }
9
- }
10
- );
@@ -1,62 +0,0 @@
1
- JSDOC.PluginManager.registerPlugin(
2
- "JSDOC.publishSrcHilite",
3
- {
4
- onPublishSrc: function(src) {
5
- if (src.path in JsHilite.cache) {
6
- return; // already generated src code
7
- }
8
- else JsHilite.cache[src.path] = true;
9
-
10
- try {
11
- var sourceCode = IO.readFile(src.path);
12
- }
13
- catch(e) {
14
- print(e.message);
15
- quit();
16
- }
17
-
18
- var hiliter = new JsHilite(sourceCode, src.charset);
19
- src.hilited = hiliter.hilite();
20
- }
21
- }
22
- );
23
-
24
- function JsHilite(src, charset) {
25
-
26
- var tr = new JSDOC.TokenReader();
27
-
28
- tr.keepComments = true;
29
- tr.keepDocs = true;
30
- tr.keepWhite = true;
31
-
32
- this.tokens = tr.tokenize(new JSDOC.TextStream(src));
33
-
34
- // TODO is redefining toString() the best way?
35
- JSDOC.Token.prototype.toString = function() {
36
- return "<span class=\""+this.type+"\">"+this.data.replace(/</g, "&lt;")+"</span>";
37
- }
38
-
39
- if (!charset) charset = "utf-8";
40
-
41
- this.header = '<html><head><meta http-equiv="content-type" content="text/html; charset='+charset+'"> '+
42
- "<style>\n\
43
- .KEYW {color: #933;}\n\
44
- .COMM {color: #bbb; font-style: italic;}\n\
45
- .NUMB {color: #393;}\n\
46
- .STRN {color: #393;}\n\
47
- .REGX {color: #339;}\n\
48
- .line {border-right: 1px dotted #666; color: #666; font-style: normal;}\n\
49
- </style></head><body><pre>";
50
- this.footer = "</pre></body></html>";
51
- this.showLinenumbers = true;
52
- }
53
-
54
- JsHilite.cache = {};
55
-
56
- JsHilite.prototype.hilite = function() {
57
- var hilited = this.tokens.join("");
58
- var line = 1;
59
- if (this.showLinenumbers) hilited = hilited.replace(/(^|\n)/g, function(m){return m+"<span class='line'>"+((line<10)? " ":"")+((line<100)? " ":"")+(line++)+"</span> "});
60
-
61
- return this.header+hilited+this.footer;
62
- }
@@ -1,10 +0,0 @@
1
- JSDOC.PluginManager.registerPlugin(
2
- "JSDOC.symbolLink",
3
- {
4
- onSymbolLink: function(link) {
5
- // modify link.linkPath (the href part of the link)
6
- // or link.linkText (the text displayed)
7
- // or link.linkInner (the #name part of the link)
8
- }
9
- }
10
- );
@@ -1,31 +0,0 @@
1
- JSDOC.PluginManager.registerPlugin(
2
- "JSDOC.tagParamConfig",
3
- {
4
- onDocCommentTags: function(comment) {
5
- var currentParam = null;
6
- var tags = comment.tags;
7
- for (var i = 0, l = tags.length; i < l; i++) {
8
-
9
- if (tags[i].title == "param") {
10
- if (tags[i].name.indexOf(".") == -1) {
11
- currentParam = i;
12
- }
13
- }
14
- else if (tags[i].title == "config") {
15
- tags[i].title = "param";
16
- if (currentParam == null) {
17
- tags[i].name = "arguments"+"."+tags[i].name;
18
- }
19
- else if (tags[i].name.indexOf(tags[currentParam].name+".") != 0) {
20
- tags[i].name = tags[currentParam].name+"."+tags[i].name;
21
- }
22
- currentParam != null
23
- //tags[currentParam].properties.push(tags[i]);
24
- }
25
- else {
26
- currentParam = null;
27
- }
28
- }
29
- }
30
- }
31
- );
@@ -1,43 +0,0 @@
1
- JSDOC.PluginManager.registerPlugin(
2
- "JSDOC.tagSynonyms",
3
- {
4
- onDocCommentSrc: function(comment) {
5
- comment.src = comment.src.replace(/@methodOf\b/i, "@function\n@memberOf");
6
- comment.src = comment.src.replace(/@fieldOf\b/i, "@field\n@memberOf");
7
- },
8
-
9
- onDocCommentTags: function(comment) {
10
- for (var i = 0, l = comment.tags.length; i < l; i++) {
11
- var title = comment.tags[i].title.toLowerCase();
12
- var syn;
13
- if ((syn = JSDOC.tagSynonyms.synonyms["="+title])) {
14
- comment.tags[i].title = syn;
15
- }
16
- }
17
- }
18
- }
19
- );
20
-
21
- new Namespace(
22
- "JSDOC.tagSynonyms",
23
- function() {
24
- JSDOC.tagSynonyms.synonyms = {
25
- "=member": "memberOf",
26
- "=memberof": "memberOf",
27
- "=description": "desc",
28
- "=exception": "throws",
29
- "=argument": "param",
30
- "=returns": "return",
31
- "=classdescription": "class",
32
- "=fileoverview": "overview",
33
- "=extends": "augments",
34
- "=base": "augments",
35
- "=projectdescription": "overview",
36
- "=classdescription": "class",
37
- "=link": "see",
38
- "=borrows": "inherits",
39
- "=scope": "lends",
40
- "=construct": "constructor"
41
- }
42
- }
43
- );
@@ -1,348 +0,0 @@
1
- /**
2
- * @fileOverview
3
- * A bootstrap script that creates some basic required objects
4
- * for loading other scripts.
5
- * @author Michael Mathews, micmath@gmail.com
6
- * @version $Id: run.js 756 2009-01-07 21:32:58Z micmath $
7
- */
8
-
9
- /**
10
- * @namespace Keep track of any messages from the running script.
11
- */
12
- LOG = {
13
- warn: function(msg, e) {
14
- if (JSDOC.opt.q) return;
15
- if (e) msg = e.fileName+", line "+e.lineNumber+": "+msg;
16
-
17
- msg = ">> WARNING: "+msg;
18
- LOG.warnings.push(msg);
19
- if (LOG.out) LOG.out.write(msg+"\n");
20
- else print(msg);
21
- },
22
-
23
- inform: function(msg) {
24
- if (JSDOC.opt.q) return;
25
- msg = " > "+msg;
26
- if (LOG.out) LOG.out.write(msg+"\n");
27
- else if (typeof LOG.verbose != "undefined" && LOG.verbose) print(msg);
28
- }
29
- };
30
- LOG.warnings = [];
31
- LOG.verbose = false
32
- LOG.out = undefined;
33
-
34
- /**
35
- * @class Manipulate a filepath.
36
- */
37
- function FilePath(absPath, separator) {
38
- this.slash = separator || "/";
39
- this.root = this.slash;
40
- this.path = [];
41
- this.file = "";
42
-
43
- var parts = absPath.split(/[\\\/]/);
44
- if (parts) {
45
- if (parts.length) this.root = parts.shift() + this.slash;
46
- if (parts.length) this.file = parts.pop()
47
- if (parts.length) this.path = parts;
48
- }
49
-
50
- this.path = this.resolvePath();
51
- }
52
-
53
- /** Collapse any dot-dot or dot items in a filepath. */
54
- FilePath.prototype.resolvePath = function() {
55
- var resolvedPath = [];
56
- for (var i = 0; i < this.path.length; i++) {
57
- if (this.path[i] == "..") resolvedPath.pop();
58
- else if (this.path[i] != ".") resolvedPath.push(this.path[i]);
59
- }
60
- return resolvedPath;
61
- }
62
-
63
- /** Trim off the filename. */
64
- FilePath.prototype.toDir = function() {
65
- if (this.file) this.file = "";
66
- return this;
67
- }
68
-
69
- /** Go up a directory. */
70
- FilePath.prototype.upDir = function() {
71
- this.toDir();
72
- if (this.path.length) this.path.pop();
73
- return this;
74
- }
75
-
76
- FilePath.prototype.toString = function() {
77
- return this.root
78
- + this.path.join(this.slash)
79
- + ((this.path.length > 0)? this.slash : "")
80
- + this.file;
81
- }
82
-
83
- /**
84
- * Turn a path into just the name of the file.
85
- */
86
- FilePath.fileName = function(path) {
87
- var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
88
- return path.substring(nameStart);
89
- }
90
-
91
- /**
92
- * Get the extension of a filename
93
- */
94
- FilePath.fileExtension = function(filename) {
95
- return filename.split(".").pop().toLowerCase();
96
- };
97
-
98
- /**
99
- * Turn a path into just the directory part.
100
- */
101
- FilePath.dir = function(path) {
102
- var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
103
- return path.substring(0, nameStart-1);
104
- }
105
-
106
-
107
- importClass(java.lang.System);
108
-
109
- /**
110
- * @namespace A collection of information about your system.
111
- */
112
- SYS = {
113
- /**
114
- * Information about your operating system: arch, name, version.
115
- * @type string
116
- */
117
- os: [
118
- new String(System.getProperty("os.arch")),
119
- new String(System.getProperty("os.name")),
120
- new String(System.getProperty("os.version"))
121
- ].join(", "),
122
-
123
- /**
124
- * Which way does your slash lean.
125
- * @type string
126
- */
127
- slash: System.getProperty("file.separator")||"/",
128
-
129
- /**
130
- * The path to the working directory where you ran java.
131
- * @type string
132
- */
133
- userDir: new String(System.getProperty("user.dir")),
134
-
135
- /**
136
- * Where is Java's home folder.
137
- * @type string
138
- */
139
- javaHome: new String(System.getProperty("java.home")),
140
-
141
- /**
142
- * The absolute path to the directory containing this script.
143
- * @type string
144
- */
145
- pwd: undefined
146
- };
147
-
148
- // jsrun appends an argument, with the path to here.
149
- if (arguments[arguments.length-1].match(/^-j=(.+)/)) {
150
- if (RegExp.$1.charAt(0) == SYS.slash || RegExp.$1.charAt(1) == ":") { // absolute path to here
151
- SYS.pwd = new FilePath(RegExp.$1).toDir().toString();
152
- }
153
- else { // relative path to here
154
- SYS.pwd = new FilePath(SYS.userDir + SYS.slash + RegExp.$1).toDir().toString();
155
- }
156
- arguments.pop();
157
- }
158
- else {
159
- print("The run.js script requires you use jsrun.jar.");
160
- quit();
161
- }
162
-
163
- // shortcut
164
- var File = Packages.java.io.File;
165
-
166
- /**
167
- * @namespace A collection of functions that deal with reading a writing to disk.
168
- */
169
- IO = {
170
-
171
- /**
172
- * Create a new file in the given directory, with the given name and contents.
173
- */
174
- saveFile: function(/**string*/ outDir, /**string*/ fileName, /**string*/ content) {
175
- var out = new Packages.java.io.PrintWriter(
176
- new Packages.java.io.OutputStreamWriter(
177
- new Packages.java.io.FileOutputStream(outDir+SYS.slash+fileName),
178
- IO.encoding
179
- )
180
- );
181
- out.write(content);
182
- out.flush();
183
- out.close();
184
- },
185
-
186
- /**
187
- * @type string
188
- */
189
- readFile: function(/**string*/ path) {
190
- if (!IO.exists(path)) {
191
- throw "File doesn't exist there: "+path;
192
- }
193
- return readFile(path, IO.encoding);
194
- },
195
-
196
- /**
197
- * @param inFile
198
- * @param outDir
199
- * @param [fileName=The original filename]
200
- */
201
- copyFile: function(/**string*/ inFile, /**string*/ outDir, /**string*/ fileName) {
202
- if (fileName == null) fileName = FilePath.fileName(inFile);
203
-
204
- var inFile = new File(inFile);
205
- var outFile = new File(outDir+SYS.slash+fileName);
206
-
207
- var bis = new Packages.java.io.BufferedInputStream(new Packages.java.io.FileInputStream(inFile), 4096);
208
- var bos = new Packages.java.io.BufferedOutputStream(new Packages.java.io.FileOutputStream(outFile), 4096);
209
- var theChar;
210
- while ((theChar = bis.read()) != -1) {
211
- bos.write(theChar);
212
- }
213
- bos.close();
214
- bis.close();
215
- },
216
-
217
- /**
218
- * Creates a series of nested directories.
219
- */
220
- mkPath: function(/**Array*/ path) {
221
- if (path.constructor != Array) path = path.split(/[\\\/]/);
222
- var make = "";
223
- for (var i = 0, l = path.length; i < l; i++) {
224
- make += path[i] + SYS.slash;
225
- if (! IO.exists(make)) {
226
- IO.makeDir(make);
227
- }
228
- }
229
- },
230
-
231
- /**
232
- * Creates a directory at the given path.
233
- */
234
- makeDir: function(/**string*/ path) {
235
- (new File(path)).mkdir();
236
- },
237
-
238
- /**
239
- * @type string[]
240
- * @param dir The starting directory to look in.
241
- * @param [recurse=1] How many levels deep to scan.
242
- * @returns An array of all the paths to files in the given dir.
243
- */
244
- ls: function(/**string*/ dir, /**number*/ recurse, _allFiles, _path) {
245
- if (_path === undefined) { // initially
246
- var _allFiles = [];
247
- var _path = [dir];
248
- }
249
- if (_path.length == 0) return _allFiles;
250
- if (recurse === undefined) recurse = 1;
251
-
252
- dir = new File(dir);
253
- if (!dir.directory) return [String(dir)];
254
- var files = dir.list();
255
-
256
- for (var f = 0; f < files.length; f++) {
257
- var file = String(files[f]);
258
- if (file.match(/^\.[^\.\/\\]/)) continue; // skip dot files
259
-
260
- if ((new File(_path.join(SYS.slash)+SYS.slash+file)).list()) { // it's a directory
261
- _path.push(file);
262
- if (_path.length-1 < recurse) IO.ls(_path.join(SYS.slash), recurse, _allFiles, _path);
263
- _path.pop();
264
- }
265
- else {
266
- _allFiles.push((_path.join(SYS.slash)+SYS.slash+file).replace(SYS.slash+SYS.slash, SYS.slash));
267
- }
268
- }
269
-
270
- return _allFiles;
271
- },
272
-
273
- /**
274
- * @type boolean
275
- */
276
- exists: function(/**string*/ path) {
277
- file = new File(path);
278
-
279
- if (file.isDirectory()){
280
- return true;
281
- }
282
- if (!file.exists()){
283
- return false;
284
- }
285
- if (!file.canRead()){
286
- return false;
287
- }
288
- return true;
289
- },
290
-
291
- /**
292
- *
293
- */
294
- open: function(/**string*/ path, /**string*/ append) {
295
- var append = true;
296
- var outFile = new File(path);
297
- var out = new Packages.java.io.PrintWriter(
298
- new Packages.java.io.OutputStreamWriter(
299
- new Packages.java.io.FileOutputStream(outFile, append),
300
- IO.encoding
301
- )
302
- );
303
- return out;
304
- },
305
-
306
- /**
307
- * Sets {@link IO.encoding}.
308
- * Encoding is used when reading and writing text to files,
309
- * and in the meta tags of HTML output.
310
- */
311
- setEncoding: function(/**string*/ encoding) {
312
- if (/ISO-8859-([0-9]+)/i.test(encoding)) {
313
- IO.encoding = "ISO8859_"+RegExp.$1;
314
- }
315
- else {
316
- IO.encoding = encoding;
317
- }
318
- },
319
-
320
- /**
321
- * @default "utf-8"
322
- * @private
323
- */
324
- encoding: "utf-8",
325
-
326
- /**
327
- * Load the given script.
328
- */
329
- include: function(relativePath) {
330
- load(SYS.pwd+relativePath);
331
- },
332
-
333
- /**
334
- * Loads all scripts from the given directory path.
335
- */
336
- includeDir: function(path) {
337
- if (!path) return;
338
-
339
- for (var lib = IO.ls(SYS.pwd+path), i = 0; i < lib.length; i++)
340
- if (/\.js$/i.test(lib[i])) load(lib[i]);
341
- }
342
- }
343
-
344
- // now run the application
345
- IO.include("frame.js");
346
- IO.include("main.js");
347
-
348
- main();