sim_launcher 0.4.6 → 0.4.8.pre1

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.
@@ -18,6 +18,18 @@ module SimLauncher
18
18
  SimLauncher::Simulator.new.launch_ios_app( @app_path, @sdk, @family )
19
19
  end
20
20
 
21
+ def rotate_left
22
+ simulator = SimLauncher::Simulator.new
23
+ simulator.rotate_left
24
+ end
25
+
26
+ def rotate_right
27
+ simulator = SimLauncher::Simulator.new
28
+ simulator.rotate_right
29
+ end
30
+
31
+
32
+
21
33
  def relaunch
22
34
  simulator = SimLauncher::Simulator.new
23
35
  simulator.quit_simulator
@@ -9,13 +9,49 @@ class Simulator
9
9
  run_synchronous_command( 'showsdks' )
10
10
  end
11
11
 
12
- def launch_ios_app(app_path, sdk_version, device_family)
12
+ def start_simulator(sdk_version=nil, device_family="iphone")
13
+ sdk_version ||= SdkDetector.new(self).latest_sdk_version
14
+ run_synchronous_command( :start, '--sdk', sdk_version, '--family', device_family, '--exit' )
15
+ end
16
+
17
+
18
+ def rotate_left
19
+ script_dir = File.join(File.dirname(__FILE__),"..","..","scripts")
20
+ rotate_script = File.expand_path("#{script_dir}/rotate_simulator_left.applescript")
21
+ system("osascript #{rotate_script}")
22
+ end
23
+
24
+ def rotate_right
25
+ script_dir = File.join(File.dirname(__FILE__),"..","..","scripts")
26
+ rotate_script = File.expand_path("#{script_dir}/rotate_simulator_right.applescript")
27
+ system("osascript #{rotate_script}")
28
+ end
29
+
30
+ def reset(sdks=nil)
31
+ script_dir = File.join(File.dirname(__FILE__),"..","..","scripts")
32
+ reset_script = File.expand_path("#{script_dir}/reset_simulator.applescript")
33
+
34
+ sdks ||= SimLauncher::SdkDetector.new(self).available_sdk_versions
35
+
36
+ sdks.each do |sdk_path_str|
37
+ start_simulator(sdk_path_str,"iphone")
38
+ system("osascript #{reset_script}")
39
+ start_simulator(sdk_path_str,"ipad")
40
+ system("osascript #{reset_script}")
41
+ end
42
+
43
+ quit_simulator
44
+
45
+ end
46
+
47
+ def launch_ios_app(app_path, sdk_version, device_family, app_args = nil)
13
48
  if problem = SimLauncher.check_app_path( app_path )
14
49
  bangs = '!'*80
15
50
  raise "\n#{bangs}\nENCOUNTERED A PROBLEM WITH THE SPECIFIED APP PATH:\n\n#{problem}\n#{bangs}"
16
51
  end
17
52
  sdk_version ||= SdkDetector.new(self).latest_sdk_version
18
- run_synchronous_command( :launch, app_path, '--sdk', sdk_version, '--family', device_family, '--exit' )
53
+ args = ["--args"] + app_args.flatten if app_args
54
+ run_synchronous_command( :launch, app_path, '--sdk', sdk_version, '--family', device_family, '--exit', *args )
19
55
  end
20
56
 
21
57
  def launch_ipad_app( app_path, sdk )
@@ -1,3 +1,3 @@
1
1
  module SimLauncher
2
- VERSION = "0.4.6"
2
+ VERSION = "0.4.8.pre1"
3
3
  end
data/native/ios-sim CHANGED
Binary file
@@ -0,0 +1,18 @@
1
+ tell application "System Events"
2
+
3
+ tell process "iPhone Simulator"
4
+
5
+ tell menu bar 1
6
+ tell menu bar item "iOs Simulator"
7
+ tell menu "iOs Simulator"
8
+ click menu item "Reset Content and Settings�"
9
+ end tell
10
+ end tell
11
+ end tell
12
+ delay 1
13
+ perform action "AXRaise" of window 1
14
+ tell window 1
15
+ click button "Reset"
16
+ end tell
17
+ end tell
18
+ end tell
@@ -0,0 +1,13 @@
1
+ tell application "System Events"
2
+
3
+ tell process "iPhone Simulator"
4
+
5
+ tell menu bar 1
6
+ tell menu bar item "Hardware"
7
+ tell menu "Hardware"
8
+ click menu item "Rotate Left"
9
+ end tell
10
+ end tell
11
+ end tell
12
+ end tell
13
+ end tell
@@ -0,0 +1,13 @@
1
+ tell application "System Events"
2
+
3
+ tell process "iPhone Simulator"
4
+
5
+ tell menu bar 1
6
+ tell menu bar item "Hardware"
7
+ tell menu "Hardware"
8
+ click menu item "Rotate Right"
9
+ end tell
10
+ end tell
11
+ end tell
12
+ end tell
13
+ end tell
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sim_launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
5
- prerelease:
4
+ version: 0.4.8.pre1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Pete Hodgson
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-01 00:00:00.000000000 Z
12
+ date: 2013-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70156244600840 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,12 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70156244600840
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  description:
26
31
  email:
27
32
  - rubygems@thepete.net
@@ -43,6 +48,9 @@ files:
43
48
  - lib/sim_launcher/version.rb
44
49
  - native/ios-sim
45
50
  - native/iphonesim
51
+ - scripts/reset_simulator.applescript
52
+ - scripts/rotate_simulator_left.applescript
53
+ - scripts/rotate_simulator_right.applescript
46
54
  - sim_launcher.gemspec
47
55
  homepage: http://rubygems.org/gems/sim_launcher
48
56
  licenses: []
@@ -59,13 +67,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
67
  required_rubygems_version: !ruby/object:Gem::Requirement
60
68
  none: false
61
69
  requirements:
62
- - - ! '>='
70
+ - - ! '>'
63
71
  - !ruby/object:Gem::Version
64
- version: '0'
72
+ version: 1.3.1
65
73
  requirements: []
66
74
  rubyforge_project:
67
- rubygems_version: 1.8.10
75
+ rubygems_version: 1.8.24
68
76
  signing_key:
69
77
  specification_version: 3
70
78
  summary: tiny HTTP server to launch an app in the iOS simulator
71
79
  test_files: []
80
+ has_rdoc: