appium_lib_core 1.5.0 → 1.5.1
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/appium_lib_core/common/wait.rb +19 -24
- data/lib/appium_lib_core/common/wait/timer.rb +15 -20
- data/lib/appium_lib_core/version.rb +1 -1
- data/release_notes.md +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9bb0e41715b40a247cce0ca6c129aa782269d21
|
4
|
+
data.tar.gz: 88cf6d66bdc6ad88e83971ab6234279e703a2203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2df417c53c2e9001002bd23f00ccd3938d436a4736914fb372b3978f968e1d87f247fd1b4d6706bbd67b3bf50b77abefdcdeb7ab3838bee9b257e8f1f74cec34
|
7
|
+
data.tar.gz: 88eb0ca4828ea2bbf052012557b204a0346d0a205485804e4e6c68bea7f70d960ada2e91835d262f4dc594a1e463738c3e55868e612012e7152ed890d332a6ae
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,14 @@ All notable changes to this project will be documented in this file.
|
|
8
8
|
|
9
9
|
### Deprecations
|
10
10
|
|
11
|
+
## [1.5.1] - 2018-04-25
|
12
|
+
### Enhancements
|
13
|
+
|
14
|
+
### Bug fixes
|
15
|
+
- Revert timeout logic in `1.4.1`
|
16
|
+
|
17
|
+
### Deprecations
|
18
|
+
|
11
19
|
## [1.5.0] - 2018-04-25
|
12
20
|
### Enhancements
|
13
21
|
- [internal] Remove hot fix for XCUITest action
|
@@ -32,13 +32,17 @@ module Appium
|
|
32
32
|
ignored = Array(ignored || ::Exception)
|
33
33
|
|
34
34
|
last_error = nil
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
35
|
+
timer = Wait::Timer.new(timeout)
|
36
|
+
|
37
|
+
until timer.timeout?
|
38
|
+
begin
|
39
|
+
return yield(object)
|
40
|
+
rescue ::Errno::ECONNREFUSED => e
|
41
|
+
raise e
|
42
|
+
rescue *ignored => last_error # rubocop:disable Lint/HandleExceptions
|
43
|
+
# swallowed
|
44
|
+
end
|
45
|
+
sleep interval
|
42
46
|
end
|
43
47
|
|
44
48
|
msg = message_for timeout, message
|
@@ -72,16 +76,18 @@ module Appium
|
|
72
76
|
ignored = Array(ignored || ::Exception)
|
73
77
|
|
74
78
|
last_error = nil
|
79
|
+
timer = Wait::Timer.new(timeout)
|
75
80
|
|
76
|
-
|
77
|
-
|
81
|
+
until timer.timeout?
|
82
|
+
begin
|
78
83
|
result = yield(object)
|
79
84
|
return result if result
|
85
|
+
rescue ::Errno::ECONNREFUSED => e
|
86
|
+
raise e
|
87
|
+
rescue *ignored => last_error # rubocop:disable Lint/HandleExceptions
|
88
|
+
# swallowed
|
80
89
|
end
|
81
|
-
|
82
|
-
raise e
|
83
|
-
rescue *ignored => last_error # rubocop:disable Lint/HandleExceptions
|
84
|
-
# swallowed
|
90
|
+
sleep interval
|
85
91
|
end
|
86
92
|
|
87
93
|
msg = message_for timeout, message
|
@@ -97,17 +103,6 @@ module Appium
|
|
97
103
|
msg << ", #{message}" if message
|
98
104
|
msg
|
99
105
|
end
|
100
|
-
|
101
|
-
def run_with_timer(timeout, interval, &block)
|
102
|
-
if timeout.zero?
|
103
|
-
block.call # rubocop:disable Performance/RedundantBlockCall
|
104
|
-
else
|
105
|
-
Timer.wait timeout do
|
106
|
-
block.call # rubocop:disable Performance/RedundantBlockCall
|
107
|
-
sleep interval
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
106
|
end # self
|
112
107
|
end # module Wait
|
113
108
|
|
@@ -1,30 +1,25 @@
|
|
1
1
|
module Appium
|
2
2
|
module Core
|
3
3
|
module Wait
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
end_time = current_time + timeout
|
9
|
-
loop do
|
10
|
-
yield(block)
|
11
|
-
break if current_time > end_time
|
12
|
-
end
|
13
|
-
end
|
4
|
+
class Timer
|
5
|
+
def initialize(timeout)
|
6
|
+
@end_time = current_time + timeout
|
7
|
+
end
|
14
8
|
|
15
|
-
|
9
|
+
def timeout?
|
10
|
+
current_time > @end_time
|
11
|
+
end
|
16
12
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
13
|
+
if defined?(Process::CLOCK_MONOTONIC)
|
14
|
+
def current_time
|
15
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
16
|
+
end
|
17
|
+
else
|
18
|
+
def current_time
|
19
|
+
::Time.now.to_f
|
25
20
|
end
|
26
21
|
end
|
27
|
-
end #
|
22
|
+
end # class Timer
|
28
23
|
end # module Wait
|
29
24
|
end # module Core
|
30
25
|
end # module Appium
|
data/release_notes.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
#### v1.5.1 2018-04-25
|
2
|
+
|
3
|
+
- [27f6149](https://github.com/appium/ruby_lib_core/commit/27f6149f330137bc1d6350271c246ebe0346122b) Release 1.5.1
|
4
|
+
- [ddd8624](https://github.com/appium/ruby_lib_core/commit/ddd8624d2c3b9295af086eaf75774f94dbb17b39) Km/fix timeout error (#82)
|
5
|
+
|
6
|
+
|
1
7
|
#### v1.5.0 2018-04-25
|
2
8
|
|
3
9
|
- [b37ab24](https://github.com/appium/ruby_lib_core/commit/b37ab249c01a9d9f22a35e8d08e79a6d6b53e3f2) Release 1.5.0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appium_lib_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuaki MATSUO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|