projects
/
gnome.introspection-doc-generator
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6257eb4
)
JSDOC/Packer.js
author
alan
<alan@alanfast.akbkhome.com>
Wed, 21 Apr 2010 06:16:04 +0000
(14:16 +0800)
committer
alan
<alan@alanfast.akbkhome.com>
Wed, 21 Apr 2010 06:16:04 +0000
(14:16 +0800)
JSDOC/Packer.js
patch
|
blob
|
history
diff --git
a/JSDOC/Packer.js
b/JSDOC/Packer.js
index
bcd1bc0
..
fc9acb8
100644
(file)
--- a/
JSDOC/Packer.js
+++ b/
JSDOC/Packer.js
@@
-72,15
+72,14
@@
Packer = function(cfg)
if (!this.files) {
throw "No Files";
}
if (!this.files) {
throw "No Files";
}
- if (!this.target) {
- throw "No Target";
- }
+
if ((this.tmpDir != Packer.prototype.tmpDir) && (!cfg.cleanup)) {
this.cleanup = false; // do not clean up files.. = as tmpdir is set.
}
this.timer = new Date() * 1;
this.packAll();
if ((this.tmpDir != Packer.prototype.tmpDir) && (!cfg.cleanup)) {
this.cleanup = false; // do not clean up files.. = as tmpdir is set.
}
this.timer = new Date() * 1;
this.packAll();
+
}
Packer.prototype = {
}
Packer.prototype = {
@@
-110,12
+109,18
@@
Packer.prototype = {
*/
cleanup : true, //
*/
cleanup : true, //
+
+ out : '', // if no target is specified - then this will contain the result
+
packAll : function() // do the packing (run from constructor)
{
//this.transOrigFile= bpath + '/../lang.en.js'; // needs better naming...
//File.write(this.transfile, "");
packAll : function() // do the packing (run from constructor)
{
//this.transOrigFile= bpath + '/../lang.en.js'; // needs better naming...
//File.write(this.transfile, "");
- File.write(this.target, "");
+ if (this.target) {
+ File.write(this.target, "");
+ }
+
if (this.debugTarget) {
File.write(this.debugTarget, "");
}
if (this.debugTarget) {
File.write(this.debugTarget, "");
}
@@
-183,7
+188,13
@@
Packer.prototype = {
print("MERGING LANGUAGE");
print("MERGING LANGUAGE");
- File.write(this.target, "if (typeof(_T) == 'undefined') { _T={};}\n");
+ var out = "if (typeof(_T) == 'undefined') { _T={};}\n"
+ if (this.target) {
+ File.write(this.target, out);
+ } else {
+ this.out += out;
+ }
+
File.write(this.translateJSON, "");
File.write(this.translateJSON, "");
@@
-194,7
+205,12
@@
Packer.prototype = {
if (File.exists(transmd5)) {
var str = File.read(transmd5);
if (str.length) {
if (File.exists(transmd5)) {
var str = File.read(transmd5);
if (str.length) {
- File.append(this.target, str + "\n");
+ if (this.target) {
+ File.append(this.target, str + "\n");
+ } else {
+ this.out += str + "\n";
+ }
+
}
if (this.cleanup) {
File.remove(transmd5);
}
if (this.cleanup) {
File.remove(transmd5);
@@
-227,7
+243,12
@@
Packer.prototype = {
var str = File.read(minfile);
print("using MIN FILE "+ minfile);
if (str.length) {
var str = File.read(minfile);
print("using MIN FILE "+ minfile);
if (str.length) {
- File.append(this.target, str + "\n");
+ if (this.target) {
+ File.append(this.target, str + "\n");
+ } else {
+ this.out += str + "\n";
+ }
+
}
if (this.cleanup) {
File.remove(minfile);
}
if (this.cleanup) {
File.remove(minfile);