run_loop 1.0.0.pre7 → 1.0.0.pre9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b994124cd00426192ac1b1a472240aefb2b73d4
4
- data.tar.gz: 3befda188493d2497c5a67d771af54930f546be6
3
+ metadata.gz: 62ac6ffe72e4b45476b5e5e73bf91f825d2fb2ce
4
+ data.tar.gz: 00e3457710b098584f528f50c161901b1ba90fd9
5
5
  SHA512:
6
- metadata.gz: 9bae24d78425be262be8fdfbbc69810bbe3c7018c13a61e8f499aaaf29d50f406b6d7b01e54d94438a93915467ba338891e8e476fce119b45b558778fab0f9a7
7
- data.tar.gz: 55bdff09ded29ade3098fa8152a19810d38405973d4e93b015e27771020da923df078db44a1d0f7693679e04e42c43cf7e1f02af1a6d76ac79279f1fa98039cd
6
+ metadata.gz: ba6006e5b60c21fd0333e3240d4d5c9bdba44a144b686e8b11ab48a7918c1c969bb045d416c2ee9451d058c22bab5286c6a056fd0547d263d2f82917e1e55537
7
+ data.tar.gz: 925cf51c2008586086b45205ea8ebaa02b2abc5a0fdf0a487f8f93d5467bc0e5e24ab759795c36dcd45b5086bb686da7421a7ee49e1ae67a267c9a02af358492
data/lib/run_loop/core.rb CHANGED
@@ -107,9 +107,7 @@ module RunLoop
107
107
 
108
108
  uia_strategy = options[:uia_strategy]
109
109
  if uia_strategy == :host
110
- unless system(%Q[mkfifo "#{repl_path}"])
111
- raise 'Unable to create pipe (mkfifo failed)'
112
- end
110
+ create_uia_pipe(repl_path)
113
111
  end
114
112
 
115
113
  cal_script = File.join(SCRIPTS_PATH, 'calabash_script_uia.js')
@@ -389,6 +387,24 @@ module RunLoop
389
387
  xctools.xcode_version.to_s
390
388
  end
391
389
 
390
+ def self.create_uia_pipe(repl_path)
391
+ begin
392
+ Timeout::timeout(5, TimeoutError) do
393
+ loop do
394
+ begin
395
+ FileUtils.rm_f(repl_path)
396
+ return repl_path if system(%Q[mkfifo "#{repl_path}"])
397
+ rescue Errno::EINTR => e
398
+ #retry
399
+ sleep(0.1)
400
+ end
401
+ end
402
+ end
403
+ rescue TimeoutError => _
404
+ raise TimeoutError, 'Unable to create pipe (mkfifo failed)'
405
+ end
406
+ end
407
+
392
408
  def self.jruby?
393
409
  RUBY_PLATFORM == 'java'
394
410
  end
@@ -1,5 +1,5 @@
1
1
  module RunLoop
2
- VERSION = '1.0.0.pre7'
2
+ VERSION = '1.0.0.pre9'
3
3
 
4
4
  # A model of a software release version that can be used to compare two versions.
5
5
  #
@@ -20,7 +20,7 @@ module RunLoop
20
20
  #
21
21
  # @return [RunLoop::Version] 6.0
22
22
  def v60
23
- @xc60 ||= Version.new('6.0')
23
+ @xc60 ||= RunLoop::Version.new('6.0')
24
24
  end
25
25
 
26
26
  # Returns a version instance for `Xcode 5.1`; used to check for the
@@ -28,7 +28,7 @@ module RunLoop
28
28
  #
29
29
  # @return [RunLoop::Version] 5.1
30
30
  def v51
31
- @xc51 ||= Version.new('5.1')
31
+ @xc51 ||= RunLoop::Version.new('5.1')
32
32
  end
33
33
 
34
34
  # Returns a version instance for `Xcode 5.0`; ; used to check for the
@@ -36,7 +36,7 @@ module RunLoop
36
36
  #
37
37
  # @return [RunLoop::Version] 5.0
38
38
  def v50
39
- @xc50 ||= Version.new('5.0')
39
+ @xc50 ||= RunLoop::Version.new('5.0')
40
40
  end
41
41
 
42
42
  # Are we running Xcode 6 or above?
@@ -60,7 +60,7 @@ module RunLoop
60
60
  def xcode_version
61
61
  @xcode_version ||= lambda {
62
62
  xcode_build_output = `xcrun xcodebuild -version`.split(/\s/)[1]
63
- Version.new(xcode_build_output)
63
+ RunLoop::Version.new(xcode_build_output)
64
64
  }.call
65
65
  end
66
66
 
@@ -115,7 +115,7 @@ module RunLoop
115
115
  Retriable.retriable({:tries => 5}) do
116
116
  Open3.popen3("#{instruments}") do |_, _, stderr, _|
117
117
  version_str = stderr.read.chomp.split(/\s/)[2]
118
- Version.new(version_str)
118
+ RunLoop::Version.new(version_str)
119
119
  end
120
120
  end
121
121
  }.call
@@ -173,11 +173,11 @@ module RunLoop
173
173
  def instruments_supports_hyphen_s?(version=instruments(:version))
174
174
  @instruments_supports_hyphen_s ||= lambda {
175
175
  if version.is_a? String
176
- _version = Version.new(version)
176
+ _version = RunLoop::Version.new(version)
177
177
  else
178
178
  _version = version
179
179
  end
180
- _version >= Version.new('5.1')
180
+ _version >= RunLoop::Version.new('5.1')
181
181
  }.call
182
182
  end
183
183
  end
@@ -199,7 +199,9 @@ function isLocationPrompt(alert) {
199
199
  ["OK", /vil bruge din aktuelle placering/],
200
200
  ["OK", /Would Like to Use Your Current Location/],
201
201
  ["Ja", /Darf (?:.)+ Ihren aktuellen Ort verwenden/],
202
- ["OK", /Would Like to Access Your Photos/]
202
+ ["OK", /Would Like to Access Your Photos/],
203
+ ["OK", /Would Like to Access Your Contacts/],
204
+ ["OK", /запрашивает разрешение на использование Ващей текущей пгеопозиции/]
203
205
  ],
204
206
  ans, exp,
205
207
  txt;
@@ -217,7 +217,9 @@ function isLocationPrompt(alert) {
217
217
  ["OK", /vil bruge din aktuelle placering/],
218
218
  ["OK", /Would Like to Use Your Current Location/],
219
219
  ["Ja", /Darf (?:.)+ Ihren aktuellen Ort verwenden/],
220
- ["OK", /Would Like to Access Your Photos/]
220
+ ["OK", /Would Like to Access Your Photos/],
221
+ ["OK", /Would Like to Access Your Contacts/],
222
+ ["OK", /запрашивает разрешение на использование Ващей текущей пгеопозиции/]
221
223
  ],
222
224
  ans, exp,
223
225
  txt;
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.0.0.pre7
4
+ version: 1.0.0.pre9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-30 00:00:00.000000000 Z
11
+ date: 2014-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor