Comparing version 0.0.7 to 0.0.8
@@ -14,3 +14,3 @@ // Generated by CoffeeScript 1.6.3 | ||
ProductionCache.prototype.route = function(conf) { | ||
var app, name, route, script, scripts, src, _i, _len, _results; | ||
var app, name, script, scripts, src, _i, _len, _results; | ||
app = conf.app; | ||
@@ -23,22 +23,25 @@ scripts = conf.scripts; | ||
script = scripts[_i]; | ||
route = "/" + name + "/" + script; | ||
_results.push(app.get(route, function(req, res) { | ||
var file, match; | ||
res.header({ | ||
'Content-Type': 'text/javascript' | ||
}); | ||
if (cache[route] != null) { | ||
return res.send(cache[route]); | ||
} | ||
match = req.path.match(new RegExp("^\/" + name + "\/(.*)")); | ||
file = path.join(src, match[1]); | ||
return fs.readFile(file, function(err, data) { | ||
if (err == null) { | ||
cache[route] = data; | ||
return res.send(data); | ||
_results.push((function(script) { | ||
var route; | ||
route = "/" + name + "/" + script; | ||
return app.get(route, function(req, res) { | ||
var file, match; | ||
res.header({ | ||
'Content-Type': 'text/javascript' | ||
}); | ||
if (cache[route] != null) { | ||
return res.send(cache[route]); | ||
} | ||
res.statusCode = 404; | ||
return res.send(); | ||
match = req.path.match(new RegExp("^\/" + name + "\/(.*)")); | ||
file = path.join(src, match[1]); | ||
return fs.readFile(file, function(err, data) { | ||
if (err == null) { | ||
cache[route] = data; | ||
return res.send(data); | ||
} | ||
res.statusCode = 404; | ||
return res.send(); | ||
}); | ||
}); | ||
})); | ||
})(script)); | ||
} | ||
@@ -45,0 +48,0 @@ return _results; |
{ | ||
"name": "cetera", | ||
"description": "effortlessness, requirejs, packager, modules", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"author": "nomilous <nomilous@gmail.com", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -6,3 +6,3 @@ cetera | ||
### version 0.0.7 (high alpha) | ||
### version 0.0.8 (high alpha) | ||
@@ -9,0 +9,0 @@ |
Sorry, the diff of this file is not supported yet
12601
118