mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-16 19:50:42 +00:00
Merge branch 'jake' of git@github.com:280north/cappuccino into jake
This commit is contained in:
commit
e00c2f3c05
2 files changed
+10
-9
No files matched your search
@@ -16,6 +16,7 @@ var DefaultDictionary = nil,
|
||||
{
|
||||
CPString path;
|
||||
CPDictionary dictionary;
|
||||
CPDictionary temporaryDictionary;
|
||||
}
|
||||
|
||||
+ (void)initialize
|
||||
@@ -62,11 +63,14 @@ var DefaultDictionary = nil,
|
||||
if (self)
|
||||
{
|
||||
path = aPath;
|
||||
dictionary = [CPDictionary dictionary],
|
||||
temporaryDictionary = [CPDictionary dictionary];
|
||||
|
||||
if (path && FILE.isReadable(path))
|
||||
dictionary = plist.readPlist(path);
|
||||
|
||||
// readPlist will return nil if the file is empty
|
||||
if (!dictionary)
|
||||
dictionary = [CPDictionary dictionary];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
@@ -75,9 +75,6 @@ function gen(/*va_args*/)
|
||||
// FIXME???
|
||||
OS.system("cp -vR " + sourceTemplate + " " + destinationProject);
|
||||
|
||||
// FIXME: *JUST* for fixed glob
|
||||
require("jake");
|
||||
|
||||
var files = FILE.glob(FILE.join(destinationProject, "**", "*")),
|
||||
index = 0,
|
||||
count = files.length,
|
||||
@@ -95,16 +92,16 @@ function gen(/*va_args*/)
|
||||
if (FILE.isDirectory(path))
|
||||
continue;
|
||||
|
||||
var contents = FILE.read(path, { charset : "UTF-8" }),
|
||||
key = nil,
|
||||
keyEnumerator = [configuration keyEnumerator];
|
||||
|
||||
// FIXME: HACK
|
||||
if (path.indexOf('.gif') !== -1)
|
||||
continue;
|
||||
|
||||
var contents = FILE.read(path, { charset : "UTF-8" }),
|
||||
key = nil,
|
||||
keyEnumerator = [configuration keyEnumerator];
|
||||
|
||||
while (key = [keyEnumerator nextObject])
|
||||
contents = contents.replace(new RegExp("__" + key + "__", 'g'), [configuration valueForKey:key]);
|
||||
contents = contents.replace(new RegExp("__" + RegExp.escape(key) + "__", 'g'), [configuration valueForKey:key]);
|
||||
|
||||
FILE.write(path, contents, { charset: "UTF-8"});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user