Permalink
Browse files

Added missing files.

  • Loading branch information...
1 parent 8c74542 commit 2d7bbc8c18142f26b6e23bdf44f862de78646731 @chrisjpowers committed Jun 1, 2012
Showing with 400 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +2 −3 lib/air-drop.js
  3. +18 −0 lib/browser-require-hack.js
  4. +379 −0 lib/router.js
View
@@ -0,0 +1 @@
+node_modules
View
@@ -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);
};
@@ -31,8 +31,6 @@ var AirDrop = function(name) {
return package;
};
-module.exports = AirDrop;
-
AirDrop.Minimizers = Minimizers;
AirDrop.Cachers = Cachers;
AirDrop.Compilers = Compilers;
@@ -41,6 +39,7 @@ AirDrop.Path = Path;
var packageMethods = {
at: function(url) {
this.url = url;
+ return this;
},
require: function(path, options) {
@@ -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);
Oops, something went wrong.

0 comments on commit 2d7bbc8

Please sign in to comment.