You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2015/03/13 15:36:54 UTC

cordova-lib git commit: Remove trailing spaces in all js files

Repository: cordova-lib
Updated Branches:
  refs/heads/master ec45040c9 -> 4de450544


Remove trailing spaces in all js files

To avoid unwanted diff lines when using trailing space autoremoval.
Only white space changes, nothing else.
This also adds newlines at the end of files that didn't have them.

Files used in testing fixtures are not affected.

The command used:
sed -i '' 's/[[:space:]]*$//g' **/*.js


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/4de45054
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/4de45054
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/4de45054

Branch: refs/heads/master
Commit: 4de4505448722b56ff74491eeaa42d5c46c885e3
Parents: ec45040
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Fri Mar 13 10:32:27 2015 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Fri Mar 13 10:32:27 2015 -0400

----------------------------------------------------------------------
 cordova-lib/spec-cordova/create.spec.js             |  2 +-
 cordova-lib/spec-plugman/install-browserify.spec.js |  2 +-
 cordova-lib/spec-plugman/platforms/tizen.spec.js    |  2 +-
 cordova-lib/src/configparser/ConfigParser.js        | 12 ++++++------
 cordova-lib/src/cordova/platform.js                 |  2 +-
 cordova-lib/src/cordova/platform_metadata.js        | 12 ++++++------
 cordova-lib/src/cordova/plugin.js                   | 12 ++++++------
 cordova-lib/src/cordova/restore-util.js             |  4 ++--
 cordova-lib/src/hooks/HooksRunner.js                |  2 +-
 cordova-lib/src/plugman/createpackagejson.js        |  4 ++--
 cordova-lib/src/plugman/init-defaults.js            |  8 ++++----
 cordova-lib/src/plugman/platforms/windows.js        |  2 +-
 cordova-lib/src/plugman/registry/registry.js        | 14 +++++++-------
 13 files changed, 39 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/spec-cordova/create.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/create.spec.js b/cordova-lib/spec-cordova/create.spec.js
index 521ec7d..fd35766 100644
--- a/cordova-lib/spec-cordova/create.spec.js
+++ b/cordova-lib/spec-cordova/create.spec.js
@@ -48,7 +48,7 @@ var configSymlink = {
       }
     };
 
-describe('cordova create checks for valid-identifier', function(done) {    
+describe('cordova create checks for valid-identifier', function(done) {
 
     it('should reject reserved words from start of id', function(done) {
         cordova.raw.create('projectPath', 'int.bob', 'appName')

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/spec-plugman/install-browserify.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/install-browserify.spec.js b/cordova-lib/spec-plugman/install-browserify.spec.js
index c6f6869..616e357 100644
--- a/cordova-lib/spec-plugman/install-browserify.spec.js
+++ b/cordova-lib/spec-plugman/install-browserify.spec.js
@@ -117,7 +117,7 @@ describe('start', function() {
                 return Q();
             }
         ).then(
-            function(){ 
+            function(){
                 return install('android', project, plugins['com.cordova.engine'], plugins_install_dir, { browserify: true }); }
         ).then(
             function(){

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/spec-plugman/platforms/tizen.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/platforms/tizen.spec.js b/cordova-lib/spec-plugman/platforms/tizen.spec.js
index 2e01637..69aba24 100644
--- a/cordova-lib/spec-plugman/platforms/tizen.spec.js
+++ b/cordova-lib/spec-plugman/platforms/tizen.spec.js
@@ -21,7 +21,7 @@ var tizen = require('../../src/plugman/platforms/tizen'),
     os = require('osenv'),
     path = require('path'),
     tizen_project = path.join(__dirname, '..', 'projects', 'tizen');
-    
+
     path.join( os.tmpdir(), 'plugman-' + ((function() {
         var index, subIndex,
            set = 'abcdefghijklmnopqrstuvwxyz0123456789',

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/src/configparser/ConfigParser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/configparser/ConfigParser.js b/cordova-lib/src/configparser/ConfigParser.js
index bc1cb9e..ec6d28a 100644
--- a/cordova-lib/src/configparser/ConfigParser.js
+++ b/cordova-lib/src/configparser/ConfigParser.js
@@ -246,7 +246,7 @@ ConfigParser.prototype = {
     getSplashScreens: function(platform) {
         return this.getStaticResources(platform, 'splash');
     },
-    
+
     /**
      * Returns all hook scripts for the hook type specified.
      * @param  {String} hook     The hook type.
@@ -270,9 +270,9 @@ ConfigParser.prototype = {
         return scriptElements.filter(filterScriptByHookType);
     },
    /**
-    * Returns a list of plugin (IDs). 
+    * Returns a list of plugin (IDs).
     *
-    * This function also returns any plugin's that 
+    * This function also returns any plugin's that
     * were defined using the legacy <feature> tags.
     * @return {string[]} Array of plugin IDs
     */
@@ -320,7 +320,7 @@ ConfigParser.prototype = {
     /**
      * Retrives the plugin with the given id or null if not found.
      *
-     * This function also returns any plugin's that 
+     * This function also returns any plugin's that
      * were defined using the legacy <feature> tags.
      * @name getPlugin
      * @function
@@ -359,7 +359,7 @@ ConfigParser.prototype = {
     /**
      * Remove the plugin entry with give name (id).
      *
-     * This function also operates on any plugin's that 
+     * This function also operates on any plugin's that
      * were defined using the legacy <feature> tags.
      * @name removePlugin
      * @function
@@ -442,6 +442,6 @@ function featureToPlugin(featureElement){
             plugin.variables[n] = v;
         }
     });
-    return plugin; 
+    return plugin;
 }
 module.exports = ConfigParser;

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/src/cordova/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platform.js b/cordova-lib/src/cordova/platform.js
index d3de237..ee18458 100644
--- a/cordova-lib/src/cordova/platform.js
+++ b/cordova-lib/src/cordova/platform.js
@@ -216,7 +216,7 @@ function downloadPlatform(projectRoot, platform, version, opts) {
             var branchToCheckout = parts[1];
             return lazy_load.git_clone(git_url, branchToCheckout).fail(function(err) {
                 // If it looks like a url, but cannot be cloned, try handling it differently.
-                // it's because it's a tarball of the form: 
+                // it's because it's a tarball of the form:
                 //     - wp8@https://git-wip-us.apache.org/repos/asf?p=cordova-wp8.git;a=snapshot;h=3.7.0;sf=tgz
                 //     - https://api.github.com/repos/msopenTech/cordova-browser/tarball/my-branch
                 events.emit('verbose', err.message);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/src/cordova/platform_metadata.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platform_metadata.js b/cordova-lib/src/cordova/platform_metadata.js
index 5eef58d..94cea29 100644
--- a/cordova-lib/src/cordova/platform_metadata.js
+++ b/cordova-lib/src/cordova/platform_metadata.js
@@ -54,9 +54,9 @@ function getPlatVersionsFromFile(platformsJsonFile){
     } catch(e) {
         return Q.reject(e);
     }
-    
+
     var platformVersions = [];
-    
+
     platformVersions = Object.keys(platformData).map(function(p){
         return {platform: p, version: platformData[p]};
     });
@@ -71,14 +71,14 @@ function getPlatVersionsFromFileSystem(projectRoot){
         var script = path.join(projectRoot, 'platforms', platform, 'cordova', 'version');
         return Q.ninvoke(child_process, 'exec', script, {}).then(function(result){
             var version = result[0];
-            
+
             // clean the version we get back from the script
             // This is necessary because the version script uses console.log to pass back
-            // the version. Using console.log ends up adding additional line breaks/newlines to the value returned. 
+            // the version. Using console.log ends up adding additional line breaks/newlines to the value returned.
             // ToDO: version scripts should be refactored to not use console.log()
             var versionCleaned = version.replace(/\r?\n|\r/g, '');
             return {platform: platform, version: versionCleaned};
-        });        
+        });
     });
 
     return Q.all(platformVersions);
@@ -104,7 +104,7 @@ function remove(projectRoot, platform){
         return;
     }
     var data = getJson(platformJsonFile);
-    delete data[platform]; 
+    delete data[platform];
     fs.writeFileSync(platformJsonFile, JSON.stringify(data, null, 4), 'utf-8');
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/src/cordova/plugin.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/plugin.js b/cordova-lib/src/cordova/plugin.js
index 08cb09e..46b1928 100644
--- a/cordova-lib/src/cordova/plugin.js
+++ b/cordova-lib/src/cordova/plugin.js
@@ -61,7 +61,7 @@ module.exports = function plugin(command, targets, opts) {
     var hooksRunner = new HooksRunner(projectRoot);
     var config_json = config.read(projectRoot);
     var platformList = cordova_util.listPlatforms(projectRoot);
-    
+
     // Massage plugin name(s) / path(s)
     var pluginPath, plugins;
     pluginPath = path.join(projectRoot, 'plugins');
@@ -137,7 +137,7 @@ module.exports = function plugin(command, targets, opts) {
                         return plugman.raw.fetch(target, pluginsDir, { searchpath: searchPath, noregistry: opts.noregistry, link: opts.link, pluginInfoProvider: pluginInfoProvider});
                     })
                     .then(function(dir){
-                        // save to config.xml 
+                        // save to config.xml
                         if(saveToConfigXmlOn(config_json,opts)){
                             var pluginInfo =  pluginInfoProvider.get(dir);
                             var existingPluginEntry = cfg.getPlugin(pluginInfo.id);
@@ -168,7 +168,7 @@ module.exports = function plugin(command, targets, opts) {
                                         if(opts.cli_variables.hasOwnProperty(varname)){
                                             variables.push({name:varname, value:opts.cli_variables[varname]});
                                         }
-                                    } 
+                                    }
                                 }
                                 cfg.addPlugin(attributes,variables);
                                 cfg.write();
@@ -243,11 +243,11 @@ module.exports = function plugin(command, targets, opts) {
                     if (plugins.indexOf(target) < 0) {
                         // Convert target from package-name to package-id if necessary
                         // Cordova-plugin-device would get changed to org.apache.cordova.device
-                        var pluginId = pluginMapper[target]; 
+                        var pluginId = pluginMapper[target];
                         if(pluginId) {
                             events.emit('log', 'Plugin "' + target + '" is not present in the project. Converting value to "' + pluginId + '" and trying again.');
                             target = pluginId;
-                        }  
+                        }
                         if (plugins.indexOf(target) < 0) {
                             return Q.reject(new CordovaError('Plugin "' + target + '" is not present in the project. See `'+cordova_util.binname+' plugin list`.'));
                         }
@@ -302,7 +302,7 @@ module.exports = function plugin(command, targets, opts) {
 
 function getVersionFromConfigFile(plugin, cfg){
     var pluginEntry = cfg.getPlugin(plugin);
-    return pluginEntry && pluginEntry.version; 
+    return pluginEntry && pluginEntry.version;
 }
 
 function list(projectRoot, hooksRunner) {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/src/cordova/restore-util.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/restore-util.js b/cordova-lib/src/cordova/restore-util.js
index c5f6234..d1a0b7c 100644
--- a/cordova-lib/src/cordova/restore-util.js
+++ b/cordova-lib/src/cordova/restore-util.js
@@ -53,7 +53,7 @@ function installPlatformsFromConfigXML(platforms){
     if(!targets || !targets.length  ){
         return Q.all('No platforms are listed in config.xml to restore');
     }
-    // Run platform add for all the platforms seperately 
+    // Run platform add for all the platforms seperately
     // so that failure on one does not affect the other.
     var promises = targets.map(function(target){
        if(target){
@@ -102,7 +102,7 @@ function installPluginsFromConfigXML(args) {
             installFrom += ('@' + pluginEntry.version);
         }
         // Add feature preferences as CLI variables if have any
-        var options = {cli_variables: pluginEntry.variables, 
+        var options = {cli_variables: pluginEntry.variables,
             searchpath: args.searchpath };
             return plugin('add', installFrom, options);
     });

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/src/hooks/HooksRunner.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/hooks/HooksRunner.js b/cordova-lib/src/hooks/HooksRunner.js
index 0eaa04d..42129d8 100644
--- a/cordova-lib/src/hooks/HooksRunner.js
+++ b/cordova-lib/src/hooks/HooksRunner.js
@@ -111,7 +111,7 @@ function executeEventHandlersSerially(hook, opts) {
  */
 function runScriptsSerially (scripts, context) {
     return scripts.reduce(function(prevScriptPromise, nextScript) {
-        return prevScriptPromise.then(function() { 
+        return prevScriptPromise.then(function() {
             return runScript(nextScript, context);
         });
     }, Q());

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/src/plugman/createpackagejson.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/createpackagejson.js b/cordova-lib/src/plugman/createpackagejson.js
index 0058abd..a265268 100644
--- a/cordova-lib/src/plugman/createpackagejson.js
+++ b/cordova-lib/src/plugman/createpackagejson.js
@@ -27,7 +27,7 @@ var Q = require('q'),
 //returns a promise
 function createPackageJson(plugin_path) {
     var pluginInfo = new PluginInfo(plugin_path);
-   
+
     var defaults = {
         id:pluginInfo.id,
         version:pluginInfo.version,
@@ -49,7 +49,7 @@ function createPackageJson(plugin_path) {
         init(dir, initFile, {}, function (err, data) {
             if(err) throw err;
             events.emit('verbose', 'Package.json successfully created');
-        }); 
+        });
     });
     return Q();
 }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/src/plugman/init-defaults.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/init-defaults.js b/cordova-lib/src/plugman/init-defaults.js
index 493d094..5dbbbfa 100644
--- a/cordova-lib/src/plugman/init-defaults.js
+++ b/cordova-lib/src/plugman/init-defaults.js
@@ -6,9 +6,9 @@
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
- 
+
     http://www.apache.org/licenses/LICENSE-2.0
- 
+
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -30,7 +30,7 @@ var fs = require('fs'),
     defaults = require('./defaults.json');
 
 
-function readDeps (test) { 
+function readDeps (test) {
     return function (cb) {
         fs.readdir('node_modules', function (er, dir) {
             if (er) return cb();
@@ -101,7 +101,7 @@ if (!package.repository) {
                     return cb(null, yes ? defaults.repository : prompt('git repository', defaults.repository));
                 }
                 return cb(null, yes ? '' : prompt('git repository'));
-            } 
+            }
             gconf = gconf.split(/\r?\n/);
             var i = gconf.indexOf('[remote "origin"]');
             var u;

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/src/plugman/platforms/windows.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/windows.js b/cordova-lib/src/plugman/platforms/windows.js
index 7b5b061..7f76e92 100644
--- a/cordova-lib/src/plugman/platforms/windows.js
+++ b/cordova-lib/src/plugman/platforms/windows.js
@@ -151,4 +151,4 @@ module.exports = {
 
 function getTargetConditions(obj) {
     return {versions: obj.versions, target: obj.target, arch: obj.arch};
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4de45054/cordova-lib/src/plugman/registry/registry.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/registry/registry.js b/cordova-lib/src/plugman/registry/registry.js
index ad23ec4..d5ba965 100644
--- a/cordova-lib/src/plugman/registry/registry.js
+++ b/cordova-lib/src/plugman/registry/registry.js
@@ -103,8 +103,8 @@ module.exports = {
                     //we will assume that the rename has already happened.
                     events.emit('verbose', 'package.json1 already exists. Will use');
                 } else {
-                    //rename package.json to pacakge.json1 temporarily 
-                    fs.renameSync(path.join(dir,'package.json'),path.join(dir,'package.json1')); 
+                    //rename package.json to pacakge.json1 temporarily
+                    fs.renameSync(path.join(dir,'package.json'),path.join(dir,'package.json1'));
                 }
             }
             return manifest.generatePackageJsonFromPluginXml(dir)
@@ -121,7 +121,7 @@ module.exports = {
                 //rename package.json1 to package.json if it exists
                 if(fs.existsSync(path.join(dir,'package.json1'))) {
                     events.emit('verbose', 'restoring original package.json');
-                    fs.renameSync(path.join(dir,'package.json1'),path.join(dir,'package.json')); 
+                    fs.renameSync(path.join(dir,'package.json1'),path.join(dir,'package.json'));
                 }
             }).catch(function(err){
                 return err;
@@ -257,9 +257,9 @@ function initSettings(useNpmRegistry) {
         'cache-min': oneDay
     });
 
-    // if npm is true, use npm registry. 
-    // ~/.plugman/config overides the above config if it exists. 
-    // Need to reset the registry value in settings 
+    // if npm is true, use npm registry.
+    // ~/.plugman/config overides the above config if it exists.
+    // Need to reset the registry value in settings
     if(useNpmRegistry) {
         settings.registry = NPM_REG_URL;
     }
@@ -347,7 +347,7 @@ function makeRequest (method, where, what, cb_) {
 
 /**
 * @param {Array} with one element - the plugin id or "id@version"
-* @param useNpmRegistry: {Boolean} - to use the npm registry 
+* @param useNpmRegistry: {Boolean} - to use the npm registry
 * @return {Promise.<string>} Promised path to fetched package.
 */
 function fetchPlugin(plugin, client, useNpmRegistry) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org