sim_launcher 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/lib/sim_launcher/client.rb +42 -0
- data/lib/sim_launcher/version.rb +1 -1
- metadata +5 -4
- data/sim_launcher.rb +0 -3
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'cgi'
|
3
|
+
require 'net/http'
|
4
|
+
|
5
|
+
module SimLauncher
|
6
|
+
class Client
|
7
|
+
DEFAULT_SERVER_URI = "http://localhost:8881"
|
8
|
+
|
9
|
+
def initialize( app_path, sdk, family )
|
10
|
+
@app_path = File.expand_path( app_path )
|
11
|
+
@sdk = sdk
|
12
|
+
@family = family
|
13
|
+
self.server_uri = DEFAULT_SERVER_URI
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.for_ipad_app( app_path, sdk = '4.2' )
|
17
|
+
self.new( app_path, sdk, 'ipad' )
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.for_iphone_app( app_path, sdk = '4.2' )
|
21
|
+
self.new( app_path, sdk, 'iphone' )
|
22
|
+
end
|
23
|
+
|
24
|
+
def server_uri=(uri)
|
25
|
+
@server_uri = URI.parse( uri.to_s )
|
26
|
+
end
|
27
|
+
|
28
|
+
def launch
|
29
|
+
full_request_uri = @server_uri.dup
|
30
|
+
full_request_uri.path = "/launch_#{@family}_app"
|
31
|
+
full_request_uri.query = "app_path=" + CGI.escape( @app_path ) + "&sdk=" + CGI.escape(@sdk)
|
32
|
+
puts "requesting #{full_request_uri}"
|
33
|
+
response = Net::HTTP.get( full_request_uri )
|
34
|
+
puts "iphonesim server reponded with:\n#{response}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def relaunch
|
38
|
+
launch
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
data/lib/sim_launcher/version.rb
CHANGED
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 2
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.2.0
|
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-
|
17
|
+
date: 2011-03-04 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -39,15 +39,16 @@ extensions: []
|
|
39
39
|
extra_rdoc_files: []
|
40
40
|
|
41
41
|
files:
|
42
|
+
- .gitignore
|
42
43
|
- .gitmodules
|
43
44
|
- Gemfile
|
44
45
|
- Rakefile
|
45
46
|
- bin/sim_launcher
|
47
|
+
- lib/sim_launcher/client.rb
|
46
48
|
- lib/sim_launcher/simulator.rb
|
47
49
|
- lib/sim_launcher/version.rb
|
48
50
|
- native/iphonesim
|
49
51
|
- sim_launcher.gemspec
|
50
|
-
- sim_launcher.rb
|
51
52
|
has_rdoc: true
|
52
53
|
homepage: http://rubygems.org/gems/sim_launcher
|
53
54
|
licenses: []
|
data/sim_launcher.rb
DELETED