run_loop 4.3.0 → 4.4.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
  SHA256:
3
- metadata.gz: 81d7a5431434f1687a7de8f24ade09aaf70cbe3da811fa656a49bd2cecdd8c1b
4
- data.tar.gz: 2ff49f10b35b523c51b28814d19a35bcdd43e3656e6a93143d689289e71696cf
3
+ metadata.gz: 783cda95e8fce11354b0e1c06d0b682b2013f33f162f9a172e9d61dfa27393a4
4
+ data.tar.gz: 255ec74838502bde8e54e901cd9fd884098a0229ae4711c45a32913451b6f579
5
5
  SHA512:
6
- metadata.gz: e69dd4687d06bf07a787db97fdaea90e894c39012165703e7b6bbfdc3fb4d49f26f0c1b0f85eef2201002a115ceb6904ba1f4c820dd65e979edeca3d86eb5801
7
- data.tar.gz: 48eb4a1533dff8f7eff5e8d0241f2e542c526f8735ed89c167f4e7ee30843629d976193099f09268c6d708dfe018a82b1928804b37fb943a10a11374c30dd50b
6
+ metadata.gz: 04cea1bbb737d712b1eb471717f70493f203ded01631cbcb1b52990df22e8cf7bb853107dda3d0aa818a5e6479e8f14e645aa70ee6aa9e56e982e1d05e59c8a2
7
+ data.tar.gz: 608a3d2e5446af33d26dceb946995dcb43ededb59e200f210dcec3da706842feafae7884caddf5c019367f5382e4a4cca4461b4d406033f0ecf299ae38fc8117
@@ -319,25 +319,10 @@ Logfile: #{log_file}
319
319
  # @param [RunLoop::Xcode] xcode Used to detect the current xcode
320
320
  # version.
321
321
  def self.default_simulator(xcode=RunLoop::Xcode.new)
322
- version = xcode.version
323
- xcode_major = version.major
324
- xcode_minor = version.minor
325
- major = xcode_major + 2
326
- minor = xcode_minor
327
-
328
- if xcode_major == 11
329
- model = "Xs"
330
- elsif xcode_major == 10
331
- if minor >= 2
332
- model = "Xs"
333
- else
334
- model = "XS"
335
- end
336
- else
337
- model = xcode_major - 1
338
- end
322
+ ios_version = xcode.ios_version
323
+ device = xcode.default_device
339
324
 
340
- "iPhone #{model} (#{major}.#{minor})"
325
+ "#{device} (#{ios_version.major}.#{ios_version.minor})"
341
326
  end
342
327
 
343
328
  def self.create_uia_pipe(repl_path)
@@ -1163,23 +1163,18 @@ Command had no output.
1163
1163
 
1164
1164
  # @!visibility private
1165
1165
  def self.system_applications_dir(xcode=RunLoop::Xcode.new)
1166
- base_dir = xcode.developer_dir
1167
-
1168
- if xcode.version_gte_110?
1169
- apps_dir = File.join("Platforms", "iPhoneOS.platform", "Library",
1170
- "Developer", "CoreSimulator", "Profiles", "Runtimes",
1171
- "iOS.simruntime", "Contents", "Resources",
1172
- "RuntimeRoot", "Applications")
1173
- elsif xcode.version_gte_90?
1174
- apps_dir = File.join("Platforms", "iPhoneOS.platform", "Developer",
1175
- "Library", "CoreSimulator", "Profiles", "Runtimes",
1176
- "iOS.simruntime", "Contents", "Resources",
1177
- "RuntimeRoot", "Applications")
1166
+ if xcode.version_gte_90?
1167
+ apps_dir = File.join(xcode.core_simulator_dir,
1168
+ "Profiles", "Runtimes", "iOS.simruntime",
1169
+ "Contents", "Resources", "RuntimeRoot",
1170
+ "Applications")
1178
1171
  else
1179
- apps_dir = File.join("Platforms", "iPhoneSimulator.platform", "Developer",
1180
- "SDKs", "iPhoneSimulator.sdk", "Applications")
1172
+ apps_dir = File.join(xcode.developer_dir,
1173
+ "Platforms", "iPhoneSimulator.platform",
1174
+ "Developer", "SDKs", "iPhoneSimulator.sdk",
1175
+ "Applications")
1181
1176
  end
1182
- File.expand_path(File.join(base_dir, apps_dir))
1177
+ File.expand_path(apps_dir)
1183
1178
  end
1184
1179
 
1185
1180
  # @!visibility private
@@ -259,9 +259,12 @@ version: #{version}
259
259
  end
260
260
 
261
261
  if ios_version.major == (xcode_version.major + 2)
262
- return ios_version.minor <= xcode_version.minor
262
+ if xcode_version.major == 10 && xcode_version.minor == 3
263
+ return ios_version.minor <= 4
264
+ else
265
+ return ios_version.minor <= xcode_version.minor
266
+ end
263
267
  end
264
-
265
268
  false
266
269
  end
267
270
 
@@ -777,15 +780,12 @@ https://github.com/calabash/calabash-ios/wiki/Testing-on-Physical-Devices
777
780
 
778
781
  # @!visibility private
779
782
  def simulator_running_system_app_pids
780
- base_dir = xcode.developer_dir
781
- if xcode.version_gte_110?
782
- sim_apps_dir = "Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Applications"
783
- elsif xcode.version_gte_90?
784
- sim_apps_dir = "Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Applications"
783
+ if xcode.version_gte_90?
784
+ sim_apps_dir = File.join(xcode.core_simulator_dir, "Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Applications")
785
785
  else
786
- sim_apps_dir = "Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications"
786
+ sim_apps_dir = File.join(xcode.developer_dir, "Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications")
787
787
  end
788
- path = File.expand_path(File.join(base_dir, sim_apps_dir))
788
+ path = File.expand_path(sim_apps_dir)
789
789
  RunLoop::ProcessWaiter.pgrep_f(path)
790
790
  end
791
791
  end
@@ -17,9 +17,8 @@ module RunLoop
17
17
  key_name_lookup_table(lookup_table_dir)[key_code]
18
18
  end
19
19
 
20
- UIKIT_AXBUNDLE_PATH_CORE_SIM = 'Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/AccessibilityBundles/UIKit.axbundle/'
21
- UIKIT_AXBUNDLE_PATH_CORE_SIM_XCODE_9 = "Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/UIKit.axbundle"
22
- UIKIT_AXBUNDLE_PATH_CORE_SIM_XCODE_11 = "Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/UIKit.axbundle"
20
+ UIKIT_AXBUNDLE_PATH_CORE_SIM = 'Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/AccessibilityBundles/UIKit.axbundle'
21
+ UIKIT_AXBUNDLE_PATH_CORE_SIM_XCODE_9 = "Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/AccessibilityBundles/UIKit.axbundle"
23
22
 
24
23
  LANG_CODE_TO_LANG_NAME_MAP = {
25
24
  'en' => 'English',
@@ -72,10 +71,8 @@ module RunLoop
72
71
  end
73
72
 
74
73
  def uikit_bundle_l10n_path
75
- if xcode.version_gte_110?
76
- File.join(xcode.developer_dir, UIKIT_AXBUNDLE_PATH_CORE_SIM_XCODE_11)
77
- elsif xcode.version_gte_90?
78
- File.join(xcode.developer_dir, UIKIT_AXBUNDLE_PATH_CORE_SIM_XCODE_9)
74
+ if xcode.version_gte_90?
75
+ File.join(xcode.core_simulator_dir, UIKIT_AXBUNDLE_PATH_CORE_SIM_XCODE_9)
79
76
  else
80
77
  File.join(xcode.developer_dir, UIKIT_AXBUNDLE_PATH_CORE_SIM)
81
78
  end
@@ -1,5 +1,5 @@
1
1
  module RunLoop
2
- VERSION = "4.3.0"
2
+ VERSION = "4.4.1"
3
3
 
4
4
  # A model of a software release version that can be used to compare two versions.
5
5
  #
@@ -34,6 +34,14 @@ module RunLoop
34
34
  fetch_version(:v110)
35
35
  end
36
36
 
37
+ # Returns a version instance for Xcode 10.3; used to check for the
38
+ # availability of features and paths to various items on the filesystem
39
+ #
40
+ # @return [RunLoop::Version] 10.3
41
+ def v103
42
+ fetch_version(:v103)
43
+ end
44
+
37
45
  # Returns a version instance for Xcode 10.2; used to check for the
38
46
  # availability of features and paths to various items on the filesystem
39
47
  #
@@ -129,6 +137,13 @@ module RunLoop
129
137
  version >= v110
130
138
  end
131
139
 
140
+ # Is the active Xcode version 10.3 or above?
141
+ #
142
+ # @return [Boolean] `true` if the current Xcode version is >= 10.3
143
+ def version_gte_103?
144
+ version >= v103
145
+ end
146
+
132
147
  # Is the active Xcode version 10.2 or above?
133
148
  #
134
149
  # @return [Boolean] `true` if the current Xcode version is >= 10.2
@@ -299,6 +314,48 @@ $ man xcode-select
299
314
  end
300
315
  end
301
316
 
317
+ def core_simulator_dir
318
+ if version_gte_110?
319
+ core_simulator_dir = File.join(developer_dir,
320
+ 'Platforms', 'iPhoneOS.platform', 'Library',
321
+ 'Developer', 'CoreSimulator')
322
+ else
323
+ core_simulator_dir = File.join(developer_dir,
324
+ 'Platforms', 'iPhoneOS.platform', 'Developer',
325
+ 'Library', 'CoreSimulator')
326
+ end
327
+ File.expand_path(core_simulator_dir)
328
+ end
329
+
330
+ def ios_version
331
+ xcode_version = version
332
+ sim_major = xcode_version.major + 2
333
+ sim_minor = xcode_version.minor
334
+ if xcode_version == v103
335
+ sim_minor = 4
336
+ end
337
+
338
+ return RunLoop::Version.new("#{sim_major}.#{sim_minor}")
339
+ end
340
+
341
+ def default_device
342
+ xcode_version = version
343
+ if xcode_version.major == 11
344
+ return "iPhone 11"
345
+ end
346
+
347
+ if xcode_version.major == 10
348
+ if xcode_version.minor >= 2
349
+ return "iPhone Xs"
350
+ else
351
+ return "iPhone XS"
352
+ end
353
+ end
354
+
355
+ # Xcode < 10
356
+ return "iPhone #{xcode_version.major - 1}"
357
+ end
358
+
302
359
  private
303
360
 
304
361
  attr_reader :xcode_versions
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: 4.3.0
4
+ version: 4.4.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: 2019-08-06 00:00:00.000000000 Z
12
+ date: 2019-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -437,7 +437,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
437
437
  - !ruby/object:Gem::Version
438
438
  version: '0'
439
439
  requirements: []
440
- rubygems_version: 3.0.4
440
+ rubygems_version: 3.0.3
441
441
  signing_key:
442
442
  specification_version: 4
443
443
  summary: The bridge between Calabash iOS and Xcode command-line tools like instruments