cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject git commit: Fix for #68, proper support for blackberry-10 whitelist. Bumped npm version.
Date Tue, 20 Nov 2012 20:09:32 GMT
Updated Branches:
  refs/heads/cordova-client 41816a6d4 -> 2064e8066


Fix for #68, proper support for blackberry-10 whitelist. Bumped npm version.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/commit/2064e806
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/tree/2064e806
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/diff/2064e806

Branch: refs/heads/cordova-client
Commit: 2064e806674e3faa6bee996078badf36783766c6
Parents: 41816a6
Author: Fil Maj <maj.fil@gmail.com>
Authored: Tue Nov 20 12:09:27 2012 -0800
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Tue Nov 20 12:09:27 2012 -0800

----------------------------------------------------------------------
 package.json                            |    2 +-
 spec/metadata/blackberry_parser.spec.js |   10 ++++++----
 src/metadata/blackberry_parser.js       |   12 ++++++++++--
 3 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/2064e806/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index eea63b4..4577f10 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova",
-  "version": "0.1.10",
+  "version": "0.1.11",
   "preferGlobal": "true",
   "description": "Cordova client tool",
   "main": "cordova",

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/2064e806/spec/metadata/blackberry_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/blackberry_parser.spec.js b/spec/metadata/blackberry_parser.spec.js
index bfd7bc8..4dc7a57 100644
--- a/spec/metadata/blackberry_parser.spec.js
+++ b/spec/metadata/blackberry_parser.spec.js
@@ -1,6 +1,7 @@
 var blackberry_parser = require('../../src/metadata/blackberry_parser'),
     config_parser = require('../../src/config_parser'),
     path = require('path'),
+    et = require('elementtree'),
     shell = require('shelljs'),
     cordova = require('../../cordova'),
     fs = require('fs'),
@@ -66,10 +67,11 @@ describe('blackberry project parser', function() {
             config.access.add('http://rim.com');
             project.update_from_config(config);
 
-            var bb_cfg = new config_parser(blackberry_config);
-            expect(bb_cfg.access.get().length).toEqual(2);
-            expect(bb_cfg.access.get()[0]).toEqual('http://blackberry.com');
-            expect(bb_cfg.access.get()[1]).toEqual('http://rim.com');
+            var bb_cfg = new et.ElementTree(et.XML(fs.readFileSync(blackberry_config, 'utf-8')));
+            var as = bb_cfg.getroot().findall('access');
+            expect(as.length).toEqual(2);
+            expect(as[0].attrib.uri).toEqual('http://blackberry.com');
+            expect(as[1].attrib.uri).toEqual('http://rim.com');
         });
     });
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/2064e806/src/metadata/blackberry_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/blackberry_parser.js b/src/metadata/blackberry_parser.js
index cfc3262..d2750e1 100644
--- a/src/metadata/blackberry_parser.js
+++ b/src/metadata/blackberry_parser.js
@@ -11,7 +11,8 @@ module.exports = function blackberry_parser(project) {
         throw 'The provided path is not a Cordova BlackBerry WebWorks project.';
     }
     this.path = project;
-    this.xml = new config_parser(path.join(this.path, 'www', 'config.xml'));
+    this.config_path = path.join(this.path, 'www', 'config.xml');
+    this.xml = new config_parser(this.config_path);
 };
 
 module.exports.prototype = {
@@ -23,9 +24,16 @@ module.exports.prototype = {
         this.xml.packageName(config.packageName());
         this.xml.access.remove();
         var self = this;
+        this.xml.doc.findall('access').forEach(function(a) {
+            self.xml.doc.getroot().remove(0, a);
+        });
         config.access.get().forEach(function(uri) {
-            self.xml.access.add(uri);
+            var el = new et.Element('access');
+            el.attrib.uri = uri;
+            el.attrib.subdomains = 'true';
+            self.xml.doc.getroot().append(el);
         });
+        this.xml.update();
     },
     update_project:function(cfg, callback) {
         this.update_from_config(cfg);


Mime
View raw message