Skip to content

Commit

Permalink
Added missing files.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjpowers committed Jun 1, 2012
1 parent 8c74542 commit 2d7bbc8
Show file tree
Hide file tree
Showing 4 changed files with 400 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
5 changes: 2 additions & 3 deletions lib/air-drop.js
Expand Up @@ -9,7 +9,7 @@ var fs = require("fs"),
Path = require("./path"),
Compilers = require("./compilers");

var AirDrop = function(name) {
var AirDrop = module.exports = function(name) {
var package = function(req, res, next) {
return package.router(req, res, next);
};
Expand All @@ -31,8 +31,6 @@ var AirDrop = function(name) {
return package;
};

module.exports = AirDrop;

AirDrop.Minimizers = Minimizers;
AirDrop.Cachers = Cachers;
AirDrop.Compilers = Compilers;
Expand All @@ -41,6 +39,7 @@ AirDrop.Path = Path;
var packageMethods = {
at: function(url) {
this.url = url;
return this;
},

require: function(path, options) {
Expand Down
18 changes: 18 additions & 0 deletions lib/browser-require-hack.js
@@ -0,0 +1,18 @@
function hackRequire(origRequire) {
newRequire = function(path) {
try { return origRequire(path); }
catch(e) {
return retryRequire(path, e);
}
};

newRequire.define = origRequire.define;

return newRequire;

function retryRequire(path, origError) {
return origRequire(path.replace(/^\.\//, ""));
}
}

require = hackRequire(require);

0 comments on commit 2d7bbc8

Please sign in to comment.