o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1337093726.1109068: @value"*{I" class:EFI"ProcessedAsset;FI"logical_path;F"&ems/lib/batman/lib/tools/utils.jsI" pathname;F"r/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/lib/batman/lib/tools/utils.jsI"content_type;FI"application/javascript;FI" mtime;FI"2012-05-14T17:32:22+01:00;FI" length;Fi½I" digest;F"%2d34f95187bfa76199b4b9742ab73e66I" source;FI"½(function() { var cache, cli, connect, fs, mkdir_p, parse, path; connect = require('connect'); path = require('path'); fs = require('fs'); cli = require('./cli'); parse = require("url").parse; cache = {}; exports.mkdir_p = mkdir_p = function(path, mode, callback, position) { var directory, parts; mode = mode || process.umask(); position = position || 0; parts = require("path").normalize(path).split("/"); if (position >= parts.length) { if (callback) { return callback(); } else { return true; } } directory = parts.slice(0, position + 1).join("/") || "/"; return fs.stat(directory, function(err) { if (err === null) { return mkdir_p(path, mode, callback, position + 1); } else { return fs.mkdir(directory, mode, function(err) { if (err && err.errno !== 17) { if (callback) { return callback(err); } else { throw err; } } else { return mkdir_p(path, mode, callback, position + 1); } }); } }); }; exports.CoffeeCompiler = function(options) { var destDir, srcDir; options = options || {}; srcDir = options.src || process.cwd(); destDir = options.dest || srcDir; return function(req, res, next) { var compile, compiler, dest, pathname, send, src; if ("GET" !== req.method) { return next(); } pathname = parse(req.url).pathname; compiler = { match: /\.js$/, ext: ".coffee", compile: function(str, fn) { var coffee; coffee = cache.coffee || (cache.coffee = require("coffee-script")); try { return fn(null, coffee.compile(str)); } catch (err) { return fn(err); } } }; compile = function(src, dest, next) { return fs.readFile(src, "utf8", function(err, str) { if (err) { return next(err); } else { return compiler.compile(str, function(err, str) { if (err) { return next(err); } else { return mkdir_p(path.dirname(dest), 0755, function(err) { if (err) { return next(err); } else { return fs.writeFile(dest, str, "utf8", function(err) { return next(err); }); } }); } }); } }); }; if (compiler.match.test(pathname)) { src = (srcDir + pathname).replace(compiler.match, compiler.ext); dest = destDir + pathname; send = function(err) { if (err != null) { return next(err); } else { return connect.static.send(req, res, next, { path: dest }); } }; fs.stat(src, function(err, srcStats) { if (err) { if ("ENOENT" === err.code) { return next(); } else { return next(err); } } else { return fs.stat(dest, function(err, destStats) { if (err) { if ("ENOENT" === err.code) { return compile(src, dest, send); } else { return next(err); } } else { if (srcStats.mtime > destStats.mtime) { return compile(src, dest, send); } else { return send(); } } }); } }); return; } return next(); }; }; exports.getConfig = (function() { var json, jsonOptions; try { json = fs.readFileSync(path.join(process.cwd(), 'package.json')).toString().trim(); jsonOptions = JSON.parse(json); return jsonOptions.batman; } catch (e) { if (e.code === 'EBADF') { return this.fatal('Couldn\'t find your Batman project configuration! Please put it in your package.json under the batman key.'); } else { throw e; } } }).bind(cli); }).call(this); ;FI"dependency_digest;F"%0625c3c21570383c0427561f76da40f6I"required_paths;F["r/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/lib/batman/lib/tools/utils.jsI"dependency_paths;F[{I" path;F"r/private/var/www/html/development/projects/rails/ems/app/assets/javascripts/ems/lib/batman/lib/tools/utils.jsI" mtime;FI"2012-05-14T17:32:22+01:00;FI" digest;F"%2d34f95187bfa76199b4b9742ab73e66I" _version;F"%9f3b95dd7ea3030dc35985c0a8020862