run_loop 2.0.8 → 2.0.9

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: a796cf1b151815127a2c4ee38c6fadf13be9cef8
4
- data.tar.gz: 40e6b8e223325fba4d2a13683afa1609b2f9348c
3
+ metadata.gz: 7e1857365bd24d24d05315ce7d1a010434482c4a
4
+ data.tar.gz: 8f4ea53c1879ade929b57ba8ba2a88ecd9b42085
5
5
  SHA512:
6
- metadata.gz: d0b6d5bb57703550c6592a5d665c1d11d74db9075bf8b688156e2f6094efd6ab0e3efc72c19e9080228f1da8d003f8d115382f804303228a091d05043d3a7309
7
- data.tar.gz: 8b53742a9c3b4fe65036f387e93dd189ff350e57bd24ebd90bb7c24e1f6635543a675aafb9500bdf34b92640d61ed6adb5c8eb81e9c9833fcab2f6588d28d7a7
6
+ metadata.gz: 9e0d5bb32beb634eb15bdd09b76e2fbdecd0bc3bc5018d8d4087f2beb2b46d166abc8e09d71e6a38b1c0256bbba3ef607b4661a1b4a4fb5ade8978afbf43b4b5
7
+ data.tar.gz: 1c960eb4a3b376dc824275680bf4135b68066a6b42977d6112cdb0c202213280e8dac6c8f59fbcc834b1cd50c66b9c0cbdbf2c071f3832119e615929abb76ce4
@@ -9,6 +9,11 @@ module RunLoop
9
9
  include RunLoop::DetectAUT::XamarinStudio
10
10
  include RunLoop::DetectAUT::Xcode
11
11
 
12
+ # @!visibility private
13
+ DEFAULTS = {
14
+ :search_depth => 5
15
+ }
16
+
12
17
  # @!visibility private
13
18
  def app_for_simulator
14
19
  path = RunLoop::Environment.path_to_app_bundle
@@ -20,19 +25,12 @@ module RunLoop
20
25
  search_dirs = [solution_directory]
21
26
  apps = candidate_apps(search_dirs.first)
22
27
  else
23
- apps = []
24
- search_dirs = []
25
- end
26
-
27
- # If this is a Xamarin project, we've already searched the local
28
- # directory tree for .app.
29
- if apps.empty? && !xamarin_project?
30
- search_dirs << File.expand_path("./")
31
- apps = candidate_apps(File.expand_path("./"))
28
+ search_dirs = [Dir.pwd]
29
+ apps = candidate_apps(search_dirs.first)
32
30
  end
33
31
 
34
32
  if apps.empty?
35
- raise_no_simulator_app_found(search_dirs)
33
+ raise_no_simulator_app_found(search_dirs, DEFAULTS[:search_depth])
36
34
  end
37
35
 
38
36
  app = select_most_recent_app(apps)
@@ -65,7 +63,12 @@ module RunLoop
65
63
  # @param [String] base_dir where to start the recursive search
66
64
  def candidate_apps(base_dir)
67
65
  candidates = []
68
- Dir.glob("#{base_dir}/**/*.app").each do |bundle_path|
66
+
67
+ globs = globs_for_app_search(base_dir)
68
+ Dir.glob(globs).each do |bundle_path|
69
+ # Gems, like run-loop, can contain *.app if the user is building
70
+ # from :git =>, :github =>, or :path => sources.
71
+ next if bundle_path[/vendor\/cache/, 0] != nil
69
72
  app = app_or_nil(bundle_path)
70
73
  candidates << app if app
71
74
  end
@@ -91,6 +94,14 @@ module RunLoop
91
94
  path = File.join(app.path, app.executable_name)
92
95
  File.mtime(path)
93
96
  end
97
+
98
+ # @!visibility private
99
+ def globs_for_app_search(base_dir)
100
+ search_depth = DEFAULTS[:search_depth]
101
+ Array.new(search_depth) do |depth|
102
+ File.join(base_dir, *Array.new(depth) { |_| "*"}, "*.app")
103
+ end
104
+ end
94
105
  end
95
106
  end
96
107
  end
@@ -59,7 +59,7 @@ $ XCODEPROJ=MyiOSApp.xcodeproj
59
59
  raise RunLoop::MultipleXcodeprojError,
60
60
  %Q[Found multiple .xcodeproj directories:
61
61
 
62
- #{projects.each { |path| puts " #{path}" }}
62
+ #{projects.join($-0)}
63
63
 
64
64
  Which project contains the target of the application you are trying to test?
65
65
 
@@ -106,19 +106,18 @@ $ SOLUTION=~/some/other/directory/MyApp.sln
106
106
 
107
107
  # @!visibility private
108
108
  # Raised when no app can found by the discovery algorithm
109
- def raise_no_simulator_app_found(search_directories)
109
+ def raise_no_simulator_app_found(search_directories, search_depth)
110
110
  raise RunLoop::NoSimulatorAppFoundError,
111
- %Q[Searched these directories:
111
+ %Q[Recursively searched these directories to depth #{search_depth}:
112
112
 
113
- #{search_directories.each { |path| puts " #{path}" }}
113
+ #{search_directories.join($-0)}
114
114
 
115
- but could not find any .app for the simulator that contains the Calabash iOS
116
- server.
115
+ but could not find any .app for the simulator that links the Calabash iOS server.
117
116
 
118
117
  Make sure you have built your app for a simulator target from Xcode.
119
118
 
120
- If you testing a stand-alone .app (you don't have an Xcode project), put your
121
- .app in the same directory (or below) the directory you run `cucumber` from.
119
+ If you are testing a stand-alone .app (you don't have an Xcode project), put
120
+ your .app in the same directory (or below) the directory you run `cucumber` from.
122
121
  ]
123
122
  end
124
123
  end
@@ -30,7 +30,19 @@ module RunLoop
30
30
 
31
31
  # @!visibility private
32
32
  def find_xcodeproj
33
- Dir.glob("#{Dir.pwd}/**/*.xcodeproj")
33
+ xcode_projects = []
34
+ Dir.glob("#{Dir.pwd}/**/*.xcodeproj").each do |path|
35
+ next if ignore_xcodeproj?(path)
36
+ xcode_projects << path
37
+ end
38
+ xcode_projects
39
+ end
40
+
41
+ # @!visibility private
42
+ def ignore_xcodeproj?(path)
43
+ path[/CordovaLib/, 0] ||
44
+ path[/Pods/, 0] ||
45
+ path[/Carthage/, 0]
34
46
  end
35
47
 
36
48
  # @!visibility private
@@ -42,6 +54,9 @@ module RunLoop
42
54
  dirs_to_search << dir_from_prefs
43
55
  end
44
56
 
57
+ dirs_to_search << Dir.pwd
58
+ dirs_to_search.uniq!
59
+
45
60
  apps = []
46
61
  dirs_to_search.each do |dir|
47
62
  # defined in detect_aut/apps.rb
@@ -1,5 +1,5 @@
1
1
  module RunLoop
2
- VERSION = "2.0.8"
2
+ VERSION = "2.0.9"
3
3
 
4
4
  # A model of a software release version that can be used to compare two versions.
5
5
  #
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: 2.0.8
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Krukow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-09 00:00:00.000000000 Z
11
+ date: 2016-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -373,4 +373,3 @@ specification_version: 4
373
373
  summary: The bridge between Calabash iOS and Xcode command-line tools like instruments
374
374
  and simctl.
375
375
  test_files: []
376
- has_rdoc: