run_loop 0.1.0.pre7 → 0.1.0.pre8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f1aa1bf39411877482d2ca079fbd8e96747e431
4
- data.tar.gz: baf35e919dce4c6324cb6f282cce54e9d7c0d889
3
+ metadata.gz: 945e26c746021ba0f31cfcc092b20f279ce2d535
4
+ data.tar.gz: 3950184ea0e337f1c172a083886c04ae6e5b4783
5
5
  SHA512:
6
- metadata.gz: ec68e7fa940bef32781762f85fbeaf7bc915394e20b7ece3e83b06ca5bddc46d16fb922c1bdbcda0afd9c0f834e7919e6a3ad5756d587855514589f591bd6ddf
7
- data.tar.gz: 8ee7716edf4f0bb09561100f41dfde7e5e69aaba8b512ee6dd134d42da9e26da1460c8857f39a4272e989496cd97bc52700458f5b2b2a907eac5021ee1384d0e
6
+ metadata.gz: 43171f1961e4c498d63cf00a7acf150b15df5f9b59314c443224da22d9cd42e58cf072153834b530fc5aa52e11a930e288b836b2a13677d93b47207f1de0c824
7
+ data.tar.gz: 9ff4f9c9818dcfd64309c424c36de1f47a0b0c015b612a10d96e21cb1637f7a89319963f6fe68197c445344b255abd704da116dca60c3a09f1148e438c017f53
@@ -1,3 +1,3 @@
1
1
  module RunLoop
2
- VERSION = '0.1.0.pre7'
2
+ VERSION = '0.1.0.pre8'
3
3
  end
@@ -298,7 +298,20 @@ var target = null,
298
298
  return val;
299
299
  },
300
300
  _response = function(response) {
301
- target.frontMostApp().setPreferencesValueForKey(_sanitize(response), __calabashResponse);
301
+ var sanitized = _sanitize(response),
302
+ i = 0,
303
+ MAX_TRIES=30,
304
+ res;
305
+ target.frontMostApp().setPreferencesValueForKey(sanitized, __calabashResponse);
306
+
307
+ for (i=0; i<MAX_TRIES; i+=1) {
308
+ res = target.frontMostApp().preferencesValueForKey(__calabashResponse);
309
+ if (res && res['index'] == sanitized['index']) {
310
+ return;
311
+ }
312
+ }
313
+ throw new Error("Unable to write to preferences");
314
+
302
315
  },
303
316
  _success = function(result,index) {
304
317
 
@@ -336,7 +349,7 @@ while (true) {
336
349
  if (!isNaN(_actualIndex) && _actualIndex >= _expectedIndex) {
337
350
  _exp = preferences['command'];
338
351
  UIALogger.logMessage("index " + _actualIndex + " is command: "+ _exp);
339
- target.frontMostApp().setPreferencesValueForKey(null, __calabashRequest);
352
+ target.frontMostApp().setPreferencesValueForKey(0, __calabashRequest);
340
353
  try {
341
354
  _result = eval(_exp);
342
355
  UIALogger.logMessage("Success: "+ _result);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run_loop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre7
4
+ version: 0.1.0.pre8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-27 00:00:00.000000000 Z
11
+ date: 2013-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor