Skip to content

Commit

Permalink
changed behavior of --globals so it can reference any arbitrary library
Browse files Browse the repository at this point in the history
  • Loading branch information
dtao committed Dec 30, 2013
1 parent b519eaf commit 0078298
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions example/usesUnderscore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @private
* @examples
* [1, 2, 'foo'].numbers(); // => [1, 2]
*/
Array.prototype.numbers = function() {
return _.filter(this, function(x) { return typeof x === 'number'; });
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"coffee-script": ">= 1.6.1",
"mocha": ">= 1.13.0",
"sinon": ">= 1.7.3",
"should": ">= 2.0.2"
"should": ">= 2.0.2",
"underscore": ">= 1.5.2"
}
}
2 changes: 1 addition & 1 deletion resources/examples.js.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#globals}}
global['{{{variable}}}'] = require(path.join(process.cwd(), './{{library}}'));
global['{{{variable}}}'] = require('{{library}}');
{{/globals}}

global['{{{variable}}}'] = require('{{{filePath}}}');
Expand Down

0 comments on commit 0078298

Please sign in to comment.