Skip to content

Commit

Permalink
change behavior of config.js, replace uncache and add Interface to in…
Browse files Browse the repository at this point in the history
…ternals

Config.js now do not remove the loadurl and other methods anymore, as we now may reconfigure while a running instance.

The uncache was replaced to only unload api.js and specific modules, which change their behavior after they have been first loaded
  • Loading branch information
wzrdtales committed Jun 17, 2015
1 parent 2eac000 commit a089d50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ searchCache = function (moduleName, callback) {

module.exports.getInstance = function(isModule, options, callback) {

uncache('./api.js');
delete require.cache[require.resolve('./api.js')];
delete require.cache[require.resolve('optimist')];
var mod = require( './api.js' );
return new mod(isModule, options, callback);
};
8 changes: 4 additions & 4 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ exports.load = function(fileName, currentEnv) {
setCurrent(['dev', 'development']);
}

delete exports.load;
delete exports.loadUrl;
// delete exports.load;
// delete exports.loadUrl;
};

exports.loadUrl = function(databaseUrl, currentEnv) {
Expand All @@ -63,8 +63,8 @@ exports.loadUrl = function(databaseUrl, currentEnv) {
setCurrent('urlConfig');
}

delete exports.load;
delete exports.loadUrl;
// delete exports.load;
// delete exports.loadUrl;
}

var setCurrent = exports.setCurrent = function (env) {
Expand Down
2 changes: 1 addition & 1 deletion lib/driver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports.connect = function (config, intern, callback) {
internals.mod = mod;
internals.interfaces = {

SeederInterface: SeederInterface;
SeederInterface: SeederInterface
};

if ( !config.user && config.username )
Expand Down

0 comments on commit a089d50

Please sign in to comment.