[GitHub] cordova-android pull request: CB-9119 Fixing intermittent 'adb ins...

2015-06-09 Thread dblotsky
Github user dblotsky commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/180#discussion_r32090950
  
--- Diff: bin/templates/cordova/lib/exec.js ---
@@ -19,16 +19,42 @@
under the License.
 */
 
-var child_process = require('child_process'),
-Q   = require('q');
+var child_process = require('child_process');
+var Q = require('q');
+
+// constants
+var DEFAULT_MAX_BUFFER = 1024000;
 
 // Takes a command and optional current working directory.
 // Returns a promise that either resolves with the stdout, or
 // rejects with an error message and the stderr.
-module.exports = function(cmd, opt_cwd) {
+//
+// WARNING:
+// opt_cwd is an artifact of an old design, and must
+// be removed in the future; the correct solution is
+// to pass the options object the same way that
+// child_process.exec expects
+//
+// NOTE:
+//  exec documented here - 
https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
+module.exports = function(cmd, opt_cwd, options) {
+
 var d = Q.defer();
+
+if (options === undefined) {
+options = {};
+}
+
+// override cwd to preserve old opt_cwd behavior
+options.cwd = opt_cwd;
+
+// set maxBuffer
+if (options.maxBuffer === undefined) {
--- End diff --

Now using `typeof options.maxBuffer === "undefined"` instead.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-android pull request: CB-9119 Fixing intermittent 'adb ins...

2015-06-09 Thread dblotsky
Github user dblotsky commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/180#discussion_r32090933
  
--- Diff: bin/templates/cordova/lib/retry.js ---
@@ -0,0 +1,63 @@
+#!/usr/bin/env node
+
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+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
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+/* jshint node: true */
+
+"use strict";
+
+/*
+ * Retry a promise-returning function attemts_left times, propagating its
+ * results on success or throwing its error on a failed final attempt.
+ *
+ * Takes a number of attempts, a promise-returning function, and all its
+ * arguments (as trailing arguments).
+ */
+module.exports.retryPromise = function (attemts_left, promiseFunction) {
+
+// NOTE:
+//  get all trailing arguments, by skipping the first two 
(attemts_left and
+//  promiseFunction) because they shouldn't get passed to 
promiseFunction
+var promiseFunctionArguments = Array.prototype.slice.call(arguments, 
2);
+
+return promiseFunction.apply(undefined, promiseFunctionArguments).then(
+
+// on success pass results through
+function onFulfilled(value) {
+return value;
+},
+
+// on rejection either retry, or throw the error
+function onRejected(error) {
+
+attemts_left -= 1;
+
+if (attemts_left < 1) {
+throw error;
+}
+
+console.log("call failed; retrying " + attemts_left + " more 
time(s)");
--- End diff --

Added capitals and periods.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-android pull request: CB-9119 Fixing intermittent 'adb ins...

2015-06-09 Thread dblotsky
Github user dblotsky commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/180#discussion_r32090785
  
--- Diff: bin/templates/cordova/lib/emulator.js ---
@@ -298,37 +306,67 @@ module.exports.resolveTarget = function(target) {
  * If no started emulators are found, error out.
  * Returns a promise.
  */
-module.exports.install = function(target, buildResults) {
-return Q().then(function() {
-if (target && typeof target == 'object') {
-return target;
+module.exports.install = function(givenTarget, buildResults) {
+
+var target;
+
+// resolve the target emulator
+return Q().then(function () {
+if (givenTarget && typeof givenTarget == 'object') {
+return givenTarget;
+} else {
+return module.exports.resolveTarget(givenTarget);
 }
-return module.exports.resolveTarget(target);
-}).then(function(resolvedTarget) {
-var apk_path = build.findBestApkForArchitecture(buildResults, 
resolvedTarget.arch);
+
+// set the resolved target
+}).then(function (resolvedTarget) {
+target = resolvedTarget;
+
+// install the app
+}).then(function () {
+
+var apk_path= build.findBestApkForArchitecture(buildResults, 
target.arch);
+var execOptions = {
+timeout:INSTALL_COMMAND_TIMEOUT, // in milliseconds
+killSignal: EXEC_KILL_SIGNAL
+};
+
 console.log('Installing app on emulator...');
 console.log('Using apk: ' + apk_path);
-return exec('adb -s ' + resolvedTarget.target + ' install -r -d "' 
+ apk_path + '"', os.tmpdir())
-.then(function(output) {
+
+var retriedInstall = retry.retryPromise(
+NUM_INSTALL_RETRIES,
+exec, 'adb -s ' + target.target + ' install -r -d "' + 
apk_path + '"', os.tmpdir(), execOptions
+);
+
+return retriedInstall.then(function (output) {
 if (output.match(/Failure/)) {
 return Q.reject('Failed to install apk to emulator: ' + 
output);
+} else {
+console.log('INSTALL SUCCESS');
 }
-return Q();
-}, function(err) {
+}, function (err) {
 return Q.reject('Failed to install apk to emulator: ' + err);
-}).then(function() {
-//unlock screen
-return exec('adb -s ' + resolvedTarget.target + ' shell input 
keyevent 82', os.tmpdir());
-}).then(function() {
-// launch the application
-console.log('Launching application...');
-var launchName = appinfo.getActivityName();
-var cmd = 'adb -s ' + resolvedTarget.target + ' shell am start 
-W -a android.intent.action.MAIN -n ' + launchName;
-return exec(cmd, os.tmpdir());
-}).then(function(output) {
-console.log('LAUNCH SUCCESS');
-}, function(err) {
-return Q.reject('Failed to launch app on emulator: ' + err);
 });
+
+// unlock screen
+}).then(function () {
+
+console.log('Unlocking screen...');
+return exec('adb -s ' + target.target + ' shell input keyevent 
82', os.tmpdir());
+
+// launch the application
--- End diff --

Don't Repeat Yourself applies to repeated code or logic, not to comments. 
This comment improves readability because you can clearly see what every `then` 
block does by looking only at the comment above it, and it is therefore useful.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8052: [webOS] Update cordova-lib for ...

2015-06-09 Thread JayCanuck
Github user JayCanuck commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/239#discussion_r32090271
  
--- Diff: cordova-lib/src/plugman/platforms/webos.js ---
@@ -0,0 +1,99 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+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
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+/* jshint node:true, bitwise:true, undef:true, trailing:true, 
quotmark:true,
+  indent:4, unused:vars, latedef:nofunc,
+  laxcomma:true, sub:true
+*/
+
+var path = require('path')
+, fs = require('fs')
+, common = require('./common')
+, events = require('../../events')
+, xml_helpers = require(path.join(__dirname, '..', '..', 'util', 
'xml-helpers'))
+;
+
+module.exports = {
+www_dir: function(project_dir) {
+return path.join(project_dir, 'www');
+},
+package_name:function(project_dir) {
+// preferred location if cordova >= 3.4
+var preferred_path = path.join(project_dir, 'config.xml');
+var config_path;
+
+if (!fs.existsSync(preferred_path)) {
+// older location
+var old_config_path = 
path.join(module.exports.www_dir(project_dir), 'config.xml');
+if (!fs.existsSync(old_config_path)) {
+// output newer location and fail reading
+config_path = preferred_path;
+events.emit('verbose', 'unable to find '+config_path);
+} else {
+config_path = old_config_path;
+}
+} else {
+config_path = preferred_path;
+}
+var widget_doc = xml_helpers.parseElementtreeSync(config_path);
+return widget_doc._root.attrib['id'];
+},
+'source-file':{
+install:function(obj, plugin_dir, project_dir, plugin_id, options) 
{
+var dest = path.join(obj.targetDir, path.basename(obj.src));
+common.copyFile(plugin_dir, obj.src, project_dir, dest);
--- End diff --

Looks like browser platform uses it as well. Is there some advantage to 
copyNewFile that I'm missing that would make the change worth it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8052: [webOS] Update cordova-lib for ...

2015-06-09 Thread JayCanuck
Github user JayCanuck commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/239#discussion_r32090088
  
--- Diff: cordova-lib/src/plugman/platforms/webos.js ---
@@ -0,0 +1,99 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+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
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+/* jshint node:true, bitwise:true, undef:true, trailing:true, 
quotmark:true,
+  indent:4, unused:vars, latedef:nofunc,
+  laxcomma:true, sub:true
+*/
+
+var path = require('path')
+, fs = require('fs')
+, common = require('./common')
+, events = require('../../events')
+, xml_helpers = require(path.join(__dirname, '..', '..', 'util', 
'xml-helpers'))
+;
+
+module.exports = {
+www_dir: function(project_dir) {
+return path.join(project_dir, 'www');
+},
+package_name:function(project_dir) {
+// preferred location if cordova >= 3.4
+var preferred_path = path.join(project_dir, 'config.xml');
+var config_path;
+
+if (!fs.existsSync(preferred_path)) {
+// older location
+var old_config_path = 
path.join(module.exports.www_dir(project_dir), 'config.xml');
+if (!fs.existsSync(old_config_path)) {
+// output newer location and fail reading
+config_path = preferred_path;
+events.emit('verbose', 'unable to find '+config_path);
+} else {
+config_path = old_config_path;
+}
+} else {
+config_path = preferred_path;
+}
+var widget_doc = xml_helpers.parseElementtreeSync(config_path);
+return widget_doc._root.attrib['id'];
+},
+'source-file':{
+install:function(obj, plugin_dir, project_dir, plugin_id, options) 
{
+var dest = path.join(obj.targetDir, path.basename(obj.src));
+common.copyFile(plugin_dir, obj.src, project_dir, dest);
--- End diff --

I modeled it after firefoxos's extry, given the similar OS nature and they 
had the copyFile entry. If copyNewFile is the current stand, I can update it to 
that tomorrow morning no problem


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-8052: [webOS] Update cordova-lib for ...

2015-06-09 Thread omefire
Github user omefire commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/239#discussion_r32089841
  
--- Diff: cordova-lib/src/plugman/platforms/webos.js ---
@@ -0,0 +1,99 @@
+/**
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+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
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+/* jshint node:true, bitwise:true, undef:true, trailing:true, 
quotmark:true,
+  indent:4, unused:vars, latedef:nofunc,
+  laxcomma:true, sub:true
+*/
+
+var path = require('path')
+, fs = require('fs')
+, common = require('./common')
+, events = require('../../events')
+, xml_helpers = require(path.join(__dirname, '..', '..', 'util', 
'xml-helpers'))
+;
+
+module.exports = {
+www_dir: function(project_dir) {
+return path.join(project_dir, 'www');
+},
+package_name:function(project_dir) {
+// preferred location if cordova >= 3.4
+var preferred_path = path.join(project_dir, 'config.xml');
+var config_path;
+
+if (!fs.existsSync(preferred_path)) {
+// older location
+var old_config_path = 
path.join(module.exports.www_dir(project_dir), 'config.xml');
+if (!fs.existsSync(old_config_path)) {
+// output newer location and fail reading
+config_path = preferred_path;
+events.emit('verbose', 'unable to find '+config_path);
+} else {
+config_path = old_config_path;
+}
+} else {
+config_path = preferred_path;
+}
+var widget_doc = xml_helpers.parseElementtreeSync(config_path);
+return widget_doc._root.attrib['id'];
+},
+'source-file':{
+install:function(obj, plugin_dir, project_dir, plugin_id, options) 
{
+var dest = path.join(obj.targetDir, path.basename(obj.src));
+common.copyFile(plugin_dir, obj.src, project_dir, dest);
--- End diff --

Every other platform uses 'copyNewFile' to install 'source-file'. Maybe we 
should do the same here ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9147 Adding a platform via caret vers...

2015-06-09 Thread omefire
Github user omefire commented on the pull request:

https://github.com/apache/cordova-lib/pull/244#issuecomment-110598306
  
How much work would it be to make use of 'getLatestMatchingNpmVersion' ? 
that way we don't have to maintain two separate ways of doing the same thing 
(platforms vs plugins).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9147 Adding a platform via caret vers...

2015-06-09 Thread omefire
Github user omefire commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/244#discussion_r32089761
  
--- Diff: cordova-lib/src/plugman/registry/registry.js ---
@@ -364,6 +364,26 @@ function fetchPlugin(plugin, client, useNpmRegistry) {
 });
 }
 
+function processPluginVersion(plugin) {
--- End diff --

How much work would it be to make use of 'getLatestMatchingNpmVersion' ? 
that way we don't have to maintain two separate ways of doing the same thing 
(platforms vs plugins).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9147 Adding a platform via caret vers...

2015-06-09 Thread omefire
Github user omefire commented on the pull request:

https://github.com/apache/cordova-lib/pull/244#issuecomment-110597230
  
Hey Tim, would "~" work fine in these scenarios ? does the semver version 
currently used by npm correctly handle "~" ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9147 Adding a platform via caret vers...

2015-06-09 Thread omefire
Github user omefire commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/244#discussion_r32089468
  
--- Diff: cordova-lib/src/plugman/registry/registry.js ---
@@ -364,6 +364,26 @@ function fetchPlugin(plugin, client, useNpmRegistry) {
 });
 }
 
+function processPluginVersion(plugin) {
+// If plugin includes a version that is a caret range, the ancient 
version of npm we're using won't now how to
--- End diff --

:nit 'now' -> 'know'


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9147 Adding a platform via caret vers...

2015-06-09 Thread omefire
Github user omefire commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/244#discussion_r32088895
  
--- Diff: cordova-lib/src/cordova/plugin.js ---
@@ -360,6 +360,12 @@ function getPluginVariables(variables){
 
 function getVersionFromConfigFile(plugin, cfg){
 var pluginEntry = cfg.getPlugin(plugin);
+if (!pluginEntry) {
+var oldStylePluginId = pluginMapper[plugin];
+if (oldStylePluginId) {
--- End diff --

'oldStylePluginId' is not the correct name for what the registry-mapper 
(pluginMapper) returns. it returns the package name, which is the new way of 
doing things. so, I'd call it something like 'packageName' ..


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-android pull request: CB-9149: Make gradle alias subprojec...

2015-06-09 Thread tony--
GitHub user tony-- opened a pull request:

https://github.com/apache/cordova-android/pull/182

CB-9149: Make gradle alias subprojects in order to handle libs that d…

…epend on libs

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/tony--/cordova-android CB-9149

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-android/pull/182.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #182


commit 7ac9b14328196109df2f19d35b6625cd807bac95
Author: Tony Homer 
Date:   2015-06-10T04:57:01Z

CB-9149: Make gradle alias subprojects in order to handle libs that depend 
on libs




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9147 Adding a platform via caret vers...

2015-06-09 Thread omefire
Github user omefire commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/244#discussion_r32088659
  
--- Diff: cordova-lib/src/cordova/plugin.js ---
@@ -360,6 +360,12 @@ function getPluginVariables(variables){
 
 function getVersionFromConfigFile(plugin, cfg){
 var pluginEntry = cfg.getPlugin(plugin);
+if (!pluginEntry) {
+var oldStylePluginId = pluginMapper[plugin];
--- End diff --

a comment about why you are doing this would be great.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-media pull request: iOS play audio in background

2015-06-09 Thread Montoya
Github user Montoya commented on the pull request:


https://github.com/apache/cordova-plugin-media/pull/12#issuecomment-110569034
  
@hems we are talking about using a background thread to play audio, not 
playing audio while the app is in the background. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-contacts pull request: Android - Filter search: Con...

2015-06-09 Thread jason-engage
Github user jason-engage commented on the pull request:


https://github.com/apache/cordova-plugin-contacts/pull/64#issuecomment-110554527
  
Will this pull request make it into the master soon? I would like to use it 
asap.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-plugin-camera pull request: Update docs

2015-06-09 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-plugin-camera/pull/100


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



RE: Proposal: Cordova Plugin Search

2015-06-09 Thread Murat Sutunc
I’ve created a PR for the first iteration of plugin search page.
You can find the PR at https://github.com/apache/cordova-registry-web/pull/11

Current known issues:
- Search should lowercase queries
- Platform tags don't look good on ipad/iphone

-Original Message-
From: Joerg Holz [mailto:h...@hamburg.de] 
Sent: Saturday, June 6, 2015 1:26 PM
To: dev@cordova.apache.org
Subject: Re: Proposal: Cordova Plugin Search

Thx, great job!

If you need some help with CSS, … drop me a note.


Joerg


> Am 06.06.2015 um 02:09 schrieb Murat Sutunc :
> 
> Got some updates on this proposal! 
> I've prepared a live demo on: http://people.apache.org/~muratsu/ 
> Please visit the webpage and let me know what you think! 
> 
> Thanks,
> Murat
> 
> -Original Message-
> From: Murat Sutunc [mailto:mura...@microsoft.com] 
> Sent: Wednesday, June 3, 2015 11:41 AM
> To: dev@cordova.apache.org
> Subject: Proposal: Cordova Plugin Search
> 
> Hey everyone,
> I've seen couple folks mention the idea of turning plugins.cordova.io into a 
> Gulp & Yeoman style search page on dev mailing list. I've gone ahead and 
> created a proposal for how we might potentially tackle this problem. Please 
> see the extended discussion at GH: 
> https://github.com/cordova/cordova-discuss/issues/7
> 
> I'm looking forward to hear your ideas about this new search page! Please 
> feel free to comment on gh issue!
> 
> Thanks,
> Murat
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
> For additional commands, e-mail: dev-h...@cordova.apache.org
> 


Jörg Holz | +49-175-640 35 80   
h...@hamburg.de

NEU: doreport - die Reportingsoftware: 
http://www.doreport.de



-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-lib/pull/238


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[REVIEW] Tools Release blog post

2015-06-09 Thread Steven Gill
Please send pull requests for any fixes.
https://github.com/cordova/apache-blog-posts/blob/master/2015-06-10-tools-release.md

I will be publishing this tomorrow.


[GitHub] cordova-lib pull request: CB-9147 Adding a platform via caret vers...

2015-06-09 Thread stevengill
Github user stevengill commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/244#discussion_r32076090
  
--- Diff: cordova-lib/src/plugman/registry/registry.js ---
@@ -364,6 +364,28 @@ function fetchPlugin(plugin, client, useNpmRegistry) {
 });
 }
 
+function processPluginVersion(plugin) {
+// If plugin includes a version that is a caret range, the ancient 
version of npm we're using won't now how to
+// handle it. So we'll use our current version of semver to turn it 
into a usable range.
+
+var parts = plugin.split('@');
+var version = parts[1];
+
+if (!version || version.charAt(0) !== '^') {
+return plugin;
+}
+
+var validRange = semver.validRange(version, /* loose */ true);
+if (!validRange) {
+return plugin;
+}
+
+console.log('Returning processed plugin range: ' + parts[0] + '@"' + 
validRange + '"');
--- End diff --

Haha it happens to me all the time too. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9147 Adding a platform via caret vers...

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/244#discussion_r32076025
  
--- Diff: cordova-lib/src/plugman/registry/registry.js ---
@@ -364,6 +364,28 @@ function fetchPlugin(plugin, client, useNpmRegistry) {
 });
 }
 
+function processPluginVersion(plugin) {
+// If plugin includes a version that is a caret range, the ancient 
version of npm we're using won't now how to
+// handle it. So we'll use our current version of semver to turn it 
into a usable range.
+
+var parts = plugin.split('@');
+var version = parts[1];
+
+if (!version || version.charAt(0) !== '^') {
+return plugin;
+}
+
+var validRange = semver.validRange(version, /* loose */ true);
+if (!validRange) {
+return plugin;
+}
+
+console.log('Returning processed plugin range: ' + parts[0] + '@"' + 
validRange + '"');
--- End diff --

Grrr... That was actually debug code I intended to remove. Thought I caught 
them all. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9147 Adding a platform via caret vers...

2015-06-09 Thread stevengill
Github user stevengill commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/244#discussion_r32075367
  
--- Diff: cordova-lib/src/plugman/registry/registry.js ---
@@ -364,6 +364,28 @@ function fetchPlugin(plugin, client, useNpmRegistry) {
 });
 }
 
+function processPluginVersion(plugin) {
+// If plugin includes a version that is a caret range, the ancient 
version of npm we're using won't now how to
+// handle it. So we'll use our current version of semver to turn it 
into a usable range.
+
+var parts = plugin.split('@');
+var version = parts[1];
+
+if (!version || version.charAt(0) !== '^') {
+return plugin;
+}
+
+var validRange = semver.validRange(version, /* loose */ true);
+if (!validRange) {
+return plugin;
+}
+
+console.log('Returning processed plugin range: ' + parts[0] + '@"' + 
validRange + '"');
--- End diff --

I would change console.log to events.emit('log', MSG) or ' 
events.emit('verbose', MSG)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: Sticky Channels

2015-06-09 Thread Brian LeRoux
big -1 on promises from me; they've only been a pain for us thus far (ask
steve about the plugman debugging

maybe when they're "native". mybe.

On Tue, Jun 9, 2015 at 7:27 AM, Ian Clelland  wrote:

> On Tue, Jun 9, 2015 at 10:19 AM, Andrew Grieve 
> wrote:
>
> > I think the only place sticky channels are used is for startup events
> > (deviceready, nativeready, pluginsready, etc). I think you could probably
> > change them to fire multiple times without breaking too much, but the
> > semantics of that seem really strange to me (fire the most recent event,
> or
> > all events? upon registering, but only to the newly added listener(s))
> >
> > They are not based on any standard, so it might be nice not to use them,
> > and instead use standard events (e.g. cordova.fireWindowEvent). As long
> as
> > we promise not to fire them until after deviceready, apps should be able
> to
> > register listeners reliably.
> >
>
> This was an area that I was hoping to leverage to use promises instead,
> back when we were discussing baking those into cordova.js -- it would be a
> major change from the existing way of doing things, but sticky channels are
> closer in spirit to promises than they are to events, I think.
>
> It's very similar to the service worker `ready` attribute -- before the
> worker is active, it returns a promise that asynchronously waits for
> everything to be ready, and then fires. After the worker is already active,
> the promise resolves immediately, just like deviceready does if you attach
> a listener after Cordova has initialized.
>
>
> >
> > One other data point for this is that I dealt with the as-a-service vs.
> > as-a-launch in
> > https://github.com/MobileChromeApps/cordova-plugin-background-app. In
> this
> > model, I set a property before each resume / deviceready that can be
> > queried to find out the app's state. Could possibly do similar for
> intents
> > (but would need an event as well since they can come at any time, not
> just
> > on start-up)
> >
> > On Fri, Jun 5, 2015 at 7:18 PM, Jesse  wrote:
> >
> > > I have been looking into unifying launchParameters across devices so
> that
> > > all cordova apps can get some context of how they were
> > launched/activated.
> > > This includes everything from a url/protocol launch in another app, to
> a
> > > touch on a notification (toast,local,push,... )
> > >
> > > My intent was to add a channel for this, however I have had some issues
> > > with channels + stickiness.
> > >
> > > I wanted a channel that would call new subscribers immediately if it
> had
> > > already fired.  In our channel implementation this is what we call a
> > sticky
> > > channel.  However, this particular channel may fire more than once, ie.
> > we
> > > could be activated multiple times while running, or receive multiple
> > > notifications.
> > > The current implementation for sticky will only ever call subscribers
> > once,
> > > and if I call fire() more than once, it actually removes it's
> > subscribers.
> > > [1] So I cannot use this as is for my needs.
> > >
> > > So my questions are :
> > > 1. Why is like this? Is there some standard or expectation that this is
> > > based on?
> > > 2. Can I change it? What would be the impact of changing the behavior
> to
> > > have a sticky channel fire more than once, and keep its list of
> > > subscribers?
> > > 3. Are there historical reasons that things are the way they are? The
> > code
> > > has been through several major moves since it was written, so it is
> > > difficult to pin the original commit (Fil, Andrew? some merged pr?)  If
> > > there are historical reasons, are they still relevant?
> > >
> > > Please keep in mind too that I am not asking for the solution to my
> > > specific task, I can work around anything ... I am asking solely about
> > the
> > > current channel-sticky implementation and it we should change it.
> > >
> > > Cheers,
> > >   Jesse
> > >
> > >
> > > The current implementation
> > > [1]
> > >
> >
> https://github.com/apache/cordova-js/blob/master/src/common/channel.js#L216
> > >
> > >
> > > @purplecabbage
> > > risingj.com
> > >
> >
>


[GitHub] cordova-mobile-spec pull request: CB-8927 Add media to cspMeta and...

2015-06-09 Thread muratsu
Github user muratsu closed the pull request at:

https://github.com/apache/cordova-mobile-spec/pull/127


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: [iOS 8] WKWebView moving forward

2015-06-09 Thread Shazron
I definitely will watch.
Just read about ODR
https://developer.apple.com/library/prerelease/ios/documentation/FileManagement/Conceptual/On_Demand_Resources_Guide/Chapters/IntroToODR.html#//apple_ref/doc/uid/TP40015083-CH2-SW1

So we could still use the copy method (fast, small app bundle) and have a
solution in Cordova for ODR for app bundles that are huge. For example, in
the CLI prepare step.

Of course this won't be a universal solution and is more complicated.

On Tuesday, June 9, 2015, Carlos Santana  wrote:

> What do we loose, I just attended the session.
> I think for most uses is a win at least in the security aspect
> Watch the session when the video is available and we can discuss later.
>
> On Tue, Jun 9, 2015 at 1:23 PM Shazron >
> wrote:
>
> > We could use it for InAppBrowser but we might lose some features that we
> > have possibly.
> >
> > Anyways, one piece of bad news for WKWebView iOS 9 - you can load file
> urls
> > in Library and Documents, but not the app bundle.
> > https://twitter.com/wkwebview/status/608359163299819521
> >
> > On Tue, Jun 9, 2015 at 1:02 PM, Carlos Santana  >
> > wrote:
> >
> > > Yay !
> > > There is also a new Safari View Controller, don't know if it's
> applicable
> > > to replace wkwebview but at least I think it can be use to build the
> next
> > > gen inappbrowser since its beats a makeup in iOS anyway.
> > >
> > > The session is in 30 minutes so I'm planning attending.
> > > On Mon, Jun 8, 2015 at 2:33 PM Shazron  > wrote:
> > >
> > > > There is a WWDC session: "Safari Extensibility: Content Blocking and
> > > Shared
> > > > Links". So I'm hopeful for whitelisting
> > > >
> > > > On Mon, Jun 8, 2015 at 1:22 PM, Shazron  > wrote:
> > > >
> > > > > Moar news https://twitter.com/wkwebview/status/608005652720451584
> > > > >
> > > > >
> > > > > On Monday, June 8, 2015, Shazron >
> wrote:
> > > > >
> > > > >> Cordova developers rejoice, iOS 9 includes the API to load pages
> > from
> > > > >> file:// urls
> > https://twitter.com/wkwebview/status/608002548151119872
> > > > >>
> > > > >> On Mon, Feb 9, 2015 at 2:19 PM, Shazron  > wrote:
> > > > >>
> > > > >>> Also Xcode 6.3 now *requires* Yosemite. Fair warning to upgrade I
> > > > >>> suppose for your dev machines and build servers...
> > > > >>>
> > > > >>>
> > > > >>> On Mon, Feb 9, 2015 at 2:13 PM, tommy-carlos williams
> > > > >>> > wrote:
> > > > >>> > Oh, FFS.
> > > > >>> >
> > > > >>> > I give up on Apple solving this, personally. Most apps don’t
> > > > >>> *actually* need it (they think they do, but they don’t). I am
> going
> > > to
> > > > find
> > > > >>> another way to solve it for our apps… maybe I will actually have
> to
> > > > write a
> > > > >>> native plugin for the crypto :(
> > > > >>> >
> > > > >>> > --
> > > > >>> > tommy-carlos williams
> > > > >>> >
> > > > >>> > On 10 February 2015 at 08:18:31, Shazron (shaz...@gmail.com
> )
> > > wrote:
> > > > >>> >
> > > > >>> > In other news -- the new Xcode 6.3 beta (iOS 8.3) does *not*
> > > contain
> > > > >>> > the loadFileURL:readAccessURL: selector that we are all waiting
> > for
> > > > >>> > :'(
> > > > >>> > https://twitter.com/wkwebview/status/564865657225756672
> > > > >>>
> > > > >>
> > > > >>
> > > >
> > >
> >
>


Re: Cordova Meetup/Beerup at WWDC?

2015-06-09 Thread Steven Gill
Lets do it.

On Tue, Jun 9, 2015 at 1:21 PM, Carlos Santana  wrote:

> How about tomorrow night?
>
> On Mon, Jun 8, 2015 at 10:29 AM Brian LeRoux  wrote:
>
> > right on! lets plan a mini meetup this week!
> >
> > On Fri, Jun 5, 2015 at 5:24 PM, Carlos Santana 
> > wrote:
> >
> > > I will be in SF this week starting Sunday for WWDC, somehow I was able
> to
> > > get a ticket thru IBM ;-)
> > >
> > > I will be there Sunday to Friday, if anyone wants to meet to talk,
> hack,
> > > eat or drink let me know
> > >
> > > --
> > > Carlos Santana
> > >
> >
>


Re: [iOS 8] WKWebView moving forward

2015-06-09 Thread Carlos Santana
What do we loose, I just attended the session.
I think for most uses is a win at least in the security aspect
Watch the session when the video is available and we can discuss later.

On Tue, Jun 9, 2015 at 1:23 PM Shazron  wrote:

> We could use it for InAppBrowser but we might lose some features that we
> have possibly.
>
> Anyways, one piece of bad news for WKWebView iOS 9 - you can load file urls
> in Library and Documents, but not the app bundle.
> https://twitter.com/wkwebview/status/608359163299819521
>
> On Tue, Jun 9, 2015 at 1:02 PM, Carlos Santana 
> wrote:
>
> > Yay !
> > There is also a new Safari View Controller, don't know if it's applicable
> > to replace wkwebview but at least I think it can be use to build the next
> > gen inappbrowser since its beats a makeup in iOS anyway.
> >
> > The session is in 30 minutes so I'm planning attending.
> > On Mon, Jun 8, 2015 at 2:33 PM Shazron  wrote:
> >
> > > There is a WWDC session: "Safari Extensibility: Content Blocking and
> > Shared
> > > Links". So I'm hopeful for whitelisting
> > >
> > > On Mon, Jun 8, 2015 at 1:22 PM, Shazron  wrote:
> > >
> > > > Moar news https://twitter.com/wkwebview/status/608005652720451584
> > > >
> > > >
> > > > On Monday, June 8, 2015, Shazron  wrote:
> > > >
> > > >> Cordova developers rejoice, iOS 9 includes the API to load pages
> from
> > > >> file:// urls
> https://twitter.com/wkwebview/status/608002548151119872
> > > >>
> > > >> On Mon, Feb 9, 2015 at 2:19 PM, Shazron  wrote:
> > > >>
> > > >>> Also Xcode 6.3 now *requires* Yosemite. Fair warning to upgrade I
> > > >>> suppose for your dev machines and build servers...
> > > >>>
> > > >>>
> > > >>> On Mon, Feb 9, 2015 at 2:13 PM, tommy-carlos williams
> > > >>>  wrote:
> > > >>> > Oh, FFS.
> > > >>> >
> > > >>> > I give up on Apple solving this, personally. Most apps don’t
> > > >>> *actually* need it (they think they do, but they don’t). I am going
> > to
> > > find
> > > >>> another way to solve it for our apps… maybe I will actually have to
> > > write a
> > > >>> native plugin for the crypto :(
> > > >>> >
> > > >>> > --
> > > >>> > tommy-carlos williams
> > > >>> >
> > > >>> > On 10 February 2015 at 08:18:31, Shazron (shaz...@gmail.com)
> > wrote:
> > > >>> >
> > > >>> > In other news -- the new Xcode 6.3 beta (iOS 8.3) does *not*
> > contain
> > > >>> > the loadFileURL:readAccessURL: selector that we are all waiting
> for
> > > >>> > :'(
> > > >>> > https://twitter.com/wkwebview/status/564865657225756672
> > > >>>
> > > >>
> > > >>
> > >
> >
>


[GitHub] cordova-lib pull request: CB-9147 Adding a platform via caret vers...

2015-06-09 Thread TimBarham
GitHub user TimBarham opened a pull request:

https://github.com/apache/cordova-lib/pull/244

CB-9147 Adding a platform via caret version adds wrong version

It adds the very latest version rather than the latest matching version.

Internally we are using a version of `npm` that doesn't understand caret 
versions, so it just gets the latest. I missed this previously because when I 
tried this, the latest version **was also** the latest matching version.

The same problem also applies to plugins.

I've made a slightly different fix in each case:

For platforms, we already had the latest matching version as a result of 
our call to `getLatestMatchingNpmVersion()`, so I just use that.

For plugins, in this specific scenario (a caret version) I turn it into a 
standard range using a version of `semver` that understands caret ranges (so 
`^1.2.3` becomes `>=1.2.3 <2.0.0`) and use that instead.

Note that this is currently an issue with platforms and plugin versions 
saved to `config.xml`.

Also, I noticed that we failed to find the version in `config.xml` if you 
added it using the new form (`cordova-plugin-camera`, for example), but it was 
stored in `config.xml` using the id, so fixed that.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MSOpenTech/cordova-lib CB-9147

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-lib/pull/244.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #244


commit 025127916530de530dccaeb98b2b9a9bc8df8e2a
Author: Tim Barham 
Date:   2015-06-09T22:20:13Z

CB-9147 Adding a platform via caret version adds latest rather than the 
latest matching.

Internally we are using a version of npm that doesn't understand caret 
versions, so it just gets the latest. Missed this previously because when I 
tried this, the latest version *was* the latest matching version.

The same problem also applies to plugins.

Slightly different fix in each case:

For platforms, we already had the latest matching version as a result of 
our call to getLatestMatchingNpmVersion(), so we just use that.

For plugins, in this specific scenario (a caret version) we turn it into a 
standard range using a version of semver that understands caret ranges (so 
'^1.2.3' becomes '>=1.2.3 <2.0.0') and use that instead.

Also, I noticed that we failed to find the version in config.xml if you 
added it using the new form (cordova-plugin-camera, for example), but it was 
stored in config.xml using the id, so fixed that.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: [CI] cordova-vm.apache.org is up

2015-06-09 Thread Shazron
I would give it to Steve as well, seeing as agrieve has said he would be
less active on the project. I don't need sudo *wrings hands*

On Tue, Jun 9, 2015 at 2:20 PM, Dmitry Blotsky 
wrote:

> Hi folks,
>
> cordova-vm.apache.org is alive and kicking, and access has been given to:
>
> agrieve (sudo)
> steven
> shazron
> dblotsky (sudo)
>
> Infra ticket is here: https://issues.apache.org/jira/browse/INFRA-9795.
> Anyone else who would need access, please give a shout (preferably by
> today).
>
> Shaz and Steven: does one or both of you guys need sudo? In general, I
> think we should have at least 3 Cordova sudoers on the machine in case
> something urgent needs to be done and someone is unavailable.
>
> Kindly,
> Dmitry
>


[CI] cordova-vm.apache.org is up

2015-06-09 Thread Dmitry Blotsky
Hi folks,

cordova-vm.apache.org is alive and kicking, and access has been given to:

agrieve (sudo)
steven
shazron
dblotsky (sudo)

Infra ticket is here: https://issues.apache.org/jira/browse/INFRA-9795. Anyone 
else who would need access, please give a shout (preferably by today).

Shaz and Steven: does one or both of you guys need sudo? In general, I think we 
should have at least 3 Cordova sudoers on the machine in case something urgent 
needs to be done and someone is unavailable.

Kindly,
Dmitry


Re: [iOS 8] WKWebView moving forward

2015-06-09 Thread tommy-carlos williams
I hadn’t considered the space issue. Mind you, my apps are like 1.7MB. Not 
exactly space hogs. At least the camera and downloads issues would be fixed :(

-- 
tommy-carlos williams

On 10 June 2015 at 07:04:00, Shazron (shaz...@gmail.com) wrote:

+1 to what Kerri said.  
If we did it, it would be in Library/Caches since that is not backed up by  
iTunes:  
https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW1
  

On Tue, Jun 9, 2015 at 1:58 PM, Kerri Shotts  wrote:  

> Speaking as a user who has an iPhone that’s always running near the  
> storage limit: I’d hate to see files be duplicate out of the bundle into  
> another location… my phone might cry.  
>  
> I think we went over that when WKWebview was first released. Copying files  
> was discussed, but it adds an awful lot of complexity to startup, wastes  
> space, etc. Looks like the local web server might be the best option, still.  
>  
> But I guess this gives the option of using web content that the app itself  
> downloads to /Documents or /Library, so that could be nice. Unfortunate  
> that they hamstrung it regarding bundles tho. Here’s hoping they’ll change  
> it, but given the track record in iOS 8, I’m not holding my breath.  
>  
>  
>  
>  
> On June 9, 2015 at 3:50:09 PM, Ross Gerbasi (rgerb...@gmail.com) wrote:  
>  
> Would it be a horrible idea to copy files into one of those folders?  
>  
> On Tue, Jun 9, 2015 at 3:22 PM, Shazron  wrote:  
>  
> > We could use it for InAppBrowser but we might lose some features that we  
> > have possibly.  
> >  
> > Anyways, one piece of bad news for WKWebView iOS 9 - you can load file  
> urls  
> > in Library and Documents, but not the app bundle.  
> > https://twitter.com/wkwebview/status/608359163299819521  
> >  
> > On Tue, Jun 9, 2015 at 1:02 PM, Carlos Santana   
> > wrote:  
> >  
> > > Yay !  
> > > There is also a new Safari View Controller, don't know if it's  
> applicable  
> > > to replace wkwebview but at least I think it can be use to build the  
> next  
> > > gen inappbrowser since its beats a makeup in iOS anyway.  
> > >  
> > > The session is in 30 minutes so I'm planning attending.  
> > > On Mon, Jun 8, 2015 at 2:33 PM Shazron  wrote:  
> > >  
> > > > There is a WWDC session: "Safari Extensibility: Content Blocking and  
> > > Shared  
> > > > Links". So I'm hopeful for whitelisting  
> > > >  
> > > > On Mon, Jun 8, 2015 at 1:22 PM, Shazron  wrote:  
> > > >  
> > > > > Moar news https://twitter.com/wkwebview/status/608005652720451584  
> > > > >  
> > > > >  
> > > > > On Monday, June 8, 2015, Shazron  wrote:  
> > > > >  
> > > > >> Cordova developers rejoice, iOS 9 includes the API to load pages  
> > from  
> > > > >> file:// urls  
> > https://twitter.com/wkwebview/status/608002548151119872  
> > > > >>  
> > > > >> On Mon, Feb 9, 2015 at 2:19 PM, Shazron   
> wrote:  
> > > > >>  
> > > > >>> Also Xcode 6.3 now *requires* Yosemite. Fair warning to upgrade I  
> > > > >>> suppose for your dev machines and build servers...  
> > > > >>>  
> > > > >>>  
> > > > >>> On Mon, Feb 9, 2015 at 2:13 PM, tommy-carlos williams  
> > > > >>>  wrote:  
> > > > >>> > Oh, FFS.  
> > > > >>> >  
> > > > >>> > I give up on Apple solving this, personally. Most apps don’t  
> > > > >>> *actually* need it (they think they do, but they don’t). I am  
> going  
> > > to  
> > > > find  
> > > > >>> another way to solve it for our apps… maybe I will actually have  
> to  
> > > > write a  
> > > > >>> native plugin for the crypto :(  
> > > > >>> >  
> > > > >>> > --  
> > > > >>> > tommy-carlos williams  
> > > > >>> >  
> > > > >>> > On 10 February 2015 at 08:18:31, Shazron (shaz...@gmail.com)  
> > > wrote:  
> > > > >>> >  
> > > > >>> > In other news -- the new Xcode 6.3 beta (iOS 8.3) does *not*  
> > > contain  
> > > > >>> > the loadFileURL:readAccessURL: selector that we are all waiting  
> > for  
> > > > >>> > :'(  
> > > > >>> > https://twitter.com/wkwebview/status/564865657225756672  
> > > > >>>  
> > > > >>  
> > > > >>  
> > > >  
> > >  
> >  
>  


Re: [iOS 8] WKWebView moving forward

2015-06-09 Thread Shazron
+1 to what Kerri said.
If we did it, it would be in Library/Caches since that is not backed up by
iTunes:
https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW1

On Tue, Jun 9, 2015 at 1:58 PM, Kerri Shotts  wrote:

> Speaking as a user who has an iPhone that’s always running near the
> storage limit: I’d hate to see files be duplicate out of the bundle into
> another location… my phone might cry.
>
> I think we went over that when WKWebview was first released. Copying files
> was discussed, but it adds an awful lot of complexity to startup, wastes
> space, etc. Looks like the local web server might be the best option, still.
>
> But I guess this gives the option of using web content that the app itself
> downloads to /Documents or /Library, so that could be nice. Unfortunate
> that they hamstrung it regarding bundles tho. Here’s hoping they’ll change
> it, but given the track record in iOS 8, I’m not holding my breath.
>
>
>
>
> On June 9, 2015 at 3:50:09 PM, Ross Gerbasi (rgerb...@gmail.com) wrote:
>
> Would it be a horrible idea to copy files into one of those folders?
>
> On Tue, Jun 9, 2015 at 3:22 PM, Shazron  wrote:
>
> > We could use it for InAppBrowser but we might lose some features that we
> > have possibly.
> >
> > Anyways, one piece of bad news for WKWebView iOS 9 - you can load file
> urls
> > in Library and Documents, but not the app bundle.
> > https://twitter.com/wkwebview/status/608359163299819521
> >
> > On Tue, Jun 9, 2015 at 1:02 PM, Carlos Santana 
> > wrote:
> >
> > > Yay !
> > > There is also a new Safari View Controller, don't know if it's
> applicable
> > > to replace wkwebview but at least I think it can be use to build the
> next
> > > gen inappbrowser since its beats a makeup in iOS anyway.
> > >
> > > The session is in 30 minutes so I'm planning attending.
> > > On Mon, Jun 8, 2015 at 2:33 PM Shazron  wrote:
> > >
> > > > There is a WWDC session: "Safari Extensibility: Content Blocking and
> > > Shared
> > > > Links". So I'm hopeful for whitelisting
> > > >
> > > > On Mon, Jun 8, 2015 at 1:22 PM, Shazron  wrote:
> > > >
> > > > > Moar news https://twitter.com/wkwebview/status/608005652720451584
> > > > >
> > > > >
> > > > > On Monday, June 8, 2015, Shazron  wrote:
> > > > >
> > > > >> Cordova developers rejoice, iOS 9 includes the API to load pages
> > from
> > > > >> file:// urls
> > https://twitter.com/wkwebview/status/608002548151119872
> > > > >>
> > > > >> On Mon, Feb 9, 2015 at 2:19 PM, Shazron 
> wrote:
> > > > >>
> > > > >>> Also Xcode 6.3 now *requires* Yosemite. Fair warning to upgrade I
> > > > >>> suppose for your dev machines and build servers...
> > > > >>>
> > > > >>>
> > > > >>> On Mon, Feb 9, 2015 at 2:13 PM, tommy-carlos williams
> > > > >>>  wrote:
> > > > >>> > Oh, FFS.
> > > > >>> >
> > > > >>> > I give up on Apple solving this, personally. Most apps don’t
> > > > >>> *actually* need it (they think they do, but they don’t). I am
> going
> > > to
> > > > find
> > > > >>> another way to solve it for our apps… maybe I will actually have
> to
> > > > write a
> > > > >>> native plugin for the crypto :(
> > > > >>> >
> > > > >>> > --
> > > > >>> > tommy-carlos williams
> > > > >>> >
> > > > >>> > On 10 February 2015 at 08:18:31, Shazron (shaz...@gmail.com)
> > > wrote:
> > > > >>> >
> > > > >>> > In other news -- the new Xcode 6.3 beta (iOS 8.3) does *not*
> > > contain
> > > > >>> > the loadFileURL:readAccessURL: selector that we are all waiting
> > for
> > > > >>> > :'(
> > > > >>> > https://twitter.com/wkwebview/status/564865657225756672
> > > > >>>
> > > > >>
> > > > >>
> > > >
> > >
> >
>


Re: [iOS 8] WKWebView moving forward

2015-06-09 Thread Kerri Shotts
Speaking as a user who has an iPhone that’s always running near the storage 
limit: I’d hate to see files be duplicate out of the bundle into another 
location… my phone might cry.

I think we went over that when WKWebview was first released. Copying files was 
discussed, but it adds an awful lot of complexity to startup, wastes space, 
etc. Looks like the local web server might be the best option, still.

But I guess this gives the option of using web content that the app itself 
downloads to /Documents or /Library, so that could be nice. Unfortunate that 
they hamstrung it regarding bundles tho. Here’s hoping they’ll change it, but 
given the track record in iOS 8, I’m not holding my breath.




On June 9, 2015 at 3:50:09 PM, Ross Gerbasi (rgerb...@gmail.com) wrote:

Would it be a horrible idea to copy files into one of those folders?  

On Tue, Jun 9, 2015 at 3:22 PM, Shazron  wrote:  

> We could use it for InAppBrowser but we might lose some features that we  
> have possibly.  
>  
> Anyways, one piece of bad news for WKWebView iOS 9 - you can load file urls  
> in Library and Documents, but not the app bundle.  
> https://twitter.com/wkwebview/status/608359163299819521  
>  
> On Tue, Jun 9, 2015 at 1:02 PM, Carlos Santana   
> wrote:  
>  
> > Yay !  
> > There is also a new Safari View Controller, don't know if it's applicable  
> > to replace wkwebview but at least I think it can be use to build the next  
> > gen inappbrowser since its beats a makeup in iOS anyway.  
> >  
> > The session is in 30 minutes so I'm planning attending.  
> > On Mon, Jun 8, 2015 at 2:33 PM Shazron  wrote:  
> >  
> > > There is a WWDC session: "Safari Extensibility: Content Blocking and  
> > Shared  
> > > Links". So I'm hopeful for whitelisting  
> > >  
> > > On Mon, Jun 8, 2015 at 1:22 PM, Shazron  wrote:  
> > >  
> > > > Moar news https://twitter.com/wkwebview/status/608005652720451584  
> > > >  
> > > >  
> > > > On Monday, June 8, 2015, Shazron  wrote:  
> > > >  
> > > >> Cordova developers rejoice, iOS 9 includes the API to load pages  
> from  
> > > >> file:// urls  
> https://twitter.com/wkwebview/status/608002548151119872  
> > > >>  
> > > >> On Mon, Feb 9, 2015 at 2:19 PM, Shazron  wrote:  
> > > >>  
> > > >>> Also Xcode 6.3 now *requires* Yosemite. Fair warning to upgrade I  
> > > >>> suppose for your dev machines and build servers...  
> > > >>>  
> > > >>>  
> > > >>> On Mon, Feb 9, 2015 at 2:13 PM, tommy-carlos williams  
> > > >>>  wrote:  
> > > >>> > Oh, FFS.  
> > > >>> >  
> > > >>> > I give up on Apple solving this, personally. Most apps don’t  
> > > >>> *actually* need it (they think they do, but they don’t). I am going  
> > to  
> > > find  
> > > >>> another way to solve it for our apps… maybe I will actually have to  
> > > write a  
> > > >>> native plugin for the crypto :(  
> > > >>> >  
> > > >>> > --  
> > > >>> > tommy-carlos williams  
> > > >>> >  
> > > >>> > On 10 February 2015 at 08:18:31, Shazron (shaz...@gmail.com)  
> > wrote:  
> > > >>> >  
> > > >>> > In other news -- the new Xcode 6.3 beta (iOS 8.3) does *not*  
> > contain  
> > > >>> > the loadFileURL:readAccessURL: selector that we are all waiting  
> for  
> > > >>> > :'(  
> > > >>> > https://twitter.com/wkwebview/status/564865657225756672  
> > > >>>  
> > > >>  
> > > >>  
> > >  
> >  
>  


Re: [iOS 8] WKWebView moving forward

2015-06-09 Thread Ross Gerbasi
Would it be a horrible idea to copy files into one of those folders?

On Tue, Jun 9, 2015 at 3:22 PM, Shazron  wrote:

> We could use it for InAppBrowser but we might lose some features that we
> have possibly.
>
> Anyways, one piece of bad news for WKWebView iOS 9 - you can load file urls
> in Library and Documents, but not the app bundle.
> https://twitter.com/wkwebview/status/608359163299819521
>
> On Tue, Jun 9, 2015 at 1:02 PM, Carlos Santana 
> wrote:
>
> > Yay !
> > There is also a new Safari View Controller, don't know if it's applicable
> > to replace wkwebview but at least I think it can be use to build the next
> > gen inappbrowser since its beats a makeup in iOS anyway.
> >
> > The session is in 30 minutes so I'm planning attending.
> > On Mon, Jun 8, 2015 at 2:33 PM Shazron  wrote:
> >
> > > There is a WWDC session: "Safari Extensibility: Content Blocking and
> > Shared
> > > Links". So I'm hopeful for whitelisting
> > >
> > > On Mon, Jun 8, 2015 at 1:22 PM, Shazron  wrote:
> > >
> > > > Moar news https://twitter.com/wkwebview/status/608005652720451584
> > > >
> > > >
> > > > On Monday, June 8, 2015, Shazron  wrote:
> > > >
> > > >> Cordova developers rejoice, iOS 9 includes the API to load pages
> from
> > > >> file:// urls
> https://twitter.com/wkwebview/status/608002548151119872
> > > >>
> > > >> On Mon, Feb 9, 2015 at 2:19 PM, Shazron  wrote:
> > > >>
> > > >>> Also Xcode 6.3 now *requires* Yosemite. Fair warning to upgrade I
> > > >>> suppose for your dev machines and build servers...
> > > >>>
> > > >>>
> > > >>> On Mon, Feb 9, 2015 at 2:13 PM, tommy-carlos williams
> > > >>>  wrote:
> > > >>> > Oh, FFS.
> > > >>> >
> > > >>> > I give up on Apple solving this, personally. Most apps don’t
> > > >>> *actually* need it (they think they do, but they don’t). I am going
> > to
> > > find
> > > >>> another way to solve it for our apps… maybe I will actually have to
> > > write a
> > > >>> native plugin for the crypto :(
> > > >>> >
> > > >>> > --
> > > >>> > tommy-carlos williams
> > > >>> >
> > > >>> > On 10 February 2015 at 08:18:31, Shazron (shaz...@gmail.com)
> > wrote:
> > > >>> >
> > > >>> > In other news -- the new Xcode 6.3 beta (iOS 8.3) does *not*
> > contain
> > > >>> > the loadFileURL:readAccessURL: selector that we are all waiting
> for
> > > >>> > :'(
> > > >>> > https://twitter.com/wkwebview/status/564865657225756672
> > > >>>
> > > >>
> > > >>
> > >
> >
>


Re: [iOS 8] WKWebView moving forward

2015-06-09 Thread Darryl Pogue
IndexedDB news is looking a bit bleak:
https://gist.github.com/nolanlawson/08eb857c6b17a30c1b26

On 9 June 2015 at 13:28, Shazron  wrote:
>
> Here's the juicy Safari iOS 9 bits, including new javascript and css
> features, including SFSafariViewController:
> https://developer.apple.com/library/prerelease/mac/releasenotes/General/WhatsNewInSafari/Articles/Safari_9.html
>
> On Tue, Jun 9, 2015 at 1:22 PM, Shazron  wrote:
>
> > We could use it for InAppBrowser but we might lose some features that we
> > have possibly.
> >
> > Anyways, one piece of bad news for WKWebView iOS 9 - you can load file
> > urls in Library and Documents, but not the app bundle.
> > https://twitter.com/wkwebview/status/608359163299819521
> >
> > On Tue, Jun 9, 2015 at 1:02 PM, Carlos Santana 
> > wrote:
> >
> >> Yay !
> >> There is also a new Safari View Controller, don't know if it's applicable
> >> to replace wkwebview but at least I think it can be use to build the next
> >> gen inappbrowser since its beats a makeup in iOS anyway.
> >>
> >> The session is in 30 minutes so I'm planning attending.
> >> On Mon, Jun 8, 2015 at 2:33 PM Shazron  wrote:
> >>
> >> > There is a WWDC session: "Safari Extensibility: Content Blocking and
> >> Shared
> >> > Links". So I'm hopeful for whitelisting
> >> >
> >> > On Mon, Jun 8, 2015 at 1:22 PM, Shazron  wrote:
> >> >
> >> > > Moar news https://twitter.com/wkwebview/status/608005652720451584
> >> > >
> >> > >
> >> > > On Monday, June 8, 2015, Shazron  wrote:
> >> > >
> >> > >> Cordova developers rejoice, iOS 9 includes the API to load pages from
> >> > >> file:// urls https://twitter.com/wkwebview/status/608002548151119872
> >> > >>
> >> > >> On Mon, Feb 9, 2015 at 2:19 PM, Shazron  wrote:
> >> > >>
> >> > >>> Also Xcode 6.3 now *requires* Yosemite. Fair warning to upgrade I
> >> > >>> suppose for your dev machines and build servers...
> >> > >>>
> >> > >>>
> >> > >>> On Mon, Feb 9, 2015 at 2:13 PM, tommy-carlos williams
> >> > >>>  wrote:
> >> > >>> > Oh, FFS.
> >> > >>> >
> >> > >>> > I give up on Apple solving this, personally. Most apps don’t
> >> > >>> *actually* need it (they think they do, but they don’t). I am going
> >> to
> >> > find
> >> > >>> another way to solve it for our apps… maybe I will actually have to
> >> > write a
> >> > >>> native plugin for the crypto :(
> >> > >>> >
> >> > >>> > --
> >> > >>> > tommy-carlos williams
> >> > >>> >
> >> > >>> > On 10 February 2015 at 08:18:31, Shazron (shaz...@gmail.com)
> >> wrote:
> >> > >>> >
> >> > >>> > In other news -- the new Xcode 6.3 beta (iOS 8.3) does *not*
> >> contain
> >> > >>> > the loadFileURL:readAccessURL: selector that we are all waiting
> >> for
> >> > >>> > :'(
> >> > >>> > https://twitter.com/wkwebview/status/564865657225756672
> >> > >>>
> >> > >>
> >> > >>
> >> >
> >>
> >
> >

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: Adds license headers to files in templat...

2015-06-09 Thread TimBarham
GitHub user TimBarham opened a pull request:

https://github.com/apache/cordova-lib/pull/243

Adds license headers to files in templates folder.

Also, updates code that uses the template files when building plugins to 
strip the license so its not included in users' projects (note we don't need to 
strip the license from the XML files as we immediately generate an element tree 
with `ElementTree`).

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MSOpenTech/cordova-lib tb-license

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-lib/pull/243.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #243


commit e1c719266f4da586f852e1a3631f0433d0795df4
Author: Tim Barham 
Date:   2015-06-09T20:27:08Z

Adds license headers to files in templates folder.

Also, updates code that uses the template files when building plugins to 
strip the license (since we don't want to add it to users' projects).




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: [iOS 8] WKWebView moving forward

2015-06-09 Thread Shazron
Here's the juicy Safari iOS 9 bits, including new javascript and css
features, including SFSafariViewController:
https://developer.apple.com/library/prerelease/mac/releasenotes/General/WhatsNewInSafari/Articles/Safari_9.html

On Tue, Jun 9, 2015 at 1:22 PM, Shazron  wrote:

> We could use it for InAppBrowser but we might lose some features that we
> have possibly.
>
> Anyways, one piece of bad news for WKWebView iOS 9 - you can load file
> urls in Library and Documents, but not the app bundle.
> https://twitter.com/wkwebview/status/608359163299819521
>
> On Tue, Jun 9, 2015 at 1:02 PM, Carlos Santana 
> wrote:
>
>> Yay !
>> There is also a new Safari View Controller, don't know if it's applicable
>> to replace wkwebview but at least I think it can be use to build the next
>> gen inappbrowser since its beats a makeup in iOS anyway.
>>
>> The session is in 30 minutes so I'm planning attending.
>> On Mon, Jun 8, 2015 at 2:33 PM Shazron  wrote:
>>
>> > There is a WWDC session: "Safari Extensibility: Content Blocking and
>> Shared
>> > Links". So I'm hopeful for whitelisting
>> >
>> > On Mon, Jun 8, 2015 at 1:22 PM, Shazron  wrote:
>> >
>> > > Moar news https://twitter.com/wkwebview/status/608005652720451584
>> > >
>> > >
>> > > On Monday, June 8, 2015, Shazron  wrote:
>> > >
>> > >> Cordova developers rejoice, iOS 9 includes the API to load pages from
>> > >> file:// urls https://twitter.com/wkwebview/status/608002548151119872
>> > >>
>> > >> On Mon, Feb 9, 2015 at 2:19 PM, Shazron  wrote:
>> > >>
>> > >>> Also Xcode 6.3 now *requires* Yosemite. Fair warning to upgrade I
>> > >>> suppose for your dev machines and build servers...
>> > >>>
>> > >>>
>> > >>> On Mon, Feb 9, 2015 at 2:13 PM, tommy-carlos williams
>> > >>>  wrote:
>> > >>> > Oh, FFS.
>> > >>> >
>> > >>> > I give up on Apple solving this, personally. Most apps don’t
>> > >>> *actually* need it (they think they do, but they don’t). I am going
>> to
>> > find
>> > >>> another way to solve it for our apps… maybe I will actually have to
>> > write a
>> > >>> native plugin for the crypto :(
>> > >>> >
>> > >>> > --
>> > >>> > tommy-carlos williams
>> > >>> >
>> > >>> > On 10 February 2015 at 08:18:31, Shazron (shaz...@gmail.com)
>> wrote:
>> > >>> >
>> > >>> > In other news -- the new Xcode 6.3 beta (iOS 8.3) does *not*
>> contain
>> > >>> > the loadFileURL:readAccessURL: selector that we are all waiting
>> for
>> > >>> > :'(
>> > >>> > https://twitter.com/wkwebview/status/564865657225756672
>> > >>>
>> > >>
>> > >>
>> >
>>
>
>


[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r32059774
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
+var mtime = fs.statSync(path).mtime,
+itime = request.headers['if-modified-since'];
+return !itime || new Date(mtime) > new Date(itime);
+}
+
+var urlPath = url.parse(request.url).pathname;
+
+var filePath;
+if (opts.urlPathProcessor) {
+var result = opts.urlPathProcessor(urlPath, request, response, 
do302, do404);
+if (!result) {
+return;
+}
+filePath = result.filePath;
+}
+if (!filePath) {
+if (!root) {
+throw new Error('No server root directory HAS BEEN 
specified!');
+}
+filePath = path.join(root, urlPath);
+}
+
+fs.exists(filePath, function (exists) {
--- End diff --

So, I've done this slightly differently, but it ends up cleaning up the 
logic here quite a bit, and also in the implementations I have for 
`urlPathProcessor()`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: Cordova Meetup/Beerup at WWDC?

2015-06-09 Thread Carlos Santana
How about tomorrow night?

On Mon, Jun 8, 2015 at 10:29 AM Brian LeRoux  wrote:

> right on! lets plan a mini meetup this week!
>
> On Fri, Jun 5, 2015 at 5:24 PM, Carlos Santana 
> wrote:
>
> > I will be in SF this week starting Sunday for WWDC, somehow I was able to
> > get a ticket thru IBM ;-)
> >
> > I will be there Sunday to Friday, if anyone wants to meet to talk, hack,
> > eat or drink let me know
> >
> > --
> > Carlos Santana
> >
>


Re: [iOS 8] WKWebView moving forward

2015-06-09 Thread Shazron
We could use it for InAppBrowser but we might lose some features that we
have possibly.

Anyways, one piece of bad news for WKWebView iOS 9 - you can load file urls
in Library and Documents, but not the app bundle.
https://twitter.com/wkwebview/status/608359163299819521

On Tue, Jun 9, 2015 at 1:02 PM, Carlos Santana  wrote:

> Yay !
> There is also a new Safari View Controller, don't know if it's applicable
> to replace wkwebview but at least I think it can be use to build the next
> gen inappbrowser since its beats a makeup in iOS anyway.
>
> The session is in 30 minutes so I'm planning attending.
> On Mon, Jun 8, 2015 at 2:33 PM Shazron  wrote:
>
> > There is a WWDC session: "Safari Extensibility: Content Blocking and
> Shared
> > Links". So I'm hopeful for whitelisting
> >
> > On Mon, Jun 8, 2015 at 1:22 PM, Shazron  wrote:
> >
> > > Moar news https://twitter.com/wkwebview/status/608005652720451584
> > >
> > >
> > > On Monday, June 8, 2015, Shazron  wrote:
> > >
> > >> Cordova developers rejoice, iOS 9 includes the API to load pages from
> > >> file:// urls https://twitter.com/wkwebview/status/608002548151119872
> > >>
> > >> On Mon, Feb 9, 2015 at 2:19 PM, Shazron  wrote:
> > >>
> > >>> Also Xcode 6.3 now *requires* Yosemite. Fair warning to upgrade I
> > >>> suppose for your dev machines and build servers...
> > >>>
> > >>>
> > >>> On Mon, Feb 9, 2015 at 2:13 PM, tommy-carlos williams
> > >>>  wrote:
> > >>> > Oh, FFS.
> > >>> >
> > >>> > I give up on Apple solving this, personally. Most apps don’t
> > >>> *actually* need it (they think they do, but they don’t). I am going
> to
> > find
> > >>> another way to solve it for our apps… maybe I will actually have to
> > write a
> > >>> native plugin for the crypto :(
> > >>> >
> > >>> > --
> > >>> > tommy-carlos williams
> > >>> >
> > >>> > On 10 February 2015 at 08:18:31, Shazron (shaz...@gmail.com)
> wrote:
> > >>> >
> > >>> > In other news -- the new Xcode 6.3 beta (iOS 8.3) does *not*
> contain
> > >>> > the loadFileURL:readAccessURL: selector that we are all waiting for
> > >>> > :'(
> > >>> > https://twitter.com/wkwebview/status/564865657225756672
> > >>>
> > >>
> > >>
> >
>


Re: [iOS 8] WKWebView moving forward

2015-06-09 Thread Carlos Santana
Yay !
There is also a new Safari View Controller, don't know if it's applicable
to replace wkwebview but at least I think it can be use to build the next
gen inappbrowser since its beats a makeup in iOS anyway.

The session is in 30 minutes so I'm planning attending.
On Mon, Jun 8, 2015 at 2:33 PM Shazron  wrote:

> There is a WWDC session: "Safari Extensibility: Content Blocking and Shared
> Links". So I'm hopeful for whitelisting
>
> On Mon, Jun 8, 2015 at 1:22 PM, Shazron  wrote:
>
> > Moar news https://twitter.com/wkwebview/status/608005652720451584
> >
> >
> > On Monday, June 8, 2015, Shazron  wrote:
> >
> >> Cordova developers rejoice, iOS 9 includes the API to load pages from
> >> file:// urls https://twitter.com/wkwebview/status/608002548151119872
> >>
> >> On Mon, Feb 9, 2015 at 2:19 PM, Shazron  wrote:
> >>
> >>> Also Xcode 6.3 now *requires* Yosemite. Fair warning to upgrade I
> >>> suppose for your dev machines and build servers...
> >>>
> >>>
> >>> On Mon, Feb 9, 2015 at 2:13 PM, tommy-carlos williams
> >>>  wrote:
> >>> > Oh, FFS.
> >>> >
> >>> > I give up on Apple solving this, personally. Most apps don’t
> >>> *actually* need it (they think they do, but they don’t). I am going to
> find
> >>> another way to solve it for our apps… maybe I will actually have to
> write a
> >>> native plugin for the crypto :(
> >>> >
> >>> > --
> >>> > tommy-carlos williams
> >>> >
> >>> > On 10 February 2015 at 08:18:31, Shazron (shaz...@gmail.com) wrote:
> >>> >
> >>> > In other news -- the new Xcode 6.3 beta (iOS 8.3) does *not* contain
> >>> > the loadFileURL:readAccessURL: selector that we are all waiting for
> >>> > :'(
> >>> > https://twitter.com/wkwebview/status/564865657225756672
> >>>
> >>
> >>
>


[GitHub] cordova-registry-web pull request: CB-9146 Initial commit for npm-...

2015-06-09 Thread muratsu
GitHub user muratsu opened a pull request:

https://github.com/apache/cordova-registry-web/pull/11

CB-9146 Initial commit for npm-search

Move npm search page development to registry-web.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MSOpenTech/cordova-registry-web CB-9146

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-registry-web/pull/11.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #11


commit dfa41d63d1456365d5665e9c4ad21fc5ce4dc3ce
Author: Murat Sutunc 
Date:   2015-06-09T18:23:12Z

CB-9146 Initial commit for npm-search




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: [VOTE] Tools Release June 4th

2015-06-09 Thread Steven Gill
The vote has now closed. The results are:

Positive Binding Votes: 4
Steve Gill
Tim Barham
Vladimir Kotikov
Sergey Grebnov

The vote has passed. I will publish to dist and npm, and share the
blog post for review


On Tue, Jun 9, 2015 at 12:34 AM, Sergey Grebnov (Akvelon) <
v-seg...@microsoft.com> wrote:

> I vote +1:
>
> * Manually verified blank app could be created, built and run (Windows and
> Android)
> * Run mobilespec autotests on Windows and Android
>
> Sergey Grebnov
>
> -Original Message-
> From: Vladimir Kotikov (Akvelon) [mailto:v-vlk...@microsoft.com]
> Sent: Tuesday, June 9, 2015 10:28 AM
> To: dev@cordova.apache.org
> Subject: RE: [VOTE] Tools Release June 4th
>
> I vote +1
>
> * Verified tags
> * Verified signatures
> * Ability to install/uninstall Cordova
> * Ability to update Cordova
> * Ability to create blank app for Windows, WP8, Android
> * Ability to run apps
>
> ---
> Best regards, Vladimir
>
> -Original Message-
> From: Steven Gill [mailto:stevengil...@gmail.com]
> Sent: Tuesday, 9 June, 2015 3:24
> To: dev@cordova.apache.org
> Subject: Re: [VOTE] Tools Release June 4th
>
> Need one more +1
>
> On Mon, Jun 8, 2015 at 10:51 AM, Tim Barham 
> wrote:
>
> > I vote +1
> >
> > Verified:
> > * cordova verify-tags (note this failed for cordova-lib as my origin
> > is github which still shows 5.1.1 tag on ffb02197e9, but I verified
> > manually on apache.org).
> > * cordova audit-license-headers.
> > * Verified builds are green.
> > * Created and ran blank app on Android and Windows.
> >
> > -Original Message-
> > From: Steven Gill [mailto:stevengil...@gmail.com]
> > Sent: Thursday, June 4, 2015 4:59 PM
> > To: dev@cordova.apache.org
> > Subject: Re: [VOTE] Tools Release June 4th
> >
> > Updated: cordova-lib: 5.1.1 (83cc078229)
> >
> > On Thu, Jun 4, 2015 at 11:20 AM, Steven Gill 
> > wrote:
> >
> > > Please review and vote on this Tools Release by replying to this
> > > email (and keep discussion on the DISCUSS thread)
> > >
> > > Release issue: https://issues.apache.org/jira/browse/CB-9087
> > >
> > > Both tools have been published to
> > > dist/dev:https://dist.apache.org/repos/dist/dev/cordova/CB-9087/
> > >
> > > The packages were published from their corresponding git tags:
> > >
> > > cordova-js: 4.0.0 (706c4a8936)
> > > cordova-lib: 5.1.1 (ffb02197e9)
> > > cordova-plugman: 0.23.3 (45dd80134a)
> > > cordova-cli: 5.1.1 (f15612cb8c)
> > >
> > > RELEASENOTES:
> > >
> > > cordova-js:
> > https://github.com/apache/cordova-js/blob/4.0.x/RELEASENOTES.md
> > > cordova-lib:
> > https://github.com/apache/cordova-lib/blob/5.1.x/cordova-lib/RELEASENO
> > TES.md
> > > cordova-plugman:
> > https://github.com/apache/cordova-plugman/blob/0.23.x/RELEASENOTES.md
> > > cordova-cli:
> > > https://github.com/apache/cordova-cli/blob/5.1.x/RELEASENOTES.md
> > >
> > > Upon a successful vote I will upload the archives to dist/, publish
> > > them
> > to NPM, and post the corresponding blog post.
> > > Voting guidelines:
> > > https://github.com/apache/cordova-coho/blob/master/docs/release-voti
> > > ng .md Voting will go on for a minimum of 48 hours.
> > >
> > > I vote +1:
> > > * Ran coho audit-license-headers over the relevant repos
> > > * Ran unit tests and saw that they were all building
> > > * Build a cordova project for ios and android and added a plugin.
> > >
> > >
> >
>


[GitHub] cordova-windows pull request: CB-9074 Fixed incorrect parameter er...

2015-06-09 Thread dblotsky
Github user dblotsky commented on the pull request:

https://github.com/apache/cordova-windows/pull/86#issuecomment-110457031
  
Did this get reviewed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: fix CB-9145 prepare can lose data during...

2015-06-09 Thread tony--
GitHub user tony-- opened a pull request:

https://github.com/apache/cordova-lib/pull/242

fix CB-9145 prepare can lose data during config munge

I added a test that adds access tags as described in CB-9145.  This test 
fails when run against master.
This is because the current exact match detection assumes that the query 
returning a result is sufficient to identify an exact attribute match.  
However, the query may also return results with additional attributes and these 
should be excluded.  

Originally I added a utility function that handles this case by performing 
a 2-way comparison.  However, we already know that foundChild.attr matches 
srcChild.attr because foundChild is a query result.  We only need to determine 
if foundChild has extra attributes, so simply comparing the number of 
attributes is sufficient.  

After making this change, all tests are green - including the newly added 
test that fails against master.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/tony--/cordova-lib CB-9145

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-lib/pull/242.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #242


commit 25982317b26c831dbea9d6b71dd57a90b933fc68
Author: Tony Homer 
Date:   2015-06-09T17:05:10Z

fix CB-9145 prepare can lose data during config munge




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r32038525
  
--- Diff: cordova-serve/src/browser.js ---
@@ -0,0 +1,100 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var exec = require('./exec'),
+Q = require('q');
+
+/**
+ * Launches the specified browser with the given URL.
+ * Based on https://github.com/domenic/opener
+ * @param {{target: ?string, url: ?string, dataDir: ?string}} opts - 
parameters:
+ *   target - the target browser - ie, chrome, safari, opera, firefox or 
chromium
+ *   url - the url to open in the browser
+ *   dataDir - a data dir to provide to Chrome (can be used to force it to 
open in a new window)
+ * @return {Q} Promise to launch the specified browser
+ */
+module.exports = function (opts) {
+//target, url, dataDir
+var target = opts.target || 'chrome';
+var url = opts.url || '';
+
+return mapTarget(target, opts.dataDir).then(function (browser) {
--- End diff --

Heh, sure - this was also just copied and pasted code (from 
cordova-browser), but sounds reasonable.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r32038377
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
--- End diff --

Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r32036336
  
--- Diff: cordova-serve/src/platform.js ---
@@ -0,0 +1,55 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var server = require('./server'),
+fs = require('fs'),
+util = require('./util');
+
+/**
+ * Launches a server where the root points to the specified platform in a 
Cordova project.
+ * @param {string} platform - Cordova platform to serve.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ *   root - cordova project directory, or any directory within it. If not 
specified, cwd is used. This will be modified to point to the platform's 
www_dir.
+ *   All other values are passed unaltered to launchServer().
+ * @returns {*|promise}
+ */
+module.exports = function (platform, opts) {
+if (!platform) {
+throw new Error('A platform must be specified');
+}
+
+opts.root = util.getPlatformWwwRoot(findProjectRoot(opts.root), 
platform);
--- End diff --

Fixed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r32036239
  
--- Diff: cordova-serve/src/platform.js ---
@@ -0,0 +1,55 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var server = require('./server'),
+fs = require('fs'),
+util = require('./util');
+
+/**
+ * Launches a server where the root points to the specified platform in a 
Cordova project.
+ * @param {string} platform - Cordova platform to serve.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ *   root - cordova project directory, or any directory within it. If not 
specified, cwd is used. This will be modified to point to the platform's 
www_dir.
+ *   All other values are passed unaltered to launchServer().
+ * @returns {*|promise}
+ */
+module.exports = function (platform, opts) {
+if (!platform) {
--- End diff --

Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r32035480
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
--- End diff --

Yeah, possibly. I might skip this one, however (this is just copied and 
pasted existing code, and I don't think this one is high enough priority).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: I have a critical issue for cordova.

2015-06-09 Thread Joe Bowser
This blog post indicates the versions of Cordova that address this
vulnerability.

https://cordova.apache.org/announcements/2015/05/26/android-402.html

There is an upgrade path to 3.7.x and 4.0.x users.

On Tue, Jun 9, 2015, 9:39 AM Chuck Lantz  wrote:

> BTW - The article you list provides potential signs of impact to your
> users.
>
> 1.Tamper app appearance
> 2.Inject popups and texts
> 3.Inject splash screens
> 4.Modify basic functionalities
> 5.Crash the app
>
> 3rd party plugins can also introduce vulnerabilities so the specifics will
> depend on your situation. Cordova apps in general are affected. You likely
> should consider upgrading to Cordova Android 3.7.2 (if using < 5.0.0) or
> 4.0.2 (if using Cordova 5.0.0+) given you likely have a security focused
> app.
>
> -Chuck
>
> -Original Message-
> From: Chuck Lantz [mailto:cla...@microsoft.com]
> Sent: Tuesday, June 9, 2015 9:07 AM
> To: dev@cordova.apache.org
> Subject: RE: I have a critical issue for cordova.
>
> It is a security risk that was identified but impact is not known.
>
> Fortunately there is a simple workaround.  See this article for how to fix
> this problem:
> https://github.com/Microsoft/cordova-docs/tree/master/tips-and-workarounds/android/security-05-26-2015
>
> -Chuck
>
> -Original Message-
> From: Domingo Oh [mailto:osys...@gmail.com]
> Sent: Monday, June 8, 2015 10:25 PM
> To: dev@cordova.apache.org
> Subject: I have a critical issue for cordova.
>
> Hello.
>
> I am Android Developer in Korea.
>
> I develop Android application for bank. before I used cordova.
>
> I saw column at last week. this -> http://goo.gl/ZOSzYw
>
>
> I receive a question for this issue. is it damage to our customer app?
>
>
> So I try 3days. I should find that damage to our customer app. But I can't
> find it. That's difficult.
>
>
> I use Cordova. Right. But I use not CordovaActivity. I throw question to
> this column(http://goo.gl/ZOSzYw) author. But he don't return to me. So I
> find other author. But he too. He don't return to me.
>
>
> Hey. I don't use CordovaActivity. is it damage for our app? Now I
> difficult upgrade to app. So I want certain message.
>
> please certain message for this issue.
>
> ps. I love Korean.
>
>
>
>
> Thank you. please fast return.
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
> For additional commands, e-mail: dev-h...@cordova.apache.org
>


RE: I have a critical issue for cordova.

2015-06-09 Thread Chuck Lantz
BTW - The article you list provides potential signs of impact to your users. 

1.Tamper app appearance
2.Inject popups and texts
3.Inject splash screens
4.Modify basic functionalities
5.Crash the app

3rd party plugins can also introduce vulnerabilities so the specifics will 
depend on your situation. Cordova apps in general are affected. You likely 
should consider upgrading to Cordova Android 3.7.2 (if using < 5.0.0) or 4.0.2 
(if using Cordova 5.0.0+) given you likely have a security focused app.

-Chuck

-Original Message-
From: Chuck Lantz [mailto:cla...@microsoft.com] 
Sent: Tuesday, June 9, 2015 9:07 AM
To: dev@cordova.apache.org
Subject: RE: I have a critical issue for cordova.

It is a security risk that was identified but impact is not known. 

Fortunately there is a simple workaround.  See this article for how to fix this 
problem:  
https://github.com/Microsoft/cordova-docs/tree/master/tips-and-workarounds/android/security-05-26-2015

-Chuck

-Original Message-
From: Domingo Oh [mailto:osys...@gmail.com] 
Sent: Monday, June 8, 2015 10:25 PM
To: dev@cordova.apache.org
Subject: I have a critical issue for cordova.

Hello.

I am Android Developer in Korea.

I develop Android application for bank. before I used cordova.

I saw column at last week. this -> http://goo.gl/ZOSzYw


I receive a question for this issue. is it damage to our customer app?


So I try 3days. I should find that damage to our customer app. But I can't find 
it. That's difficult.


I use Cordova. Right. But I use not CordovaActivity. I throw question to this 
column(http://goo.gl/ZOSzYw) author. But he don't return to me. So I find other 
author. But he too. He don't return to me.


Hey. I don't use CordovaActivity. is it damage for our app? Now I difficult 
upgrade to app. So I want certain message.

please certain message for this issue.

ps. I love Korean.




Thank you. please fast return.

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org


[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r32033238
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
+var mtime = fs.statSync(path).mtime,
+itime = request.headers['if-modified-since'];
+return !itime || new Date(mtime) > new Date(itime);
+}
+
+var urlPath = url.parse(request.url).pathname;
+
+var filePath;
+if (opts.urlPathProcessor) {
+var result = opts.urlPathProcessor(urlPath, request, response, 
do302, do404);
+if (!result) {
+return;
+}
+filePath = result.filePath;
+}
+if (!filePath) {
+if (!root) {
+throw new Error('No server root directory HAS BEEN 
specified!');
+}
+filePath = path.join(root, urlPath);
+}
+
+fs.exists(filePath, function (exists) {
--- End diff --

Yeah, good suggestion. It's not quite as simple as that, since a custom 
`urlPathProcessor()` might be provided but not want to process a particular 
path and fall back on default logic. I'll take a look, though, because I'm not 
happy with how this works currently (the logic of what `urlPathProcessor()` 
returns is too weird).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r32032618
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
+var mtime = fs.statSync(path).mtime,
+itime = request.headers['if-modified-since'];
+return !itime || new Date(mtime) > new Date(itime);
+}
+
+var urlPath = url.parse(request.url).pathname;
+
+var filePath;
+if (opts.urlPathProcessor) {
+var result = opts.urlPathProcessor(urlPath, request, response, 
do302, do404);
+if (!result) {
+return;
+}
+filePath = result.filePath;
+}
+if (!filePath) {
+if (!root) {
+throw new Error('No server root directory HAS BEEN 
specified!');
+}
+filePath = path.join(root, urlPath);
+}
+
+fs.exists(filePath, function (exists) {
+if (!exists) {
+do404();
+return;
+}
+if (fs.statSync(filePath).isDirectory()) {
+var index = path.join(filePath, 'index.html');
+try {
+if (fs.statSync(index)) {
--- End diff --

This was just copied and pasted code (from cordova-lib `serve` module), so 
not sure why :smile: ... Perhaps existsSync wasn't around at the time? I also 
thought I had fixed this in one of my iterations on this stuff. Guess not. Will 
fix it now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r32032235
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
+var mtime = fs.statSync(path).mtime,
+itime = request.headers['if-modified-since'];
+return !itime || new Date(mtime) > new Date(itime);
+}
+
+var urlPath = url.parse(request.url).pathname;
+
+var filePath;
+if (opts.urlPathProcessor) {
+var result = opts.urlPathProcessor(urlPath, request, response, 
do302, do404);
+if (!result) {
+return;
+}
+filePath = result.filePath;
+}
+if (!filePath) {
+if (!root) {
+throw new Error('No server root directory HAS BEEN 
specified!');
+}
+filePath = path.join(root, urlPath);
+}
+
+fs.exists(filePath, function (exists) {
+if (!exists) {
+do404();
+return;
+}
+if (fs.statSync(filePath).isDirectory()) {
+var index = path.join(filePath, 'index.html');
+try {
+if (fs.statSync(index)) {
+filePath = index;
+}
+} catch (e) {
+}
+}
+if (fs.statSync(filePath).isDirectory()) {
+if (!/\/$/.test(urlPath)) {
+do302(request.url + '/');
+return;
+}
+console.log('200 ' + request.url);
+response.writeHead(200, {'Content-Type': 'text/html'});
+response.write('Directory listing of ' 
+ urlPath + '');
+response.write('Items in this directory');
+response.write('');
+fs.readdirSync(filePath).forEach(function (file) {
+if (file) {
--- End diff --

Yeah, this was just copied and pasted code, but I'll fix it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---

[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread TimBarham
Github user TimBarham commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r32032171
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
+var mtime = fs.statSync(path).mtime,
+itime = request.headers['if-modified-since'];
+return !itime || new Date(mtime) > new Date(itime);
+}
+
+var urlPath = url.parse(request.url).pathname;
+
+var filePath;
+if (opts.urlPathProcessor) {
+var result = opts.urlPathProcessor(urlPath, request, response, 
do302, do404);
+if (!result) {
+return;
+}
+filePath = result.filePath;
+}
+if (!filePath) {
+if (!root) {
+throw new Error('No server root directory HAS BEEN 
specified!');
+}
+filePath = path.join(root, urlPath);
+}
+
+fs.exists(filePath, function (exists) {
+if (!exists) {
+do404();
+return;
+}
+if (fs.statSync(filePath).isDirectory()) {
+var index = path.join(filePath, 'index.html');
+try {
+if (fs.statSync(index)) {
+filePath = index;
+}
+} catch (e) {
+}
+}
+if (fs.statSync(filePath).isDirectory()) {
+if (!/\/$/.test(urlPath)) {
+do302(request.url + '/');
+return;
+}
+console.log('200 ' + request.url);
+response.writeHead(200, {'Content-Type': 'text/html'});
+response.write('Directory listing of ' 
+ urlPath + '');
+response.write('Items in this directory');
+response.write('');
+fs.readdirSync(filePath).forEach(function (file) {
+if (file) {
+response.write('' + 
file + '\n');
+}
+});
+
+response.write('');
+response.end();
+} else if (!isFileChanged(filePath)) {
+do304();
+} else {
+(opts.streamHandler && opts.streamHandler(filePath, 
request, response)) || stream(filePath, req

RE: I have a critical issue for cordova.

2015-06-09 Thread Chuck Lantz
It is a security risk that was identified but impact is not known. 

Fortunately there is a simple workaround.  See this article for how to fix this 
problem:  
https://github.com/Microsoft/cordova-docs/tree/master/tips-and-workarounds/android/security-05-26-2015

-Chuck

-Original Message-
From: Domingo Oh [mailto:osys...@gmail.com] 
Sent: Monday, June 8, 2015 10:25 PM
To: dev@cordova.apache.org
Subject: I have a critical issue for cordova.

Hello.

I am Android Developer in Korea.

I develop Android application for bank. before I used cordova.

I saw column at last week. this -> http://goo.gl/ZOSzYw


I receive a question for this issue. is it damage to our customer app?


So I try 3days. I should find that damage to our customer app. But I can't find 
it. That's difficult.


I use Cordova. Right. But I use not CordovaActivity. I throw question to this 
column(http://goo.gl/ZOSzYw) author. But he don't return to me. So I find other 
author. But he too. He don't return to me.


Hey. I don't use CordovaActivity. is it damage for our app? Now I difficult 
upgrade to app. So I want certain message.

please certain message for this issue.

ps. I love Korean.




Thank you. please fast return.

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org


[GitHub] cordova-lib pull request: CB-5578 Adds `clean` module to cordova

2015-06-09 Thread nikhilkh
Github user nikhilkh commented on the pull request:

https://github.com/apache/cordova-lib/pull/241#issuecomment-110411187
  
Good change! LGTM overall! let's get it in!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-android pull request: CB-9135 fix the vulnerability bug

2015-06-09 Thread nikhilkh
Github user nikhilkh commented on the pull request:

https://github.com/apache/cordova-android/pull/181#issuecomment-110408308
  
@infil00p Can you please help review?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-android pull request: CB-9119 Fixing intermittent 'adb ins...

2015-06-09 Thread nikhilkh
Github user nikhilkh commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/180#discussion_r32027602
  
--- Diff: bin/templates/cordova/lib/retry.js ---
@@ -0,0 +1,63 @@
+#!/usr/bin/env node
+
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+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
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+/* jshint node: true */
+
+"use strict";
+
+/*
+ * Retry a promise-returning function attemts_left times, propagating its
+ * results on success or throwing its error on a failed final attempt.
+ *
+ * Takes a number of attempts, a promise-returning function, and all its
+ * arguments (as trailing arguments).
+ */
+module.exports.retryPromise = function (attemts_left, promiseFunction) {
+
+// NOTE:
+//  get all trailing arguments, by skipping the first two 
(attemts_left and
+//  promiseFunction) because they shouldn't get passed to 
promiseFunction
+var promiseFunctionArguments = Array.prototype.slice.call(arguments, 
2);
+
+return promiseFunction.apply(undefined, promiseFunctionArguments).then(
+
+// on success pass results through
+function onFulfilled(value) {
+return value;
+},
+
+// on rejection either retry, or throw the error
+function onRejected(error) {
+
+attemts_left -= 1;
+
+if (attemts_left < 1) {
+throw error;
+}
+
+console.log("call failed; retrying " + attemts_left + " more 
time(s)");
--- End diff --

There is no unified way to do verbose logging - every platform & 
cordova-lib does it a little bit differently. I have not seen any code in 
Android platform doing it altogether. If you decide to keep these messages, 
consider reformatting.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-android pull request: CB-9119 Fixing intermittent 'adb ins...

2015-06-09 Thread nikhilkh
Github user nikhilkh commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/180#discussion_r32027248
  
--- Diff: bin/templates/cordova/lib/emulator.js ---
@@ -298,37 +306,67 @@ module.exports.resolveTarget = function(target) {
  * If no started emulators are found, error out.
  * Returns a promise.
  */
-module.exports.install = function(target, buildResults) {
-return Q().then(function() {
-if (target && typeof target == 'object') {
-return target;
+module.exports.install = function(givenTarget, buildResults) {
+
+var target;
+
+// resolve the target emulator
+return Q().then(function () {
+if (givenTarget && typeof givenTarget == 'object') {
+return givenTarget;
+} else {
+return module.exports.resolveTarget(givenTarget);
 }
-return module.exports.resolveTarget(target);
-}).then(function(resolvedTarget) {
-var apk_path = build.findBestApkForArchitecture(buildResults, 
resolvedTarget.arch);
+
+// set the resolved target
+}).then(function (resolvedTarget) {
+target = resolvedTarget;
+
+// install the app
+}).then(function () {
+
+var apk_path= build.findBestApkForArchitecture(buildResults, 
target.arch);
+var execOptions = {
+timeout:INSTALL_COMMAND_TIMEOUT, // in milliseconds
+killSignal: EXEC_KILL_SIGNAL
+};
+
 console.log('Installing app on emulator...');
 console.log('Using apk: ' + apk_path);
-return exec('adb -s ' + resolvedTarget.target + ' install -r -d "' 
+ apk_path + '"', os.tmpdir())
-.then(function(output) {
+
+var retriedInstall = retry.retryPromise(
+NUM_INSTALL_RETRIES,
+exec, 'adb -s ' + target.target + ' install -r -d "' + 
apk_path + '"', os.tmpdir(), execOptions
+);
+
+return retriedInstall.then(function (output) {
 if (output.match(/Failure/)) {
 return Q.reject('Failed to install apk to emulator: ' + 
output);
+} else {
+console.log('INSTALL SUCCESS');
 }
-return Q();
-}, function(err) {
+}, function (err) {
 return Q.reject('Failed to install apk to emulator: ' + err);
-}).then(function() {
-//unlock screen
-return exec('adb -s ' + resolvedTarget.target + ' shell input 
keyevent 82', os.tmpdir());
-}).then(function() {
-// launch the application
-console.log('Launching application...');
-var launchName = appinfo.getActivityName();
-var cmd = 'adb -s ' + resolvedTarget.target + ' shell am start 
-W -a android.intent.action.MAIN -n ' + launchName;
-return exec(cmd, os.tmpdir());
-}).then(function(output) {
-console.log('LAUNCH SUCCESS');
-}, function(err) {
-return Q.reject('Failed to launch app on emulator: ' + err);
 });
+
+// unlock screen
+}).then(function () {
+
+console.log('Unlocking screen...');
+return exec('adb -s ' + target.target + ' shell input keyevent 
82', os.tmpdir());
+
+// launch the application
--- End diff --

The comment should be added when the console log gets removed in that case. 
Following the DRY principle - Don't Repeat Yourself.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-android pull request: CB-9119 Fixing intermittent 'adb ins...

2015-06-09 Thread nikhilkh
Github user nikhilkh commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/180#discussion_r32027291
  
--- Diff: bin/templates/cordova/lib/exec.js ---
@@ -19,16 +19,42 @@
under the License.
 */
 
-var child_process = require('child_process'),
-Q   = require('q');
+var child_process = require('child_process');
+var Q = require('q');
+
+// constants
+var DEFAULT_MAX_BUFFER = 1024000;
 
 // Takes a command and optional current working directory.
 // Returns a promise that either resolves with the stdout, or
 // rejects with an error message and the stderr.
-module.exports = function(cmd, opt_cwd) {
+//
+// WARNING:
+// opt_cwd is an artifact of an old design, and must
+// be removed in the future; the correct solution is
+// to pass the options object the same way that
+// child_process.exec expects
+//
+// NOTE:
+//  exec documented here - 
https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
+module.exports = function(cmd, opt_cwd, options) {
+
 var d = Q.defer();
+
+if (options === undefined) {
+options = {};
--- End diff --

Makes sense. I see that now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-android pull request: CB-9119 Fixing intermittent 'adb ins...

2015-06-09 Thread nikhilkh
Github user nikhilkh commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/180#discussion_r32027163
  
--- Diff: bin/templates/cordova/lib/exec.js ---
@@ -19,16 +19,42 @@
under the License.
 */
 
-var child_process = require('child_process'),
-Q   = require('q');
+var child_process = require('child_process');
+var Q = require('q');
+
+// constants
+var DEFAULT_MAX_BUFFER = 1024000;
 
 // Takes a command and optional current working directory.
 // Returns a promise that either resolves with the stdout, or
 // rejects with an error message and the stderr.
-module.exports = function(cmd, opt_cwd) {
+//
+// WARNING:
+// opt_cwd is an artifact of an old design, and must
+// be removed in the future; the correct solution is
+// to pass the options object the same way that
+// child_process.exec expects
+//
+// NOTE:
+//  exec documented here - 
https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
+module.exports = function(cmd, opt_cwd, options) {
+
 var d = Q.defer();
+
+if (options === undefined) {
+options = {};
+}
+
+// override cwd to preserve old opt_cwd behavior
+options.cwd = opt_cwd;
+
+// set maxBuffer
+if (options.maxBuffer === undefined) {
--- End diff --

Comparing to undefined is a bad practice: 
http://stackoverflow.com/questions/27509/detecting-an-undefined-object-property



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



I have a critical issue for cordova.

2015-06-09 Thread Domingo Oh
Hello.

I am Android Developer in Korea.

I develop Android application for bank. before I used cordova.

I saw column at last week. this -> http://goo.gl/ZOSzYw


I receive a question for this issue. is it damage to our customer app?


So I try 3days. I should find that damage to our customer app. But I can't
find it. That's difficult.


I use Cordova. Right. But I use not CordovaActivity. I throw question to
this column(http://goo.gl/ZOSzYw) author. But he don't return to me. So I
find other author. But he too. He don't return to me.


Hey. I don't use CordovaActivity. is it damage for our app? Now I difficult
upgrade to app. So I want certain message.

please certain message for this issue.

ps. I love Korean.




Thank you. please fast return.


[GitHub] cordova-ios pull request: CB-9116 Ensure platform scripts are exec...

2015-06-09 Thread daserge
Github user daserge commented on the pull request:

https://github.com/apache/cordova-ios/pull/144#issuecomment-110401243
  
Closing this - decided to rewrite the scripts in node.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-ios pull request: CB-9116 Ensure platform scripts are exec...

2015-06-09 Thread daserge
Github user daserge closed the pull request at:

https://github.com/apache/cordova-ios/pull/144


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-5578 Adds `clean` module to cordova

2015-06-09 Thread vladimir-kotikov
GitHub user vladimir-kotikov opened a pull request:

https://github.com/apache/cordova-lib/pull/241

CB-5578 Adds `clean` module to cordova

This is an implementation for 
[CB-5578](https://issues.apache.org/jira/browse/CB-5578)
Corresponding CLI changes is here: 
https://github.com/apache/cordova-cli/pull/216

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MSOpenTech/cordova-lib CB-5578

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-lib/pull/241.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #241


commit 9d1b3b4683af06e3c71f3b5ece94824809782887
Author: Vladimir Kotikov 
Date:   2015-06-09T14:10:00Z

CB-5578 Adds `clean` module to cordova




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-cli pull request: CB-5578 Adds `clean` command to cordova-...

2015-06-09 Thread vladimir-kotikov
GitHub user vladimir-kotikov opened a pull request:

https://github.com/apache/cordova-cli/pull/216

CB-5578 Adds `clean` command to cordova-cli



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MSOpenTech/cordova-cli CB-5578

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-cli/pull/216.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #216


commit fbc241b8083a0005cb154668d5ad3b28782ae60c
Author: Vladimir Kotikov 
Date:   2015-06-09T13:41:08Z

CB-5578 Adds `clean` command to cordova-cli




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



Re: Sticky Channels

2015-06-09 Thread Ian Clelland
On Tue, Jun 9, 2015 at 10:19 AM, Andrew Grieve  wrote:

> I think the only place sticky channels are used is for startup events
> (deviceready, nativeready, pluginsready, etc). I think you could probably
> change them to fire multiple times without breaking too much, but the
> semantics of that seem really strange to me (fire the most recent event, or
> all events? upon registering, but only to the newly added listener(s))
>
> They are not based on any standard, so it might be nice not to use them,
> and instead use standard events (e.g. cordova.fireWindowEvent). As long as
> we promise not to fire them until after deviceready, apps should be able to
> register listeners reliably.
>

This was an area that I was hoping to leverage to use promises instead,
back when we were discussing baking those into cordova.js -- it would be a
major change from the existing way of doing things, but sticky channels are
closer in spirit to promises than they are to events, I think.

It's very similar to the service worker `ready` attribute -- before the
worker is active, it returns a promise that asynchronously waits for
everything to be ready, and then fires. After the worker is already active,
the promise resolves immediately, just like deviceready does if you attach
a listener after Cordova has initialized.


>
> One other data point for this is that I dealt with the as-a-service vs.
> as-a-launch in
> https://github.com/MobileChromeApps/cordova-plugin-background-app. In this
> model, I set a property before each resume / deviceready that can be
> queried to find out the app's state. Could possibly do similar for intents
> (but would need an event as well since they can come at any time, not just
> on start-up)
>
> On Fri, Jun 5, 2015 at 7:18 PM, Jesse  wrote:
>
> > I have been looking into unifying launchParameters across devices so that
> > all cordova apps can get some context of how they were
> launched/activated.
> > This includes everything from a url/protocol launch in another app, to a
> > touch on a notification (toast,local,push,... )
> >
> > My intent was to add a channel for this, however I have had some issues
> > with channels + stickiness.
> >
> > I wanted a channel that would call new subscribers immediately if it had
> > already fired.  In our channel implementation this is what we call a
> sticky
> > channel.  However, this particular channel may fire more than once, ie.
> we
> > could be activated multiple times while running, or receive multiple
> > notifications.
> > The current implementation for sticky will only ever call subscribers
> once,
> > and if I call fire() more than once, it actually removes it's
> subscribers.
> > [1] So I cannot use this as is for my needs.
> >
> > So my questions are :
> > 1. Why is like this? Is there some standard or expectation that this is
> > based on?
> > 2. Can I change it? What would be the impact of changing the behavior to
> > have a sticky channel fire more than once, and keep its list of
> > subscribers?
> > 3. Are there historical reasons that things are the way they are? The
> code
> > has been through several major moves since it was written, so it is
> > difficult to pin the original commit (Fil, Andrew? some merged pr?)  If
> > there are historical reasons, are they still relevant?
> >
> > Please keep in mind too that I am not asking for the solution to my
> > specific task, I can work around anything ... I am asking solely about
> the
> > current channel-sticky implementation and it we should change it.
> >
> > Cheers,
> >   Jesse
> >
> >
> > The current implementation
> > [1]
> >
> https://github.com/apache/cordova-js/blob/master/src/common/channel.js#L216
> >
> >
> > @purplecabbage
> > risingj.com
> >
>


Re: Sticky Channels

2015-06-09 Thread Andrew Grieve
I think the only place sticky channels are used is for startup events
(deviceready, nativeready, pluginsready, etc). I think you could probably
change them to fire multiple times without breaking too much, but the
semantics of that seem really strange to me (fire the most recent event, or
all events? upon registering, but only to the newly added listener(s))

They are not based on any standard, so it might be nice not to use them,
and instead use standard events (e.g. cordova.fireWindowEvent). As long as
we promise not to fire them until after deviceready, apps should be able to
register listeners reliably.

One other data point for this is that I dealt with the as-a-service vs.
as-a-launch in
https://github.com/MobileChromeApps/cordova-plugin-background-app. In this
model, I set a property before each resume / deviceready that can be
queried to find out the app's state. Could possibly do similar for intents
(but would need an event as well since they can come at any time, not just
on start-up)

On Fri, Jun 5, 2015 at 7:18 PM, Jesse  wrote:

> I have been looking into unifying launchParameters across devices so that
> all cordova apps can get some context of how they were launched/activated.
> This includes everything from a url/protocol launch in another app, to a
> touch on a notification (toast,local,push,... )
>
> My intent was to add a channel for this, however I have had some issues
> with channels + stickiness.
>
> I wanted a channel that would call new subscribers immediately if it had
> already fired.  In our channel implementation this is what we call a sticky
> channel.  However, this particular channel may fire more than once, ie. we
> could be activated multiple times while running, or receive multiple
> notifications.
> The current implementation for sticky will only ever call subscribers once,
> and if I call fire() more than once, it actually removes it's subscribers.
> [1] So I cannot use this as is for my needs.
>
> So my questions are :
> 1. Why is like this? Is there some standard or expectation that this is
> based on?
> 2. Can I change it? What would be the impact of changing the behavior to
> have a sticky channel fire more than once, and keep its list of
> subscribers?
> 3. Are there historical reasons that things are the way they are? The code
> has been through several major moves since it was written, so it is
> difficult to pin the original commit (Fil, Andrew? some merged pr?)  If
> there are historical reasons, are they still relevant?
>
> Please keep in mind too that I am not asking for the solution to my
> specific task, I can work around anything ... I am asking solely about the
> current channel-sticky implementation and it we should change it.
>
> Cheers,
>   Jesse
>
>
> The current implementation
> [1]
> https://github.com/apache/cordova-js/blob/master/src/common/channel.js#L216
>
>
> @purplecabbage
> risingj.com
>


[GitHub] cordova-plugin-file-transfer pull request: Prevent Fatal Exception...

2015-06-09 Thread winstef
Github user winstef commented on the pull request:


https://github.com/apache/cordova-plugin-file-transfer/pull/79#issuecomment-110347248
  
Thanks for this fix. I also had the same issue every time I would call 
abort() the app crashed. I'm using a S5 on Android 5.0.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-js pull request: CB-9137 Fixes cordova-lib tests failures

2015-06-09 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cordova-js/pull/116


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-js pull request: CB-9137 Fixes cordova-lib tests failures

2015-06-09 Thread vladimir-kotikov
GitHub user vladimir-kotikov opened a pull request:

https://github.com/apache/cordova-js/pull/116

CB-9137 Fixes cordova-lib tests failures

This fixes cordova-lib tests failures in Windows environment. See 
[CB-9137](https://issues.apache.org/jira/browse/CB-9137).

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/MSOpenTech/cordova-js CB-9137

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-js/pull/116.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #116


commit 7d369f3299b3fb88165af3f1306e28973a799e5e
Author: Vladimir Kotikov 
Date:   2015-06-09T11:58:29Z

CB-9137 Fixes cordova-lib tests failures




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-android pull request: CB-9135 fix the vulnerability bug

2015-06-09 Thread NoLongerLazyDhl
GitHub user NoLongerLazyDhl opened a pull request:

https://github.com/apache/cordova-android/pull/181

CB-9135 fix the vulnerability bug

This is fixed in 4.0.x, but not in 3.7.x. The property 
"LoadUrlTimeoutValue" still gets its value from intent not from configuration 
file. This commit will fix this bug.  

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/NoLongerLazyDhl/cordova-android 3.7.x

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-android/pull/181.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #181


commit 1b79f37951d959d1db2e24ba2d4513a608d034f1
Author: caoyr 
Date:   2015-06-09T09:07:56Z

CB-9135 fix the vulnerability bug




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9124 Makes network-related error mess...

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov closed the pull request at:

https://github.com/apache/cordova-lib/pull/240


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9124 Makes network-related error mess...

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov commented on the pull request:

https://github.com/apache/cordova-lib/pull/240#issuecomment-110284418
  
This has been merged in 
https://github.com/apache/cordova-lib/commit/c3485e21412bbc73711cc6bd32a93a7ee2a1fe1f.
 Closing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9124 Makes network-related error mess...

2015-06-09 Thread sgrebnov
Github user sgrebnov commented on the pull request:

https://github.com/apache/cordova-lib/pull/240#issuecomment-110283764
  
lgtm :+1: 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r31992378
  
--- Diff: cordova-serve/src/browser.js ---
@@ -0,0 +1,100 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var exec = require('./exec'),
+Q = require('q');
+
+/**
+ * Launches the specified browser with the given URL.
+ * Based on https://github.com/domenic/opener
+ * @param {{target: ?string, url: ?string, dataDir: ?string}} opts - 
parameters:
+ *   target - the target browser - ie, chrome, safari, opera, firefox or 
chromium
+ *   url - the url to open in the browser
+ *   dataDir - a data dir to provide to Chrome (can be used to force it to 
open in a new window)
+ * @return {Q} Promise to launch the specified browser
+ */
+module.exports = function (opts) {
+//target, url, dataDir
+var target = opts.target || 'chrome';
+var url = opts.url || '';
+
+return mapTarget(target, opts.dataDir).then(function (browser) {
--- End diff --

nit: it might sounds better if the function is called `getBrowser`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r31992102
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
--- End diff --

IMO `urlPathProcessor`, `serverExtender` and `streamHandler` deserves 
additional description.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r31991606
  
--- Diff: cordova-serve/src/platform.js ---
@@ -0,0 +1,55 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var server = require('./server'),
+fs = require('fs'),
+util = require('./util');
+
+/**
+ * Launches a server where the root points to the specified platform in a 
Cordova project.
+ * @param {string} platform - Cordova platform to serve.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ *   root - cordova project directory, or any directory within it. If not 
specified, cwd is used. This will be modified to point to the platform's 
www_dir.
+ *   All other values are passed unaltered to launchServer().
+ * @returns {*|promise}
+ */
+module.exports = function (platform, opts) {
+if (!platform) {
+throw new Error('A platform must be specified');
+}
+
+opts.root = util.getPlatformWwwRoot(findProjectRoot(opts.root), 
platform);
--- End diff --

`opts` can be `undefined`, so accessing `opts.root` will throw.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r31991342
  
--- Diff: cordova-serve/src/platform.js ---
@@ -0,0 +1,55 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var server = require('./server'),
+fs = require('fs'),
+util = require('./util');
+
+/**
+ * Launches a server where the root points to the specified platform in a 
Cordova project.
+ * @param {string} platform - Cordova platform to serve.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ *   root - cordova project directory, or any directory within it. If not 
specified, cwd is used. This will be modified to point to the platform's 
www_dir.
+ *   All other values are passed unaltered to launchServer().
+ * @returns {*|promise}
+ */
+module.exports = function (platform, opts) {
+if (!platform) {
--- End diff --

It would be better to wrap function into `Q.when()` to return a promise 
even if error is thrown. Otherwise you'll need to wrap this code into 
`try...catch` in caller code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r31991045
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
+var mtime = fs.statSync(path).mtime,
+itime = request.headers['if-modified-since'];
+return !itime || new Date(mtime) > new Date(itime);
+}
+
+var urlPath = url.parse(request.url).pathname;
+
+var filePath;
+if (opts.urlPathProcessor) {
+var result = opts.urlPathProcessor(urlPath, request, response, 
do302, do404);
+if (!result) {
+return;
+}
+filePath = result.filePath;
+}
+if (!filePath) {
+if (!root) {
+throw new Error('No server root directory HAS BEEN 
specified!');
+}
+filePath = path.join(root, urlPath);
+}
+
+fs.exists(filePath, function (exists) {
--- End diff --

The logic below will look better if factored into `defaultUrlProcessor`, so 
you can do something like
```javascript
var urlProcessor = opts.urlPathProcessor || defaultUrlProcessor;
var result = urlProcessor(urlPath, request, response, do302, do404);
```
in [line 
69](https://github.com/apache/cordova-lib/pull/238/files#diff-28759fa7c601ddb3ffab33e34a6587d2R69)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r31990983
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
+var mtime = fs.statSync(path).mtime,
+itime = request.headers['if-modified-since'];
+return !itime || new Date(mtime) > new Date(itime);
+}
+
+var urlPath = url.parse(request.url).pathname;
+
+var filePath;
+if (opts.urlPathProcessor) {
+var result = opts.urlPathProcessor(urlPath, request, response, 
do302, do404);
+if (!result) {
+return;
+}
+filePath = result.filePath;
+}
+if (!filePath) {
+if (!root) {
+throw new Error('No server root directory HAS BEEN 
specified!');
+}
+filePath = path.join(root, urlPath);
+}
+
+fs.exists(filePath, function (exists) {
+if (!exists) {
+do404();
+return;
+}
+if (fs.statSync(filePath).isDirectory()) {
+var index = path.join(filePath, 'index.html');
+try {
+if (fs.statSync(index)) {
--- End diff --

Why `try...catch` instead of just `fs.existSync`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r31990871
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
+var mtime = fs.statSync(path).mtime,
+itime = request.headers['if-modified-since'];
+return !itime || new Date(mtime) > new Date(itime);
+}
+
+var urlPath = url.parse(request.url).pathname;
+
+var filePath;
+if (opts.urlPathProcessor) {
+var result = opts.urlPathProcessor(urlPath, request, response, 
do302, do404);
+if (!result) {
+return;
+}
+filePath = result.filePath;
+}
+if (!filePath) {
+if (!root) {
+throw new Error('No server root directory HAS BEEN 
specified!');
+}
+filePath = path.join(root, urlPath);
+}
+
+fs.exists(filePath, function (exists) {
+if (!exists) {
+do404();
+return;
+}
+if (fs.statSync(filePath).isDirectory()) {
+var index = path.join(filePath, 'index.html');
+try {
+if (fs.statSync(index)) {
+filePath = index;
+}
+} catch (e) {
+}
+}
+if (fs.statSync(filePath).isDirectory()) {
+if (!/\/$/.test(urlPath)) {
+do302(request.url + '/');
+return;
+}
+console.log('200 ' + request.url);
+response.writeHead(200, {'Content-Type': 'text/html'});
+response.write('Directory listing of ' 
+ urlPath + '');
+response.write('Items in this directory');
+response.write('');
+fs.readdirSync(filePath).forEach(function (file) {
+if (file) {
--- End diff --

This is always `true`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

--

[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r31990672
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
+var mtime = fs.statSync(path).mtime,
+itime = request.headers['if-modified-since'];
+return !itime || new Date(mtime) > new Date(itime);
+}
+
+var urlPath = url.parse(request.url).pathname;
+
+var filePath;
+if (opts.urlPathProcessor) {
+var result = opts.urlPathProcessor(urlPath, request, response, 
do302, do404);
+if (!result) {
+return;
+}
+filePath = result.filePath;
+}
+if (!filePath) {
+if (!root) {
+throw new Error('No server root directory HAS BEEN 
specified!');
+}
+filePath = path.join(root, urlPath);
+}
+
+fs.exists(filePath, function (exists) {
+if (!exists) {
+do404();
+return;
+}
+if (fs.statSync(filePath).isDirectory()) {
+var index = path.join(filePath, 'index.html');
+try {
+if (fs.statSync(index)) {
+filePath = index;
+}
+} catch (e) {
+}
+}
+if (fs.statSync(filePath).isDirectory()) {
+if (!/\/$/.test(urlPath)) {
+do302(request.url + '/');
+return;
+}
+console.log('200 ' + request.url);
+response.writeHead(200, {'Content-Type': 'text/html'});
+response.write('Directory listing of ' 
+ urlPath + '');
+response.write('Items in this directory');
+response.write('');
+fs.readdirSync(filePath).forEach(function (file) {
+if (file) {
+response.write('' + 
file + '\n');
+}
+});
+
+response.write('');
+response.end();
+} else if (!isFileChanged(filePath)) {
+do304();
+} else {
+(opts.streamHandler && opts.streamHandler(filePath, 
request, response)) || stream(filePa

[GitHub] cordova-lib pull request: CB-9127 Implements cordova-serve module.

2015-06-09 Thread vladimir-kotikov
Github user vladimir-kotikov commented on a diff in the pull request:

https://github.com/apache/cordova-lib/pull/238#discussion_r31989785
  
--- Diff: cordova-serve/src/server.js ---
@@ -0,0 +1,137 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ 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
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+var fs = require('fs'),
+http   = require('http'),
+url= require('url'),
+path   = require('path'),
+Q  = require('q'),
+stream = require('./stream');
+
+/**
+ * @desc Launches a server with the specified options and optional custom 
handlers.
+ * @param {{root: ?string, port: ?number, urlPathProcessor: ?function, 
streamHandler: ?function, serverExtender: ?function}} opts
+ * @returns {*|promise}
+ */
+module.exports = function (opts) {
+var deferred = Q.defer();
+
+var root = opts.root;
+var port = opts.port || 8000;
+
+var server = http.createServer(function (request, response) {
+function do404() {
+console.log('404 ' + request.url);
+response.writeHead(404, {'Content-Type': 'text/plain'});
+response.write('404 Not Found\n');
+response.end();
+}
+
+function do302(where) {
+console.log('302 ' + request.url);
+response.setHeader('Location', where);
+response.writeHead(302, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function do304() {
+console.log('304 ' + request.url);
+response.writeHead(304, {'Content-Type': 'text/plain'});
+response.end();
+}
+
+function isFileChanged(path) {
--- End diff --

IMO this is a good candidate to factor out to `./util` module with 
signature `function isFileChanged(path, modifiedSince) {}`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org



RE: [VOTE] Tools Release June 4th

2015-06-09 Thread Sergey Grebnov (Akvelon)
I vote +1:

* Manually verified blank app could be created, built and run (Windows and 
Android)
* Run mobilespec autotests on Windows and Android

Sergey Grebnov

-Original Message-
From: Vladimir Kotikov (Akvelon) [mailto:v-vlk...@microsoft.com] 
Sent: Tuesday, June 9, 2015 10:28 AM
To: dev@cordova.apache.org
Subject: RE: [VOTE] Tools Release June 4th

I vote +1

* Verified tags
* Verified signatures
* Ability to install/uninstall Cordova
* Ability to update Cordova
* Ability to create blank app for Windows, WP8, Android
* Ability to run apps

---
Best regards, Vladimir

-Original Message-
From: Steven Gill [mailto:stevengil...@gmail.com]
Sent: Tuesday, 9 June, 2015 3:24
To: dev@cordova.apache.org
Subject: Re: [VOTE] Tools Release June 4th

Need one more +1

On Mon, Jun 8, 2015 at 10:51 AM, Tim Barham 
wrote:

> I vote +1
>
> Verified:
> * cordova verify-tags (note this failed for cordova-lib as my origin 
> is github which still shows 5.1.1 tag on ffb02197e9, but I verified 
> manually on apache.org).
> * cordova audit-license-headers.
> * Verified builds are green.
> * Created and ran blank app on Android and Windows.
>
> -Original Message-
> From: Steven Gill [mailto:stevengil...@gmail.com]
> Sent: Thursday, June 4, 2015 4:59 PM
> To: dev@cordova.apache.org
> Subject: Re: [VOTE] Tools Release June 4th
>
> Updated: cordova-lib: 5.1.1 (83cc078229)
>
> On Thu, Jun 4, 2015 at 11:20 AM, Steven Gill 
> wrote:
>
> > Please review and vote on this Tools Release by replying to this 
> > email (and keep discussion on the DISCUSS thread)
> >
> > Release issue: https://issues.apache.org/jira/browse/CB-9087
> >
> > Both tools have been published to
> > dist/dev:https://dist.apache.org/repos/dist/dev/cordova/CB-9087/
> >
> > The packages were published from their corresponding git tags:
> >
> > cordova-js: 4.0.0 (706c4a8936)
> > cordova-lib: 5.1.1 (ffb02197e9)
> > cordova-plugman: 0.23.3 (45dd80134a)
> > cordova-cli: 5.1.1 (f15612cb8c)
> >
> > RELEASENOTES:
> >
> > cordova-js:
> https://github.com/apache/cordova-js/blob/4.0.x/RELEASENOTES.md
> > cordova-lib:
> https://github.com/apache/cordova-lib/blob/5.1.x/cordova-lib/RELEASENO
> TES.md
> > cordova-plugman:
> https://github.com/apache/cordova-plugman/blob/0.23.x/RELEASENOTES.md
> > cordova-cli:
> > https://github.com/apache/cordova-cli/blob/5.1.x/RELEASENOTES.md
> >
> > Upon a successful vote I will upload the archives to dist/, publish 
> > them
> to NPM, and post the corresponding blog post.
> > Voting guidelines:
> > https://github.com/apache/cordova-coho/blob/master/docs/release-voti
> > ng .md Voting will go on for a minimum of 48 hours.
> >
> > I vote +1:
> > * Ran coho audit-license-headers over the relevant repos
> > * Ran unit tests and saw that they were all building
> > * Build a cordova project for ios and android and added a plugin.
> >
> >
>


RE: [VOTE] Tools Release June 4th

2015-06-09 Thread Vladimir Kotikov (Akvelon)
I vote +1

* Verified tags
* Verified signatures
* Ability to install/uninstall Cordova
* Ability to update Cordova
* Ability to create blank app for Windows, WP8, Android
* Ability to run apps

---
Best regards, Vladimir

-Original Message-
From: Steven Gill [mailto:stevengil...@gmail.com] 
Sent: Tuesday, 9 June, 2015 3:24
To: dev@cordova.apache.org
Subject: Re: [VOTE] Tools Release June 4th

Need one more +1

On Mon, Jun 8, 2015 at 10:51 AM, Tim Barham 
wrote:

> I vote +1
>
> Verified:
> * cordova verify-tags (note this failed for cordova-lib as my origin 
> is github which still shows 5.1.1 tag on ffb02197e9, but I verified 
> manually on apache.org).
> * cordova audit-license-headers.
> * Verified builds are green.
> * Created and ran blank app on Android and Windows.
>
> -Original Message-
> From: Steven Gill [mailto:stevengil...@gmail.com]
> Sent: Thursday, June 4, 2015 4:59 PM
> To: dev@cordova.apache.org
> Subject: Re: [VOTE] Tools Release June 4th
>
> Updated: cordova-lib: 5.1.1 (83cc078229)
>
> On Thu, Jun 4, 2015 at 11:20 AM, Steven Gill 
> wrote:
>
> > Please review and vote on this Tools Release by replying to this 
> > email (and keep discussion on the DISCUSS thread)
> >
> > Release issue: https://issues.apache.org/jira/browse/CB-9087
> >
> > Both tools have been published to
> > dist/dev:https://dist.apache.org/repos/dist/dev/cordova/CB-9087/
> >
> > The packages were published from their corresponding git tags:
> >
> > cordova-js: 4.0.0 (706c4a8936)
> > cordova-lib: 5.1.1 (ffb02197e9)
> > cordova-plugman: 0.23.3 (45dd80134a)
> > cordova-cli: 5.1.1 (f15612cb8c)
> >
> > RELEASENOTES:
> >
> > cordova-js:
> https://github.com/apache/cordova-js/blob/4.0.x/RELEASENOTES.md
> > cordova-lib:
> https://github.com/apache/cordova-lib/blob/5.1.x/cordova-lib/RELEASENO
> TES.md
> > cordova-plugman:
> https://github.com/apache/cordova-plugman/blob/0.23.x/RELEASENOTES.md
> > cordova-cli:
> > https://github.com/apache/cordova-cli/blob/5.1.x/RELEASENOTES.md
> >
> > Upon a successful vote I will upload the archives to dist/, publish 
> > them
> to NPM, and post the corresponding blog post.
> > Voting guidelines:
> > https://github.com/apache/cordova-coho/blob/master/docs/release-voti
> > ng .md Voting will go on for a minimum of 48 hours.
> >
> > I vote +1:
> > * Ran coho audit-license-headers over the relevant repos
> > * Ran unit tests and saw that they were all building
> > * Build a cordova project for ios and android and added a plugin.
> >
> >
>