cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [5/7] git commit: 0.9.5. [CB-3572] Enable having <info> tags outside of a <platform> tag.
Date Sun, 14 Jul 2013 22:08:58 GMT
0.9.5. [CB-3572] Enable having <info> tags outside of a <platform> tag.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/50b1f528
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/50b1f528
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/50b1f528

Branch: refs/heads/plugman-registry
Commit: 50b1f528287ff56b9e60f73765a745c8f9331c3a
Parents: 5522648
Author: Fil Maj <maj.fil@gmail.com>
Authored: Fri Jul 12 12:36:42 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Fri Jul 12 12:36:42 2013 -0700

----------------------------------------------------------------------
 package.json                         |  2 +-
 spec/install.spec.js                 |  6 ++++++
 spec/plugins/ChildBrowser/plugin.xml |  2 ++
 src/install.js                       | 16 ++++++++++------
 4 files changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/50b1f528/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index dffb36c..36f6ac0 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
   "author": "Andrew Lunny <alunny@gmail.com>",
   "name": "plugman",
   "description": "install/uninstall Cordova plugins",
-  "version": "0.9.4",
+  "version": "0.9.5",
   "repository": {
     "type": "git",
     "url": "git://git-wip-us.apache.org/repos/asf/cordova-plugman.git"

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/50b1f528/spec/install.spec.js
----------------------------------------------------------------------
diff --git a/spec/install.spec.js b/spec/install.spec.js
index 770b0f9..044266d 100644
--- a/spec/install.spec.js
+++ b/spec/install.spec.js
@@ -13,6 +13,7 @@ var install = require('../src/install'),
     dummy_id = 'com.phonegap.plugins.dummyplugin',
     variableplugin = 'VariablePlugin',
     engineplugin = 'EnginePlugin',
+    childplugin = 'ChildBrowser',
     plugins_dir = path.join(temp, 'plugins');
 
 describe('install', function() {
@@ -72,6 +73,11 @@ describe('install', function() {
             expect(c_a).toHaveBeenCalledWith(jasmine.any(Function), [jasmine.any(Object),
path.join(plugins_dir, dummyplugin), temp, dummy_id], jasmine.any(Function), [jasmine.any(Object),
temp, dummy_id]);
             expect(proc).toHaveBeenCalled();
         });
+        it('should emit a results event with platform-agnostic <info>', function()
{
+            var emit = spyOn(plugman, 'emit');
+            install('android', temp, childplugin, plugins_dir, {});
+            expect(emit).toHaveBeenCalledWith('results', 'No matter what platform you are
installing to, this notice is very important.');
+        });
 
         describe('with dependencies', function() {
             it('should process all dependent plugins', function() {

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/50b1f528/spec/plugins/ChildBrowser/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/plugins/ChildBrowser/plugin.xml b/spec/plugins/ChildBrowser/plugin.xml
index 7c29476..218a838 100644
--- a/spec/plugins/ChildBrowser/plugin.xml
+++ b/spec/plugins/ChildBrowser/plugin.xml
@@ -36,6 +36,8 @@
         <access origin="build.phonegap.com" />
         <access origin="s3.amazonaws.com" />
     </config-file>
+    
+    <info>No matter what platform you are installing to, this notice is very important.</info>
 
     <!-- android -->
     <platform name="android">

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/50b1f528/src/install.js
----------------------------------------------------------------------
diff --git a/src/install.js b/src/install.js
index 9523f83..7aa0c0b 100644
--- a/src/install.js
+++ b/src/install.js
@@ -280,12 +280,6 @@ function handleInstall(actions, plugin_id, plugin_et, platform, project_dir,
plu
             if (callback) callback(err);
             else throw err;
         } else {
-            // WIN!
-            // Log out plugin INFO element contents in case additional install steps are
necessary
-            var info = (platformTag ? platformTag.findall('./info') : '');
-            if(info.length) {
-                console.log(info[0].text);
-            }
 
             // queue up the plugin so prepare knows what to do.
             config_changes.add_installed_plugin_to_prepare_queue(plugins_dir, plugin_basename,
platform, filtered_variables, is_top_level);
@@ -293,6 +287,16 @@ function handleInstall(actions, plugin_id, plugin_et, platform, project_dir,
plu
             require('./../plugman').prepare(project_dir, platform, plugins_dir);
 
             require('../plugman').emit('results', plugin_id + ' installed.');
+            // WIN!
+            // Log out plugin INFO element contents in case additional install steps are
necessary
+            var info = plugin_et.findall('./info');
+            if(info.length) {
+                require('../plugman').emit('results', info[0].text);
+            }
+            info = (platformTag ? platformTag.findall('./info') : []);
+            if(info.length) {
+                require('../plugman').emit('results', info[0].text);
+            }
             if (callback) callback();
         }
     });


Mime
View raw message