cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [20/50] [abbrv] git commit: refactor should be done.
Date Tue, 23 Apr 2013 23:00:48 GMT
refactor should be done.


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

Branch: refs/heads/master
Commit: 7f9eca069420582441a6c936d045f2ba0334f627
Parents: 5f4bb9d
Author: Fil Maj <maj.fil@gmail.com>
Authored: Fri Apr 19 15:06:14 2013 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Fri Apr 19 15:06:14 2013 -0700

----------------------------------------------------------------------
 src/platforms/blackberry.js |   23 ++++++++++++++++++-----
 src/platforms/ios.js        |   23 +++++++++++++++++++----
 src/uninstall.js            |    1 +
 3 files changed, 38 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/7f9eca06/src/platforms/blackberry.js
----------------------------------------------------------------------
diff --git a/src/platforms/blackberry.js b/src/platforms/blackberry.js
index 03652b5..0dff562 100644
--- a/src/platforms/blackberry.js
+++ b/src/platforms/blackberry.js
@@ -25,8 +25,25 @@ var fs = require('fs')  // use existsSync in 0.6.x
    , sourceDir = 'src'
    , xml_helpers = require(path.join(__dirname, '..', 'util', 'xml-helpers'));
 
+module.exports = {
+    handleInstall:function(project_dir, plugin_dir, plugin_et, variables) {
+        handlePlugin('install', project_dir, plugin_dir, plugin_et, variables);
+    },
+    handleUninstall:function(project_dir, plugin_dir, plugin_et, variables) {
+        handlePlugin('uninstall', project_dir, plugin_dir, plugin_et, variables);
+    },
+    forceInstall:function(project_dir, plugin_dir, plugin_et, variables) {
+        handlePlugin('force-install', project_dir, plugin_dir, plugin_et, variables);
+    },
+    forceUninstall:function(project_dir, plugin_dir, plugin_et, variables) {
+        handlePlugin('force-uninstall', project_dir, plugin_dir, plugin_et, variables);
+    },
+    www_dir:function(project_dir) {
+        return path.join(project_dir, 'www');
+    }
+};
 
-exports.handlePlugin = function (action, project_dir, plugin_dir, plugin_et) {
+function handlePlugin = (action, project_dir, plugin_dir, plugin_et, variables) {
     var plugin_id = plugin_et._root.attrib['id']
       , version = plugin_et._root.attrib['version']
       , external_hosts = []
@@ -166,7 +183,3 @@ function pluginInstalled(plugin_et, project_dir) {
            .match(new RegExp(plugin_name, "g")) != null);
 }
 
-exports.www_dir = function(project_dir) {
-    return path.join(project_dir, 'www');
-};
-

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/7f9eca06/src/platforms/ios.js
----------------------------------------------------------------------
diff --git a/src/platforms/ios.js b/src/platforms/ios.js
index dda2110..d0fa2a2 100644
--- a/src/platforms/ios.js
+++ b/src/platforms/ios.js
@@ -28,8 +28,26 @@ var path = require('path')
   , xml_helpers = require(path.join(__dirname, '..', 'util', 'xml-helpers'))
   , searchAndReplace = require(path.join(__dirname, '..', 'util', 'search-and-replace'))
   , getConfigChanges = require(path.join(__dirname, '..', 'util', 'config-changes'));
+
+module.exports = {
+    handleInstall:function(project_dir, plugin_dir, plugin_et, variables) {
+        handlePlugin('install', project_dir, plugin_dir, plugin_et, variables);
+    },
+    handleUninstall:function(project_dir, plugin_dir, plugin_et, variables) {
+        handlePlugin('uninstall', project_dir, plugin_dir, plugin_et, variables);
+    },
+    forceInstall:function(project_dir, plugin_dir, plugin_et, variables) {
+        handlePlugin('force-install', project_dir, plugin_dir, plugin_et, variables);
+    },
+    forceUninstall:function(project_dir, plugin_dir, plugin_et, variables) {
+        handlePlugin('force-uninstall', project_dir, plugin_dir, plugin_et, variables);
+    },
+    www_dir:function(project_dir) {
+        return path.join(project_dir, 'www');
+    }
+};
   
-exports.handlePlugin = function (action, project_dir, plugin_dir, plugin_et, variables) {
+function handlePlugin (action, project_dir, plugin_dir, plugin_et, variables) {
     var plugin_id = plugin_et._root.attrib['id']
       , version = plugin_et._root.attrib['version']
       , i = 0
@@ -364,7 +382,4 @@ function checkLastCommand() {
     if(shell.error() != null) throw {name: "ShellError", message: shell.error()};
 }
 
-exports.www_dir = function(project_dir) {
-    return path.join(project_dir, 'www');
-};
 

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/7f9eca06/src/uninstall.js
----------------------------------------------------------------------
diff --git a/src/uninstall.js b/src/uninstall.js
index b51487c..5befe83 100644
--- a/src/uninstall.js
+++ b/src/uninstall.js
@@ -1,5 +1,6 @@
 var path = require('path'),
     fs   = require('fs'),
+    et   = require('elementtree'),
     platform_modules = require('./platforms');
 
 function runUninstall(platform, project_dir, plugin_dir, plugins_dir, cli_variables, callback)
{


Mime
View raw message