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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e972900301fbf194438a65c383c0456337b2aa13
4
- data.tar.gz: 2ce95031c23912360f8542d88749ff6cef7db15d
3
+ metadata.gz: e9bb0e41715b40a247cce0ca6c129aa782269d21
4
+ data.tar.gz: 88cf6d66bdc6ad88e83971ab6234279e703a2203
5
5
  SHA512:
6
- metadata.gz: e1c6ac5e752578f5012a269eb7656457bb5c4939b94cd473502266c28ba9c1e701cc696efb02aeac38637992b8013c29463f0b4a00146005410dc90b9400f94c
7
- data.tar.gz: 997526c2682ead602ec3b6f95b578237d2ff81f7cd34fac500fa20e7cf45bf95b4eafd6fd1ba9796428a641b902ba48e582233753dbabd635ef432b46b1949e8
6
+ metadata.gz: 2df417c53c2e9001002bd23f00ccd3938d436a4736914fb372b3978f968e1d87f247fd1b4d6706bbd67b3bf50b77abefdcdeb7ab3838bee9b257e8f1f74cec34
7
+ data.tar.gz: 88eb0ca4828ea2bbf052012557b204a0346d0a205485804e4e6c68bea7f70d960ada2e91835d262f4dc594a1e463738c3e55868e612012e7152ed890d332a6ae
@@ -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
- begin
37
- run_with_timer(timeout, interval) { return yield(object) }
38
- rescue ::Errno::ECONNREFUSED => e
39
- raise e
40
- rescue *ignored => last_error # rubocop:disable Lint/HandleExceptions
41
- # swallowed
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
- begin
77
- run_with_timer(timeout, interval) do
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
- rescue ::Errno::ECONNREFUSED => e
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
- module Timer
5
- class << self
6
- # @private
7
- def wait(timeout, &block)
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
- private
9
+ def timeout?
10
+ current_time > @end_time
11
+ end
16
12
 
17
- if defined?(Process::CLOCK_MONOTONIC)
18
- def current_time
19
- Process.clock_gettime(Process::CLOCK_MONOTONIC)
20
- end
21
- else
22
- def current_time
23
- ::Time.now.to_f
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 # module Timer
22
+ end # class Timer
28
23
  end # module Wait
29
24
  end # module Core
30
25
  end # module Appium
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  module Core
3
- VERSION = '1.5.0'.freeze unless defined? ::Appium::Core::VERSION
3
+ VERSION = '1.5.1'.freeze unless defined? ::Appium::Core::VERSION
4
4
  DATE = '2018-04-25'.freeze unless defined? ::Appium::Core::DATE
5
5
  end
6
6
  end
@@ -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.0
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-24 00:00:00.000000000 Z
11
+ date: 2018-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver