run_loop 2.3.0 → 2.3.1

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: 101e24777ce2bcf5ab9b3383d38bcee5b84e2380
4
- data.tar.gz: cecaa67f6d26fcbacb586feb4cc8124fd83aeac3
3
+ metadata.gz: 947320c824c62ac07552ca83078f17bec6f20425
4
+ data.tar.gz: edd982c791f9bd5e5ef5a926ff08cced5b8ec5df
5
5
  SHA512:
6
- metadata.gz: 8f8ddac54d1977cb746bea4d974e4467d99f90fad5f6597fa5aaff86cabab2fba0cba726aee42c32cf70b78f6986b09f200ad622de295e90710fbe920b16e904
7
- data.tar.gz: 58c40dc759901a4188ae9499892d9baaecceb8ee8a6648e2bad6e7b966bd6c498da6528bff12f7a9eed3354a5ae67cdf35176d92d92f57e7f01ce4719e4e8e02
6
+ metadata.gz: cfeefe0786de38e51d696edbc3cb819105eac8d014327e24289e58c8fed7eae02525566c0efb2ee414e856aabffc39cd52e2e998581563bfe7e8a06c24d7a730
7
+ data.tar.gz: 7ce7be2b5a314dd9e067388f17c0ad54a3933b7809cd6f2f96b3d6dc57a681f511baa2463295fdd19040f0f171c4979a2e4941c11366103e554dafd95f302411
@@ -320,7 +320,9 @@ Logfile: #{log_file}
320
320
  # version.
321
321
  def self.default_simulator(xcode=RunLoop::Xcode.new)
322
322
 
323
- if xcode.version_gte_82?
323
+ if xcode.version_gte_83?
324
+ "iPhone 7 (10.3)"
325
+ elsif xcode.version_gte_82?
324
326
  "iPhone 7 (10.2)"
325
327
  elsif xcode.version_gte_81?
326
328
  "iPhone 7 (10.1)"
@@ -460,6 +460,7 @@ Could not launch #{app.bundle_identifier} on #{device} after trying #{tries} tim
460
460
  def reset_app_sandbox
461
461
  return true if !app_is_installed?
462
462
 
463
+ RunLoop::CoreSimulator.quit_simulator
463
464
  RunLoop::CoreSimulator.wait_for_simulator_state(device, "Shutdown")
464
465
 
465
466
  reset_app_sandbox_internal
@@ -658,7 +658,6 @@ failed with this output:
658
658
  waiter = RunLoop::ProcessWaiter.new(process_name)
659
659
  waiter.pids.any? do |pid|
660
660
  process_parent_is_launchd_sim?(pid)
661
- #process_parent_is_current_xcode?(pid)
662
661
  end
663
662
  end
664
663
 
@@ -112,7 +112,6 @@ module RunLoop
112
112
  core_sim.reset_app_sandbox
113
113
  end
114
114
 
115
- simctl.ensure_software_keyboard(device)
116
115
  core_sim.install
117
116
  end
118
117
 
@@ -73,11 +73,11 @@ found '#{handle_errors_by}'
73
73
 
74
74
  #{e}
75
75
 
76
- while trying to find the SHA of this file:
76
+ while trying to find the SHA of this file:
77
77
 
78
78
  #{file}
79
79
 
80
- This is not a fatal error; it can be ignored.
80
+ This is not a fatal error; it can be ignored.
81
81
  }
82
82
  RunLoop.log_debug(message)
83
83
  when :raising
@@ -135,32 +135,37 @@ found '#{handle_errors_by}'
135
135
 
136
136
  def self.skip_file?(file, task, debug)
137
137
  skip = false
138
- if File.directory?(file)
139
- # Skip directories
140
- skip = true
141
- elsif !Pathname.new(file).exist?
142
- # Skip broken symlinks
143
- skip = true
144
- elsif !File.exist?(file)
145
- # Skip files that don't exist
146
- skip = true
147
- else
148
- case File.ftype(file)
149
- when 'fifo'
150
- RunLoop.log_warn("#{task} IS SKIPPING FIFO #{file}") if debug
151
- skip = true
152
- when 'socket'
153
- RunLoop.log_warn("#{task} IS SKIPPING SOCKET #{file}") if debug
154
- skip = true
155
- when 'characterSpecial'
156
- RunLoop.log_warn("#{task} IS SKIPPING CHAR SPECIAL #{file}") if debug
157
- skip = true
158
- when 'blockSpecial'
159
- skip = true
160
- RunLoop.log_warn("#{task} SKIPPING BLOCK SPECIAL #{file}") if debug
161
- else
162
-
138
+ begin
139
+ if File.directory?(file)
140
+ # Skip directories
141
+ skip = true
142
+ elsif !Pathname.new(file).exist?
143
+ # Skip broken symlinks
144
+ skip = true
145
+ elsif !File.exist?(file)
146
+ # Skip files that don't exist
147
+ skip = true
148
+ else
149
+ case File.ftype(file)
150
+ when 'fifo'
151
+ RunLoop.log_warn("#{task} IS SKIPPING FIFO #{file}") if debug
152
+ skip = true
153
+ when 'socket'
154
+ RunLoop.log_warn("#{task} IS SKIPPING SOCKET #{file}") if debug
155
+ skip = true
156
+ when 'characterSpecial'
157
+ RunLoop.log_warn("#{task} IS SKIPPING CHAR SPECIAL #{file}") if debug
158
+ skip = true
159
+ when 'blockSpecial'
160
+ skip = true
161
+ RunLoop.log_warn("#{task} SKIPPING BLOCK SPECIAL #{file}") if debug
162
+ else
163
+ end
163
164
  end
165
+ rescue => e
166
+ skip = true
167
+ RunLoop.log_debug("Directory.skip_file? rescued an ignorable error.")
168
+ RunLoop.log_debug("#{e.class}: #{e.message}")
164
169
  end
165
170
  skip
166
171
  end
@@ -170,7 +175,12 @@ found '#{handle_errors_by}'
170
175
  size = 0
171
176
  entries.each do |file|
172
177
  unless self.skip_file?(file, "SIZE", debug)
173
- size = size + File.size(file)
178
+ begin
179
+ size = size + File.size(file)
180
+ rescue => e
181
+ RunLoop.log_debug("Directory.iterate_for_size? rescued an ignorable error.")
182
+ RunLoop.log_debug("#{e.class}: #{e.message}")
183
+ end
174
184
  end
175
185
  end
176
186
  size
@@ -1,5 +1,5 @@
1
1
  module RunLoop
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.1"
3
3
 
4
4
  # A model of a software release version that can be used to compare two versions.
5
5
  #
@@ -1,5 +1,3 @@
1
- require 'open3'
2
-
3
1
  module RunLoop
4
2
 
5
3
  # A model of the active Xcode version.
@@ -12,7 +10,11 @@ module RunLoop
12
10
  # `xcode-select` or overridden using the `DEVELOPER_DIR`.
13
11
  class Xcode
14
12
 
13
+ require "run_loop/regex"
14
+ require "run_loop/shell"
15
+
15
16
  include RunLoop::Regex
17
+ include RunLoop::Shell
16
18
 
17
19
  # Returns a String representation.
18
20
  def to_s
@@ -24,6 +26,14 @@ module RunLoop
24
26
  to_s
25
27
  end
26
28
 
29
+ # Returns a version instance for Xcode 8.3 ; used to check for the
30
+ # availability of features and paths to various items on the filesystem
31
+ #
32
+ # @return [RunLoop::Version] 8.3
33
+ def v83
34
+ fetch_version(:v83)
35
+ end
36
+
27
37
  # Returns a version instance for Xcode 8.2 ; used to check for the
28
38
  # availability of features and paths to various items on the filesystem
29
39
  #
@@ -136,6 +146,13 @@ module RunLoop
136
146
  fetch_version(:v50)
137
147
  end
138
148
 
149
+ # Is the active Xcode version 8.3 or above?
150
+ #
151
+ # @return [Boolean] `true` if the current Xcode version is >= 8.3
152
+ def version_gte_83?
153
+ version >= v83
154
+ end
155
+
139
156
  # Is the active Xcode version 8.2 or above?
140
157
  #
141
158
  # @return [Boolean] `true` if the current Xcode version is >= 8.2
@@ -234,12 +251,31 @@ module RunLoop
234
251
  # @return [RunLoop::Version] The current version of Xcode as reported by
235
252
  # `xcrun xcodebuild -version`.
236
253
  def version
237
- @xcode_version ||= lambda do
238
- execute_command(['-version']) do |stdout, _, _|
239
- version_string = stdout.read.chomp[VERSION_REGEX, 0]
240
- RunLoop::Version.new(version_string)
254
+ @xcode_version ||= begin
255
+ if RunLoop::Environment.xtc?
256
+ RunLoop::Version.new("0.0.0")
257
+ else
258
+ version = RunLoop::Version.new("0.0.0")
259
+ begin
260
+ args = ["xcrun", "xcodebuild", "-version"]
261
+ hash = run_shell_command(args)
262
+ if hash[:exit_status] != 0
263
+ RunLoop.log_error("xcrun xcodebuild -version exited non-zero")
264
+ else
265
+ out = hash[:out]
266
+ version_string = out.chomp[VERSION_REGEX, 0]
267
+ version = RunLoop::Version.new(version_string)
268
+ end
269
+ rescue RuntimeError => e
270
+ RunLoop.log_error(%Q[
271
+ Could not find Xcode version:
272
+
273
+ #{e.class}: #{e.message}
274
+ ])
275
+ end
276
+ version
241
277
  end
242
- end.call
278
+ end
243
279
  end
244
280
 
245
281
  # Is this a beta version of Xcode?
@@ -333,12 +369,6 @@ $ man xcode-select
333
369
  end
334
370
  end
335
371
 
336
- def execute_command(args)
337
- Open3.popen3('xcrun', 'xcodebuild', *args) do |_, stdout, stderr, wait_thr|
338
- yield stdout, stderr, wait_thr
339
- end
340
- end
341
-
342
372
  def xcode_select_path
343
373
  Open3.popen3('xcode-select', '--print-path') do |_, stdout, _, _|
344
374
  stdout.read.chomp
@@ -132,15 +132,15 @@ function dutchLocalizations() {
132
132
  }
133
133
 
134
134
  function dutch_BE_Localizations() {
135
- return [
136
- ["Sta toe", /toegang tot je locatie toestaan terwijl je de app gebruikt/],
137
- ["Sta toe", /toegang tot je locatie toestaan, zelfs als je de app niet gebruikt/],
138
- ["OK", /wil toegang tot je contacten/],
139
- ["OK", /wil toegang tot je agenda/],
140
- ["OK", /wil toegang tot je herinneringen/],
141
- ["OK", /wil toegang tot je foto's/],
142
- ["OK", /wil toegang tot je bewegings- en fitnessactiviteit/]
143
- ];
135
+ return [
136
+ ["Sta toe", /toegang tot je locatie toestaan terwijl je de app gebruikt/],
137
+ ["Sta toe", /toegang tot je locatie toestaan, zelfs als je de app niet gebruikt/],
138
+ ["OK", /wil toegang tot je contacten/],
139
+ ["OK", /wil toegang tot je agenda/],
140
+ ["OK", /wil toegang tot je herinneringen/],
141
+ ["OK", /wil toegang tot je foto's/],
142
+ ["OK", /wil toegang tot je bewegings- en fitnessactiviteit/]
143
+ ];
144
144
  }
145
145
 
146
146
  function swedishLocalizations() {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run_loop
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-03 00:00:00.000000000 Z
12
+ date: 2017-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -415,7 +415,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
415
415
  version: '0'
416
416
  requirements: []
417
417
  rubyforge_project:
418
- rubygems_version: 2.6.8
418
+ rubygems_version: 2.5.1
419
419
  signing_key:
420
420
  specification_version: 4
421
421
  summary: The bridge between Calabash iOS and Xcode command-line tools like instruments