Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
Added more convenience imports and fixed the require() caching proble…
Browse files Browse the repository at this point in the history
…m again (revert).
  • Loading branch information
skibblenybbles committed Sep 8, 2014
1 parent 0e7f400 commit 92f27a8
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

module.exports = require('./settings').load().api;
module.exports = require('./formidable').api;
2 changes: 1 addition & 1 deletion context.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

module.exports = require('./settings').load().context;
module.exports = require('./formidable').context;
2 changes: 1 addition & 1 deletion log.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

module.exports = require('./settings').load().log;
module.exports = require('./formidable').log;
3 changes: 3 additions & 0 deletions option.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = require('formidable').option;
3 changes: 3 additions & 0 deletions path.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = require('./formidable').path;
13 changes: 12 additions & 1 deletion settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,22 @@ var //---------------
reset = function() {
var cached = cache[defaultPath] && cache[defaultPath].path;

delete require.cache[path.join(__dirname, 'formidable.js')];
if (cached) {
cached.js.clear();
cached.template.clear();
}
each([
'api',
'context',
'log',
'formidable',
'option',
'path',
'template',
'urls'
], function(name) {
delete require.cache[path.join(__dirname, name + '.js')];
});
},

// Configure the default settings module file path.
Expand Down
2 changes: 1 addition & 1 deletion template.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

module.exports = require('./settings').load().template;
module.exports = require('./formidable').template;
2 changes: 1 addition & 1 deletion urls.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

module.exports = require('./settings').load().urls;
module.exports = require('./formidable').urls;

0 comments on commit 92f27a8

Please sign in to comment.