sim_launcher 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,3 +2,26 @@ require 'sim_launcher/client'
2
2
  require 'sim_launcher/direct_client'
3
3
  require 'sim_launcher/simulator'
4
4
  require 'sim_launcher/sdk_detector'
5
+
6
+ module SimLauncher
7
+ def self.check_app_path( app_path )
8
+ unless File.exists?( app_path )
9
+ return "The specified app path doesn't seem to exist: #{app_path}"
10
+ end
11
+
12
+ unless File.directory? app_path
13
+ file_appears_to_be_a_binary = !!( `file "#{app_path}"` =~ /Mach-O executable/ )
14
+ if file_appears_to_be_a_binary
15
+ return <<-EOS
16
+ The specified app path is a binary executable, rather than a directory. You need to provide the path to the app *bundle*, not the app executable itself.
17
+ The path you specified was: #{app_path}
18
+ You might want to instead try specifying: #{File.dirname(app_path)}
19
+ EOS
20
+ else
21
+ return "The specified app path is not a directory. You need to provide the path to your app bundle.\nSpecified app path was: #{app_path}"
22
+ end
23
+ end
24
+
25
+ nil
26
+ end
27
+ end
@@ -5,33 +5,12 @@ class Simulator
5
5
  @iphonesim_path = iphonesim_path_external || iphonesim_path(xcode_version)
6
6
  end
7
7
 
8
- def check_app_path( app_path )
9
- unless File.exists?( app_path )
10
- return "The specified app path doesn't seem to exist: #{app_path}"
11
- end
12
-
13
- unless File.directory? app_path
14
- file_appears_to_be_a_binary = !!( `file "#{app_path}"` =~ /Mach-O executable/ )
15
- if file_appears_to_be_a_binary
16
- return <<-EOS
17
- The specified app path is a binary executable, rather than a directory. You need to provide the path to the app *bundle*, not the app executable itself.
18
- The path you specified was: #{app_path}
19
- You might want to instead try specifying: #{File.dirname(app_path)}
20
- EOS
21
- else
22
- return "The specified app path is not a directory. You need to provide the path to your app bundle.\nSpecified app path was: #{app_path}"
23
- end
24
- end
25
-
26
- nil
27
- end
28
-
29
8
  def showsdks
30
9
  run_synchronous_command( 'showsdks' )
31
10
  end
32
11
 
33
12
  def launch_ios_app(app_path, sdk_version, device_family)
34
- if problem = check_app_path( app_path )
13
+ if problem = SimLauncher.check_app_path( app_path )
35
14
  bangs = '!'*80
36
15
  raise "\n#{bangs}\nENCOUNTERED A PROBLEM WITH THE SPECIFIED APP PATH:\n\n#{problem}\n#{bangs}"
37
16
  end
@@ -1,3 +1,3 @@
1
1
  module SimLauncher
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sim_launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-06 00:00:00.000000000 Z
12
+ date: 2012-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70283750953620 !ruby/object:Gem::Requirement
16
+ requirement: &70156244600840 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70283750953620
24
+ version_requirements: *70156244600840
25
25
  description:
26
26
  email:
27
27
  - rubygems@thepete.net
@@ -69,4 +69,3 @@ signing_key:
69
69
  specification_version: 3
70
70
  summary: tiny HTTP server to launch an app in the iOS simulator
71
71
  test_files: []
72
- has_rdoc: