iCuke 0.5.5 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.gitmodules +3 -0
- data/README.rdoc +8 -7
- data/Rakefile +10 -30
- data/VERSION +1 -1
- data/app/.gitignore +3 -0
- data/app/LICENSE +20 -0
- data/app/Readme.markdown +3 -0
- data/app/Shared/AppDelegate_Shared.h +17 -0
- data/app/Shared/AppDelegate_Shared.m +25 -0
- data/app/{images/yellowslide.png → Shared/Icon.png} +0 -0
- data/app/Shared/ModalViewController.h +15 -0
- data/app/Shared/ModalViewController.m +96 -0
- data/app/Shared/TestViewController_Shared.h +15 -0
- data/app/Shared/TestViewController_Shared.m +43 -0
- data/app/{Info.plist → Shared/Universal-Info.plist} +17 -4
- data/app/Shared/Universal_Prefix.pch +8 -0
- data/app/Shared/main.m +14 -0
- data/app/Universal.xcodeproj/project.pbxproj +301 -0
- data/app/iPad/AppDelegate_Pad.h +15 -0
- data/app/iPad/AppDelegate_Pad.m +28 -0
- data/app/iPad/Default-Landscape.png +0 -0
- data/app/iPad/Default-Portrait.png +0 -0
- data/app/iPad/MainWindow_Pad.xib +343 -0
- data/app/iPad/TestViewController_Pad.h +15 -0
- data/app/iPad/TestViewController_Pad.m +52 -0
- data/app/iPhone/AppDelegate_Phone.h +15 -0
- data/app/iPhone/AppDelegate_Phone.m +28 -0
- data/app/{images/segment_search.png → iPhone/Default.png} +0 -0
- data/app/iPhone/MainWindow_Phone.xib +363 -0
- data/app/iPhone/TestViewController_Phone.h +15 -0
- data/app/iPhone/TestViewController_Phone.m +36 -0
- data/bin/.gitignore +1 -0
- data/bin/icuke +10 -0
- data/bin/icuke-module +17 -0
- data/ext/.gitignore +1 -0
- data/ext/Rakefile +6 -0
- data/ext/WaxSim/Simulator.h +31 -0
- data/ext/WaxSim/Simulator.m +131 -0
- data/ext/WaxSim/WaxSim.m +110 -0
- data/ext/WaxSim/WaxSim.xcodeproj/project.pbxproj +238 -0
- data/ext/WaxSim/WaxSim_Prefix.pch +7 -0
- data/ext/WaxSim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h +126 -0
- data/ext/iCuke/Rakefile +14 -17
- data/ext/iCuke/libicuke-sdk3.1.dylib +0 -0
- data/ext/iCuke/libicuke-sdk4.0.dylib +0 -0
- data/ext/iCuke/libicuke.dylib +0 -0
- data/ext/iCuke/{DefaultsResponse.h → sdk3.1/DefaultsResponse.h} +0 -0
- data/ext/iCuke/{DefaultsResponse.m → sdk3.1/DefaultsResponse.m} +0 -0
- data/ext/iCuke/{EventResponse.h → sdk3.1/EventResponse.h} +0 -0
- data/ext/iCuke/{EventResponse.m → sdk3.1/EventResponse.m} +0 -0
- data/ext/iCuke/sdk3.1/ModuleResponse.h +5 -0
- data/ext/iCuke/sdk3.1/ModuleResponse.m +76 -0
- data/ext/iCuke/sdk3.1/Rakefile +20 -0
- data/ext/iCuke/{Recorder.h → sdk3.1/Recorder.h} +0 -0
- data/ext/iCuke/{Recorder.m → sdk3.1/Recorder.m} +0 -0
- data/ext/iCuke/{RecorderResponse.h → sdk3.1/RecorderResponse.h} +0 -0
- data/ext/iCuke/{RecorderResponse.m → sdk3.1/RecorderResponse.m} +0 -0
- data/ext/iCuke/{SynthesizeSingleton.h → sdk3.1/SynthesizeSingleton.h} +0 -0
- data/ext/iCuke/{ViewResponse.h → sdk3.1/ViewResponse.h} +0 -0
- data/ext/iCuke/{ViewResponse.m → sdk3.1/ViewResponse.m} +0 -0
- data/ext/iCuke/{Viewer.h → sdk3.1/Viewer.h} +0 -0
- data/ext/iCuke/sdk3.1/Viewer.m +203 -0
- data/ext/iCuke/{iCukeHTTPResponseHandler.h → sdk3.1/iCukeHTTPResponseHandler.h} +0 -0
- data/ext/iCuke/{iCukeHTTPResponseHandler.m → sdk3.1/iCukeHTTPResponseHandler.m} +0 -0
- data/ext/iCuke/{iCukeHTTPServer.h → sdk3.1/iCukeHTTPServer.h} +0 -0
- data/ext/iCuke/{iCukeHTTPServer.m → sdk3.1/iCukeHTTPServer.m} +0 -0
- data/ext/iCuke/{iCukeServer.h → sdk3.1/iCukeServer.h} +0 -2
- data/ext/iCuke/{iCukeServer.m → sdk3.1/iCukeServer.m} +22 -20
- data/ext/iCuke/{json → sdk3.1/json}/JSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSObject+SBJSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSObject+SBJSON.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSString+SBJSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/NSString+SBJSON.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJSON.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJSON.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonBase.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonBase.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonParser.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonParser.m +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonWriter.h +0 -0
- data/ext/iCuke/{json → sdk3.1/json}/SBJsonWriter.m +0 -0
- data/ext/iCuke/sdk4.0/DefaultsResponse.h +5 -0
- data/ext/iCuke/sdk4.0/DefaultsResponse.m +66 -0
- data/ext/iCuke/sdk4.0/EventResponse.h +5 -0
- data/ext/iCuke/sdk4.0/EventResponse.m +130 -0
- data/ext/iCuke/sdk4.0/ModuleResponse.h +5 -0
- data/ext/iCuke/sdk4.0/ModuleResponse.m +76 -0
- data/ext/iCuke/sdk4.0/Rakefile +20 -0
- data/ext/iCuke/sdk4.0/Recorder.h +17 -0
- data/ext/iCuke/sdk4.0/Recorder.m +90 -0
- data/ext/iCuke/sdk4.0/RecorderResponse.h +6 -0
- data/ext/iCuke/sdk4.0/RecorderResponse.m +68 -0
- data/ext/iCuke/sdk4.0/SynthesizeSingleton.h +68 -0
- data/ext/iCuke/sdk4.0/ViewResponse.h +5 -0
- data/ext/iCuke/sdk4.0/ViewResponse.m +84 -0
- data/ext/iCuke/sdk4.0/Viewer.h +8 -0
- data/ext/iCuke/{Viewer.m → sdk4.0/Viewer.m} +14 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.h +50 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPResponseHandler.m +381 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPServer.h +53 -0
- data/ext/iCuke/sdk4.0/iCukeHTTPServer.m +365 -0
- data/ext/iCuke/sdk4.0/iCukeServer.h +14 -0
- data/ext/iCuke/sdk4.0/iCukeServer.m +65 -0
- data/ext/iCuke/sdk4.0/json/JSON.h +50 -0
- data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.h +68 -0
- data/ext/iCuke/sdk4.0/json/NSObject+SBJSON.m +53 -0
- data/ext/iCuke/sdk4.0/json/NSString+SBJSON.h +58 -0
- data/ext/iCuke/sdk4.0/json/NSString+SBJSON.m +55 -0
- data/ext/iCuke/sdk4.0/json/SBJSON.h +75 -0
- data/ext/iCuke/sdk4.0/json/SBJSON.m +212 -0
- data/ext/iCuke/sdk4.0/json/SBJsonBase.h +86 -0
- data/ext/iCuke/sdk4.0/json/SBJsonBase.m +78 -0
- data/ext/iCuke/sdk4.0/json/SBJsonParser.h +87 -0
- data/ext/iCuke/sdk4.0/json/SBJsonParser.m +475 -0
- data/ext/iCuke/sdk4.0/json/SBJsonWriter.h +129 -0
- data/ext/iCuke/sdk4.0/json/SBJsonWriter.m +228 -0
- data/features/iphone.feature +15 -0
- data/features/support/env.rb +1 -1
- data/iCuke.gemspec +118 -114
- data/lib/icuke/cucumber.rb +93 -64
- data/lib/icuke/screen.rb +110 -0
- data/lib/icuke/sdk.rb +134 -0
- data/lib/icuke/simulate.rb +9 -5
- data/lib/icuke/simulator.rb +10 -11
- data/lib/icuke/waxsim.rb +36 -0
- data/lib/icuke.rb +2 -1
- metadata +124 -129
- data/app/AlertsViewController.h +0 -59
- data/app/AlertsViewController.m +0 -341
- data/app/AppDelegate.h +0 -60
- data/app/AppDelegate.m +0 -101
- data/app/ButtonsViewController.h +0 -80
- data/app/ButtonsViewController.m +0 -448
- data/app/Constants.h +0 -58
- data/app/ControlsViewController.h +0 -72
- data/app/ControlsViewController.m +0 -379
- data/app/ImagesViewController.h +0 -62
- data/app/ImagesViewController.m +0 -137
- data/app/MainViewController.h +0 -57
- data/app/MainViewController.m +0 -262
- data/app/Picker/CustomPickerDataSource.h +0 -55
- data/app/Picker/CustomPickerDataSource.m +0 -135
- data/app/Picker/CustomView.h +0 -62
- data/app/Picker/CustomView.m +0 -119
- data/app/PickerViewController.h +0 -88
- data/app/PickerViewController.m +0 -402
- data/app/Prefix.pch +0 -5
- data/app/ReadMe.txt +0 -82
- data/app/SearchBarController.h +0 -58
- data/app/SearchBarController.m +0 -105
- data/app/SegmentViewController.h +0 -54
- data/app/SegmentViewController.m +0 -195
- data/app/TextFieldController.h +0 -67
- data/app/TextFieldController.m +0 -342
- data/app/TextViewController.h +0 -57
- data/app/TextViewController.m +0 -164
- data/app/ToolbarViewController.h +0 -74
- data/app/ToolbarViewController.m +0 -303
- data/app/TransitionViewController.h +0 -64
- data/app/TransitionViewController.m +0 -178
- data/app/UICatalog.xcodeproj/project.pbxproj +0 -615
- data/app/WebViewController.h +0 -57
- data/app/WebViewController.m +0 -173
- data/app/en.lproj/AlertsViewController.xib +0 -144
- data/app/en.lproj/ButtonsViewController.xib +0 -147
- data/app/en.lproj/ControlsViewController.xib +0 -147
- data/app/en.lproj/ImagesViewController.xib +0 -264
- data/app/en.lproj/Localizable.strings +0 -41
- data/app/en.lproj/MainWindow.xib +0 -306
- data/app/en.lproj/PickerViewController.xib +0 -415
- data/app/en.lproj/SearchBarController.xib +0 -142
- data/app/en.lproj/SegmentViewController.xib +0 -143
- data/app/en.lproj/TextFieldController.xib +0 -167
- data/app/en.lproj/TextViewController.xib +0 -149
- data/app/en.lproj/ToolbarViewController.xib +0 -491
- data/app/en.lproj/TransitionViewController.xib +0 -255
- data/app/en.lproj/WebViewController.xib +0 -141
- data/app/images/12-6AM.png +0 -0
- data/app/images/12-6PM.png +0 -0
- data/app/images/6-12AM.png +0 -0
- data/app/images/6-12PM.png +0 -0
- data/app/images/Default.png +0 -0
- data/app/images/Icon.png +0 -0
- data/app/images/UIButton_custom.png +0 -0
- data/app/images/blueButton.png +0 -0
- data/app/images/orangeslide.png +0 -0
- data/app/images/scene1.jpg +0 -0
- data/app/images/scene2.jpg +0 -0
- data/app/images/scene3.jpg +0 -0
- data/app/images/scene4.jpg +0 -0
- data/app/images/scene5.jpg +0 -0
- data/app/images/segment_check.png +0 -0
- data/app/images/segment_tools.png +0 -0
- data/app/images/slider_ball.png +0 -0
- data/app/images/whiteButton.png +0 -0
- data/app/main.m +0 -58
- data/features/uicatalog.feature +0 -20
- data/lib/icuke/com.apple.Accessibility.plist +0 -0
- data/lib/icuke/headless.rb +0 -54
- data/lib/icuke/xcode.rb +0 -164
data/lib/icuke/xcode.rb
DELETED
@@ -1,164 +0,0 @@
|
|
1
|
-
require 'appscript'
|
2
|
-
require 'timeout'
|
3
|
-
|
4
|
-
module ICuke
|
5
|
-
class XCode
|
6
|
-
def self.app
|
7
|
-
@app ||= Appscript.app('Xcode.app')
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.open_project(project_file)
|
11
|
-
unless open_project?(project_file)
|
12
|
-
app.launch
|
13
|
-
app.open project_file
|
14
|
-
end
|
15
|
-
app.active_project_document.project
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.open_project?(project_file)
|
19
|
-
running? and
|
20
|
-
app.active_project_document.get and
|
21
|
-
app.active_project_document.project.path.get == project_file
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.interface
|
25
|
-
Appscript.app('System Events').application_processes['Xcode']
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.running?
|
29
|
-
app.is_running?
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.quit
|
33
|
-
IPhoneSimulator.quit
|
34
|
-
app.quit if running?
|
35
|
-
sleep(0.2) until !running?
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.status
|
39
|
-
interface.windows[1].static_texts[0].value.get
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.launched_app?
|
43
|
-
status =~ /launched$/
|
44
|
-
end
|
45
|
-
|
46
|
-
def self.installing_app?
|
47
|
-
status =~ /^Installing/
|
48
|
-
end
|
49
|
-
|
50
|
-
def self.with_settings(project, settings, &block)
|
51
|
-
initial_settings = {}
|
52
|
-
|
53
|
-
settings.each_key { |setting| initial_settings[setting] = project.send(setting).get }
|
54
|
-
settings.each_pair do |setting, value|
|
55
|
-
project.send(setting).set value
|
56
|
-
end
|
57
|
-
|
58
|
-
yield
|
59
|
-
ensure
|
60
|
-
initial_settings.each_pair do |setting, value|
|
61
|
-
project.send(setting).set value
|
62
|
-
end if running?
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
class IPhoneSimulator
|
67
|
-
def self.app
|
68
|
-
@app ||= Appscript.app('iPhone Simulator.app')
|
69
|
-
end
|
70
|
-
|
71
|
-
def self.quit
|
72
|
-
app.quit if running?
|
73
|
-
sleep(0.2) until !running?
|
74
|
-
end
|
75
|
-
|
76
|
-
def self.running?
|
77
|
-
app.is_running?
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
class Simulator
|
82
|
-
include Timeout
|
83
|
-
|
84
|
-
def launch(project_file, options = {})
|
85
|
-
options = {
|
86
|
-
:target => nil,
|
87
|
-
:configuration => 'Debug'
|
88
|
-
}.merge(options)
|
89
|
-
|
90
|
-
# If we don't kill the simulator first the rest of this function becomes
|
91
|
-
# a no-op and we don't land on the applications first page
|
92
|
-
IPhoneSimulator.quit
|
93
|
-
|
94
|
-
begin
|
95
|
-
project = XCode.open_project(project_file)
|
96
|
-
|
97
|
-
settings = {
|
98
|
-
:active_build_configuration_type => project.build_configuration_types[options[:configuration]]
|
99
|
-
}
|
100
|
-
if options[:target]
|
101
|
-
settings[:active_target] = project.targets[options[:target]]
|
102
|
-
end
|
103
|
-
|
104
|
-
set_preferences
|
105
|
-
|
106
|
-
XCode.with_settings(project, settings) do
|
107
|
-
executable = project.active_executable.get
|
108
|
-
options[:env].each_pair do |name, value|
|
109
|
-
executable.make :new => :environment_variable,
|
110
|
-
:with_properties => { :name => name, :value => value, :active => true }
|
111
|
-
end
|
112
|
-
|
113
|
-
project.launch_
|
114
|
-
|
115
|
-
sleep(0.5) while XCode.installing_app?
|
116
|
-
|
117
|
-
unless XCode.launched_app?
|
118
|
-
XCode.quit
|
119
|
-
retry
|
120
|
-
end
|
121
|
-
|
122
|
-
timeout(30) do
|
123
|
-
begin
|
124
|
-
view
|
125
|
-
rescue Errno::ECONNREFUSED
|
126
|
-
sleep(0.5)
|
127
|
-
retry
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
def quit
|
135
|
-
IPhoneSimulator.quit
|
136
|
-
restore_preferences
|
137
|
-
end
|
138
|
-
|
139
|
-
private
|
140
|
-
|
141
|
-
def accessibility_plist
|
142
|
-
File.expand_path(File.join('~', 'Library', 'Application Support', 'iPhone Simulator', '3.1.2', 'Library', 'Preferences', 'com.apple.Accessibility.plist'))
|
143
|
-
end
|
144
|
-
|
145
|
-
def accessibility_plist_backup
|
146
|
-
accessibility_plist + '.icuke'
|
147
|
-
end
|
148
|
-
|
149
|
-
def restore_preferences
|
150
|
-
if File.exists? accessibility_plist_backup
|
151
|
-
FileUtils.mv accessibility_plist_backup, accessibility_plist
|
152
|
-
else
|
153
|
-
FileUtils.rm accessibility_plist
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
def set_preferences
|
158
|
-
if File.exists? accessibility_plist
|
159
|
-
FileUtils.mv accessibility_plist, accessibility_plist_backup
|
160
|
-
end
|
161
|
-
FileUtils.cp File.join(File.dirname(__FILE__), 'com.apple.Accessibility.plist'), accessibility_plist
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|