Comparing version 0.9.5 to 0.9.6
@@ -5,3 +5,3 @@ { | ||
"description": "install/uninstall Cordova plugins", | ||
"version": "0.9.5", | ||
"version": "0.9.6", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -81,2 +81,12 @@ var install = require('../src/install'), | ||
}); | ||
it('should emit a results event with platform-specific <info>', function() { | ||
var emit = spyOn(plugman, 'emit'); | ||
install('android', temp, childplugin, plugins_dir, {}); | ||
expect(emit).toHaveBeenCalledWith('results', 'Please make sure you read this because it is very important to complete the installation of your plugin.'); | ||
}); | ||
it('should interpolate variables into <info> tags', function() { | ||
var emit = spyOn(plugman, 'emit'); | ||
install('android', temp, variableplugin, plugins_dir, {cli_variables:{API_KEY:'batman'}}); | ||
expect(emit).toHaveBeenCalledWith('results', 'Remember that your api key is batman!'); | ||
}); | ||
@@ -83,0 +93,0 @@ describe('with dependencies', function() { |
@@ -294,7 +294,7 @@ var path = require('path'), | ||
if(info.length) { | ||
require('../plugman').emit('results', info[0].text); | ||
require('../plugman').emit('results', interp_vars(filtered_variables, info[0].text)); | ||
} | ||
info = (platformTag ? platformTag.findall('./info') : []); | ||
if(info.length) { | ||
require('../plugman').emit('results', info[0].text); | ||
require('../plugman').emit('results', interp_vars(filtered_variables, info[0].text)); | ||
} | ||
@@ -305,1 +305,9 @@ if (callback) callback(); | ||
} | ||
function interp_vars(vars, text) { | ||
vars && Object.keys(vars).forEach(function(key) { | ||
var regExp = new RegExp("\\$" + key, "g"); | ||
text = text.replace(regExp, vars[key]); | ||
}); | ||
return text; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2692270
10536