Skip to content

Commit

Permalink
Remove check for open_ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
akaspin committed Oct 29, 2010
1 parent c6eec74 commit d6d9b68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
12 changes: 1 addition & 11 deletions index.js
@@ -1,13 +1,5 @@
var path = require("path");

// openssl support
var have_openssl;
try {
var crypto = require('crypto');
have_openssl=true;
} catch (e) {
have_openssl=false;
}
var crypto = require('crypto');

var parser = require("./parser");
var compiler = require("./compiler");
Expand All @@ -29,11 +21,9 @@ function compile(origin, options, callback) {

// If caching enabled -
if (key) {
if (have_openssl) {
// if have openssl, add options hash to key
key += crypto.createHash("sha1").
update(options).digest("hex");
}
cache.operate(key,
function(fn) { // getter
callback(undefined, fn);
Expand Down
5 changes: 3 additions & 2 deletions readme.md
Expand Up @@ -576,8 +576,7 @@ you can set `options.cache` parameter to `false`.
nun.render(__dirname + "/file.html", {}, { cache: false }, ...);

If you set different options for one template file, *nun* caching will consider
them as two different templates. This only working if *node.js* compiled with
openssl support. Without openssl support, templates cached only for file name.
them as two different templates.

### Compressing whitespace

Expand All @@ -587,6 +586,8 @@ compile-phase filters, you can compress all whitespace in template by setting

nun.render(__dirname + "/file.html", {}, { compress: true }, ...);

**`node.js` must be compiled with openssl support.**

## How Nun...

### ... use paths?
Expand Down

0 comments on commit d6d9b68

Please sign in to comment.