Skip to content

Commit

Permalink
Include module wrap.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansglazunov committed Jan 31, 2015
1 parent 77b94f5 commit fccb539
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
var _ = require('lodash');
var async = require('async');
var fs = require('fs');
var vm = require('vm');

var _stringRequire = exports._stringRequire = function(file, path) {
var m = new module.constructor();
m._compile(file, path);
vm.runInThisContext(require('module').wrap(file))(m.exports, m.require, m, path, require('path').dirname(path));
return m.exports;
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "osws-templates",
"version": "0.2.5",
"version": "0.2.6",
"description": "Tools for generating, extending and rendering HTML.",
"keywords": [],
"author": "Open Source Web Standards <[email protected]> (http://osws.github.io/OSWS)",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# [OSWS](https://github.com/OSWS) [Templates](https://github.com/OSWS/OSWS-Templates) [0.2.5](https://github.com/OSWS/OSWS-Templates/wiki/0.2.5)
# [OSWS](https://github.com/OSWS) [Templates](https://github.com/OSWS/OSWS-Templates) [0.2.6](https://github.com/OSWS/OSWS-Templates/wiki/0.2.6)

[documentation](https://github.com/OSWS/OSWS-Templates/wiki)
3 changes: 2 additions & 1 deletion sources/commonjs-open.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
var _ = require('lodash');
var async = require('async');
var fs = require('fs');
var vm = require('vm');

var _stringRequire = exports._stringRequire = function(file, path) {
var m = new module.constructor();
m._compile(file, path);
vm.runInThisContext(require('module').wrap(file))(m.exports, m.require, m, path, require('path').dirname(path));
return m.exports;
};

Expand Down
1 change: 0 additions & 1 deletion tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var Templates = require('../index.js');
var _ = require('lodash');
var assert = require('chai').assert;
var fs = require('fs');

var asSync = Templates.asSync;
var asAsync = Templates.asAsync;
var Prototype = Templates.Prototype;
Expand Down

0 comments on commit fccb539

Please sign in to comment.