commonplace
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -167,3 +167,3 @@ (function() { | ||
test('cache rewrite on set', function(done) { | ||
test('cache rewrite on set', function(done, fail) { | ||
var rewriters = [ | ||
@@ -186,7 +186,8 @@ function(new_key, new_value, c) { | ||
done(); | ||
} | ||
}, | ||
fail | ||
); | ||
}); | ||
test('cache chained rewrite on set', function(done) { | ||
test('cache chained rewrite on set', function(done, fail) { | ||
var rewriters = [ | ||
@@ -217,7 +218,8 @@ function(new_key, new_value, c) { | ||
done(); | ||
} | ||
}, | ||
fail | ||
); | ||
}); | ||
test('cache deep rewrite on set', function(done) { | ||
test('cache deep rewrite on set', function(done, fail) { | ||
var rewriters = [ | ||
@@ -250,7 +252,8 @@ function(new_key, new_value, c) { | ||
done(); | ||
} | ||
}, | ||
fail | ||
); | ||
}); | ||
test('cache get_ttl', function(done) { | ||
test('cache get_ttl', function(done, fail) { | ||
mock( | ||
@@ -275,10 +278,14 @@ 'cache', | ||
done(); | ||
} | ||
}, | ||
fail | ||
); | ||
}); | ||
test('cache flush_signed', function(done) { | ||
test('cache flush_signed', function(done, fail) { | ||
mock( | ||
'cache', | ||
{ | ||
settings: { | ||
offline_cache_enabled: function () { return false; }, | ||
}, | ||
user: { | ||
@@ -310,7 +317,8 @@ logged_in: function() { return true; }, | ||
done(); | ||
} | ||
}, | ||
fail | ||
); | ||
}); | ||
test('cache flush_expired', function(done) { | ||
test('cache flush_expired', function(done, fail) { | ||
mock( | ||
@@ -357,3 +365,4 @@ 'cache', | ||
done(); | ||
} | ||
}, | ||
fail | ||
); | ||
@@ -360,0 +369,0 @@ }); |
@@ -21,5 +21,7 @@ var child_process = require('child_process'); | ||
if (!fs.existsSync(langpacks_path)) { | ||
console.log('Langpacks path does not exist. Creating: ' + langpacks_path); | ||
console.log('Language packs do not exist. Creating: ' + langpacks_path); | ||
fs.mkdirSync(langpacks_path); | ||
} | ||
var count = 0; | ||
utils.globEach('locale', '.po', function(filepath) { | ||
@@ -45,2 +47,5 @@ var path_regex = /locale\/([^\/]+?)\/LC_MESSAGES\/(.+?).po/; | ||
process_file(filepath, locale, path.resolve(langpacks_path, locale + '.js')); | ||
count++; | ||
}, function() { | ||
console.log('Finished generating ' + count + ' language packs.'); | ||
}); | ||
@@ -47,0 +52,0 @@ } |
@@ -133,3 +133,3 @@ var fs = require('fs'); | ||
if (err) { | ||
console.error('Unable to read langauge pack: ' + path, err); | ||
console.error('Unable to read language pack: ' + path, err); | ||
return; | ||
@@ -143,4 +143,5 @@ } | ||
} | ||
console.log('Generated: ' + dest_path); | ||
if (callback) callback(err); | ||
if (callback) { | ||
callback(err); | ||
} | ||
}); | ||
@@ -147,0 +148,0 @@ }); |
{ | ||
"name": "commonplace", | ||
"description": "Reusable components for Firefox Marketplace frontend projects.", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"main": "lib/commonplace", | ||
@@ -6,0 +6,0 @@ "preferGlobal": true, |
871223
6990