iCuke 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +27 -0
- data/VERSION +1 -1
- data/iCuke.gemspec +2 -1
- data/lib/icuke/simulator.rb +53 -26
- metadata +3 -2
data/History.txt
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
== 0.4.8 (2010-04-22)
|
2
|
+
|
3
|
+
=== Stability
|
4
|
+
* Try quitting XCode and restarting it if we aren't able to load the simulator
|
5
|
+
|
6
|
+
== 0.4.7 (2010-04-22)
|
7
|
+
|
8
|
+
=== Bugfixes
|
9
|
+
* Work around a bug in some Ruby 1.8.7.* Net::HTTP code which causes the simulator to raise NoMethodError (Rob Holland, Aslak Hellesøy)
|
10
|
+
|
11
|
+
== 0.4.6 (2010-04-21)
|
12
|
+
|
13
|
+
=== Bugfixes
|
14
|
+
* Depend on cucumber and nokogiri
|
15
|
+
* Escape values and labels in XML so we don't produce invalid markup
|
16
|
+
|
17
|
+
== 0.4.5 (2010-04-21)
|
18
|
+
|
19
|
+
=== Bugfixes
|
20
|
+
* More reliable keyboard switching
|
21
|
+
|
22
|
+
== 0.4.4 (2010-04-21)
|
23
|
+
|
24
|
+
=== Bugfixes
|
25
|
+
* Allow ' in xpath queries
|
26
|
+
* Allow typing spaces in inputs
|
27
|
+
* Correct swipe behaviour in all directions (Rob Holland, Dominic Baggott)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.8
|
data/iCuke.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{iCuke}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rob Holland"]
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
]
|
20
20
|
s.files = [
|
21
21
|
".gitignore",
|
22
|
+
"History.txt",
|
22
23
|
"LICENSE",
|
23
24
|
"README.rdoc",
|
24
25
|
"Rakefile",
|
data/lib/icuke/simulator.rb
CHANGED
@@ -6,6 +6,7 @@ require 'timeout'
|
|
6
6
|
|
7
7
|
module ICuke
|
8
8
|
class Simulator
|
9
|
+
include Timeout
|
9
10
|
include HTTParty
|
10
11
|
base_uri 'http://localhost:50000'
|
11
12
|
|
@@ -22,41 +23,67 @@ module ICuke
|
|
22
23
|
simulator = Appscript.app('iPhone Simulator.app')
|
23
24
|
simulator.quit if simulator.is_running?
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
project
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
26
|
+
begin
|
27
|
+
project = open_project(project_file)
|
28
|
+
|
29
|
+
settings = {
|
30
|
+
:active_build_configuration_type => project.build_configuration_types[options[:configuration]]
|
31
|
+
}
|
32
|
+
if options[:target]
|
33
|
+
settings[:active_target] = project.targets[options[:target]]
|
34
|
+
end
|
35
|
+
|
36
|
+
with_settings(project, settings) do
|
37
|
+
executable = project.active_executable.get
|
38
|
+
options[:env].each_pair do |name, value|
|
39
|
+
executable.make :new => :environment_variable,
|
40
|
+
:with_properties => { :name => name, :value => value, :active => true }
|
41
|
+
end
|
42
|
+
|
43
|
+
project.launch_
|
44
|
+
|
45
|
+
timeout(30) do
|
46
|
+
sleep(0.5) until simulator.is_running?
|
47
|
+
end
|
48
|
+
end
|
49
|
+
rescue Timeout::Error
|
50
|
+
xcode = Appscript.app('Xcode.app')
|
51
|
+
xcode.quit if xcode.is_running?
|
52
|
+
sleep(0.5) until !xcode.is_running?
|
53
|
+
retry
|
42
54
|
end
|
43
|
-
project.launch_
|
44
55
|
|
45
|
-
|
56
|
+
timeout(30) do
|
46
57
|
begin
|
47
58
|
view
|
48
59
|
rescue Errno::ECONNREFUSED
|
49
|
-
sleep(0.
|
60
|
+
sleep(0.5)
|
50
61
|
retry
|
51
62
|
end
|
52
63
|
end
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
64
|
+
end
|
65
|
+
|
66
|
+
def open_project(project_file)
|
67
|
+
xcode = Appscript.app('Xcode.app')
|
68
|
+
unless xcode.active_project_document.get and xcode.active_project_document.project.path.get == project_file
|
69
|
+
xcode.launch
|
70
|
+
xcode.open project_file
|
71
|
+
end
|
72
|
+
xcode.active_project_document.project
|
73
|
+
end
|
74
|
+
|
75
|
+
def with_settings(project, settings, &block)
|
76
|
+
initial_settings = {}
|
77
|
+
|
78
|
+
settings.each_key { |setting| initial_settings[setting] = project.send(setting).get }
|
79
|
+
settings.each_pair do |setting, value|
|
80
|
+
project.send(setting).set value
|
57
81
|
end
|
58
|
-
|
59
|
-
|
82
|
+
|
83
|
+
yield
|
84
|
+
ensure
|
85
|
+
initial_settings.each_pair do |setting, value|
|
86
|
+
project.send(setting).set value
|
60
87
|
end
|
61
88
|
end
|
62
89
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 0.4.
|
8
|
+
- 8
|
9
|
+
version: 0.4.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Rob Holland
|
@@ -76,6 +76,7 @@ extra_rdoc_files:
|
|
76
76
|
- README.rdoc
|
77
77
|
files:
|
78
78
|
- .gitignore
|
79
|
+
- History.txt
|
79
80
|
- LICENSE
|
80
81
|
- README.rdoc
|
81
82
|
- Rakefile
|