Skip to content
Permalink
Browse files

removed coffeescript, and fixed script.

  • Loading branch information
CaptainN committed May 14, 2013
1 parent 6cd153a commit 687869f9e8d13bba8bb3d30fb8cbb125c943a5da
Showing with 30 additions and 69 deletions.
  1. +0 −32 express-plates.coffee
  2. +30 −37 express-plates.js

This file was deleted.

@@ -1,43 +1,36 @@
// Generated by CoffeeScript 1.3.3
(function() {
var expressplates, fs, plates;
var plates = require('plates');
var fs = require('fs');

plates = require('plates');
function expressPlates(path, options, fn)
{
var key, result, str;

fs = require('fs');
key = path + ':string';

expressplates = function() {
return this.plates = plates;
};

expressplates.prototype = {
init: function(app) {
app.engine('.html', this.renderFile);
app.set('view engine', 'html');
return this.plates;
},
renderFile: function(path, options, fn) {
var key, result, str;
key = path + ':string';
if ('function' === typeof options) {
fn = options;
options = {};
}
try {
options.filename = path;
if (options.cache) {
str = exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8'));
} else {
str = fs.readFileSync(path, 'utf8');
}
result = plates.bind(str, options.data, options.map, fn);
return fn(null, result);
} catch (err) {
return fn(err);
}
if ('function' === typeof options) {
fn = options;
options = {};
}
try {
options.filename = path;
if (options.cache) {
str = exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8'));
} else {
str = fs.readFileSync(path, 'utf8');
}
};
result = plates.bind(str, options.data, options.map, fn);
return fn(null, result);
}
catch (err) {
return fn(err);
}
}

module.exports = new expressplates();
expressPlates.init = function initF(app)
{
app.engine('.html', expressPlates);
app.set('view engine', 'html');
return plates;
};

}).call(this);
module.exports = expressPlates;

0 comments on commit 687869f

Please sign in to comment.
You can’t perform that action at this time.