run_loop 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/run_loop/lipo.rb +5 -2
- data/lib/run_loop/version.rb +1 -1
- data/scripts/detect_externally_generated_alerts.js +51 -0
- data/scripts/logger.js +26 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1acd994423eba90fe68a775efbbfdd8ea7ee4b00
|
4
|
+
data.tar.gz: 740f3f0355de718ff91c4da34251cc1678344572
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e828bde433861b5f6b247dee15f60e2a0c8674eae4644020597bc32ee7ce768c41b58e2d236ee469ac32930f72c11c10f2d81f4a627238d4c181c292177be5e0
|
7
|
+
data.tar.gz: dd386d082b213174f74296dbacfb0756b82580d0bcd711f0500faf2e4d466063c2856f7260bcb3e3cdf0b605e8a43a7b28864ba6202d88bd9a3eefcd12e28d40
|
data/lib/run_loop/lipo.rb
CHANGED
@@ -81,13 +81,13 @@ module RunLoop
|
|
81
81
|
# @return [Array<String>] A list of architecture.
|
82
82
|
# @raise [RuntimeError] If the output of lipo cannot be parsed.
|
83
83
|
def info
|
84
|
-
execute_lipo("-info #{binary_path}") do |stdout, stderr, wait_thr|
|
84
|
+
execute_lipo("-info \"#{binary_path}\"") do |stdout, stderr, wait_thr|
|
85
85
|
output = stdout.read.strip
|
86
86
|
begin
|
87
87
|
output.split(':')[-1].strip.split
|
88
88
|
rescue Exception => e
|
89
89
|
msg = ['Expected to be able to parse the output of lipo.',
|
90
|
-
"cmd: 'lipo -info #{
|
90
|
+
"cmd: 'lipo -info #{escaped_binary_path}'",
|
91
91
|
"stdout: '#{output}'",
|
92
92
|
"stderr: '#{stderr.read.strip}'",
|
93
93
|
"exit code: '#{wait_thr.value}'",
|
@@ -99,6 +99,9 @@ module RunLoop
|
|
99
99
|
|
100
100
|
private
|
101
101
|
|
102
|
+
# Caller is responsible for correctly escaping arguments.
|
103
|
+
# For example, the caller must proper quote `"` paths to avoid errors
|
104
|
+
# when dealing with paths that contain spaces.
|
102
105
|
def execute_lipo(argument)
|
103
106
|
command = "xcrun lipo #{argument}"
|
104
107
|
Open3.popen3(command) do |_, stdout, stderr, wait_thr|
|
data/lib/run_loop/version.rb
CHANGED
@@ -0,0 +1,51 @@
|
|
1
|
+
#import "./logger.js";
|
2
|
+
|
3
|
+
function findAlertViewText(alert) {
|
4
|
+
if (!alert) {
|
5
|
+
return false;
|
6
|
+
}
|
7
|
+
var txt = alert.name(),
|
8
|
+
txts;
|
9
|
+
if (txt == null) {
|
10
|
+
txts = alert.staticTexts();
|
11
|
+
if (txts != null && txts.length > 0) {
|
12
|
+
txt = txts[0].name();
|
13
|
+
}
|
14
|
+
}
|
15
|
+
return txt;
|
16
|
+
}
|
17
|
+
|
18
|
+
function isExternallyGeneratedAlert(alert) {
|
19
|
+
var exps =
|
20
|
+
[
|
21
|
+
// Location Alerts
|
22
|
+
["OK", /vil bruge din aktuelle placering/],
|
23
|
+
["OK", /Would Like to Use Your Current Location/],
|
24
|
+
["Allow", /access your location/],
|
25
|
+
["Ja", /Darf (?:.)+ Ihren aktuellen Ort verwenden/],
|
26
|
+
["OK", /Location Accuracy/],
|
27
|
+
["OK", /запрашивает разрешение на использование Ващей текущей пгеопозиции/],
|
28
|
+
|
29
|
+
// Notifications
|
30
|
+
["OK", /Would Like to Send You Notifications/],
|
31
|
+
|
32
|
+
// Photos
|
33
|
+
["OK", /Would Like to Access Your Photos/],
|
34
|
+
|
35
|
+
// Contacts
|
36
|
+
["OK", /Would Like to Access Your Contacts/]
|
37
|
+
],
|
38
|
+
ans, exp,
|
39
|
+
txt;
|
40
|
+
|
41
|
+
txt = findAlertViewText(alert);
|
42
|
+
Log.output({"output":"alert: "+txt}, true);
|
43
|
+
for (var i = 0; i < exps.length; i++) {
|
44
|
+
ans = exps[i][0];
|
45
|
+
exp = exps[i][1];
|
46
|
+
if (exp.test(txt)) {
|
47
|
+
return ans;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
return false;
|
51
|
+
}
|
data/scripts/logger.js
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
var Log = (function () {
|
2
|
+
var forceFlush = [],
|
3
|
+
N = 16384,
|
4
|
+
i = N;
|
5
|
+
while (i--) {
|
6
|
+
forceFlush[i] = "*";
|
7
|
+
}
|
8
|
+
forceFlush = forceFlush.join('');
|
9
|
+
|
10
|
+
function log_json(object, flush)
|
11
|
+
{
|
12
|
+
UIALogger.logMessage("OUTPUT_JSON:\n"+JSON.stringify(object)+"\nEND_OUTPUT");
|
13
|
+
if (flush) {
|
14
|
+
UIALogger.logMessage(forceFlush);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
return {
|
19
|
+
result: function (status, data, flush) {
|
20
|
+
log_json({"status": status, "value": data, "index":_actualIndex}, flush)
|
21
|
+
},
|
22
|
+
output: function (msg, flush) {
|
23
|
+
log_json({"output": msg,"last_index":_actualIndex}, flush);
|
24
|
+
}
|
25
|
+
};
|
26
|
+
})();
|
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: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karl Krukow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -229,8 +229,10 @@ files:
|
|
229
229
|
- lib/run_loop/xctools.rb
|
230
230
|
- scripts/calabash.lldb.erb
|
231
231
|
- scripts/calabash_script_uia.js
|
232
|
+
- scripts/detect_externally_generated_alerts.js
|
232
233
|
- scripts/json2-min.js
|
233
234
|
- scripts/json2.js
|
235
|
+
- scripts/logger.js
|
234
236
|
- scripts/read-cmd.sh
|
235
237
|
- scripts/run_dismiss_location.js
|
236
238
|
- scripts/run_loop_basic.js
|
@@ -264,4 +266,3 @@ signing_key:
|
|
264
266
|
specification_version: 4
|
265
267
|
summary: Tools related to running Calabash iOS tests
|
266
268
|
test_files: []
|
267
|
-
has_rdoc:
|