sim_launcher 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/bin/sim_launcher CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'rubygems'
4
4
  require 'sinatra'
5
5
 
6
- require 'sim_launcher/simulator'
6
+ require 'sim_launcher'
7
7
 
8
8
  # SimLauncher starts on port 8881 by default. To specify a custom port just pass it as the first command line argument.
9
9
  set :port, (ARGV[0] || 8881)
@@ -13,11 +13,11 @@ module SimLauncher
13
13
  self.server_uri = DEFAULT_SERVER_URI
14
14
  end
15
15
 
16
- def self.for_ipad_app( app_path, sdk = '4.2' )
16
+ def self.for_ipad_app( app_path, sdk = nil )
17
17
  self.new( app_path, sdk, 'ipad' )
18
18
  end
19
19
 
20
- def self.for_iphone_app( app_path, sdk = '4.2' )
20
+ def self.for_iphone_app( app_path, sdk = nil )
21
21
  self.new( app_path, sdk, 'iphone' )
22
22
  end
23
23
 
@@ -6,11 +6,11 @@ module SimLauncher
6
6
  @family = family
7
7
  end
8
8
 
9
- def self.for_ipad_app( app_path, sdk = '4.2' )
9
+ def self.for_ipad_app( app_path, sdk = nil )
10
10
  self.new( app_path, sdk, 'ipad' )
11
11
  end
12
12
 
13
- def self.for_iphone_app( app_path, sdk = '4.2' )
13
+ def self.for_iphone_app( app_path, sdk = nil )
14
14
  self.new( app_path, sdk, 'iphone' )
15
15
  end
16
16
 
@@ -0,0 +1,16 @@
1
+ require 'singleton'
2
+
3
+ module SimLauncher
4
+ class SdkDetector
5
+ include Singleton
6
+
7
+ def latest_sdk_version
8
+ unless @latest_sdk_version
9
+ latest_iphone_sdk = `xcodebuild -showsdks | grep -o "iphonesimulator.*$"`.split.sort.last
10
+ @latest_sdk_version = latest_iphone_sdk[/iphonesimulator(.*)/,1]
11
+ end
12
+ @latest_sdk_version
13
+ end
14
+
15
+ end
16
+ end
@@ -14,12 +14,12 @@ class Simulator
14
14
  end
15
15
 
16
16
  def launch_ipad_app( app_path, sdk )
17
- sdk ||= '3.2'
17
+ sdk ||= SdkDetector.instance.latest_sdk_version
18
18
  launch_ios_app( app_path, sdk, 'ipad' )
19
19
  end
20
20
 
21
21
  def launch_iphone_app( app_path, sdk )
22
- sdk ||= '4.0'
22
+ sdk ||= SdkDetector.instance.latest_sdk_version
23
23
  launch_ios_app( app_path, sdk, 'iphone' )
24
24
  end
25
25
 
@@ -1,3 +1,3 @@
1
1
  module SimLauncher
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/lib/sim_launcher.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  require 'sim_launcher/client'
2
2
  require 'sim_launcher/direct_client'
3
3
  require 'sim_launcher/simulator'
4
+ require 'sim_launcher/sdk_detector'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Pete Hodgson
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-03-20 00:00:00 -07:00
17
+ date: 2011-08-13 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -47,6 +47,7 @@ files:
47
47
  - lib/sim_launcher.rb
48
48
  - lib/sim_launcher/client.rb
49
49
  - lib/sim_launcher/direct_client.rb
50
+ - lib/sim_launcher/sdk_detector.rb
50
51
  - lib/sim_launcher/simulator.rb
51
52
  - lib/sim_launcher/version.rb
52
53
  - native/iphonesim