ProMotion 1.2.1 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -10
- data/lib/ProMotion.rb +11 -2
- data/lib/ProMotion/cocoatouch/ns_string.rb +5 -0
- data/lib/ProMotion/cocoatouch/ns_url.rb +5 -0
- data/lib/ProMotion/cocoatouch/tab_bar_controller.rb +5 -7
- data/lib/ProMotion/cocoatouch/table_view_cell.rb +0 -16
- data/lib/ProMotion/cocoatouch/table_view_controller.rb +2 -3
- data/lib/ProMotion/cocoatouch/view_controller.rb +3 -6
- data/lib/ProMotion/delegate/delegate.rb +0 -3
- data/lib/ProMotion/delegate/delegate_module.rb +24 -20
- data/lib/ProMotion/{containers → ipad}/split_screen.rb +30 -32
- data/lib/ProMotion/{logger.rb → logger/logger.rb} +6 -5
- data/lib/ProMotion/screen/nav_bar_module.rb +126 -0
- data/lib/ProMotion/screen/screen.rb +0 -3
- data/lib/ProMotion/screen/screen_module.rb +54 -177
- data/lib/ProMotion/screen/screen_navigation.rb +29 -40
- data/lib/ProMotion/{view → styling}/styling.rb +17 -47
- data/lib/ProMotion/table/cell/table_view_cell_module.rb +76 -123
- data/lib/ProMotion/table/data/table_data.rb +1 -1
- data/lib/ProMotion/table/extensions/longpressable.rb +24 -0
- data/lib/ProMotion/table/extensions/refreshable.rb +1 -0
- data/lib/ProMotion/table/grouped_table_screen.rb +0 -5
- data/lib/ProMotion/table/table.rb +63 -83
- data/lib/ProMotion/table/table_screen.rb +0 -4
- data/lib/ProMotion/{containers → tabs}/tabs.rb +20 -21
- data/lib/ProMotion/version.rb +1 -1
- data/lib/ProMotion/web/web_screen.rb +0 -4
- data/lib/ProMotion/web/web_screen_module.rb +8 -5
- data/spec/functional/func_screen_spec.rb +14 -18
- data/spec/functional/func_split_screen_spec.rb +2 -2
- data/spec/functional/func_table_screen_spec.rb +54 -40
- data/spec/functional/func_web_screen_spec.rb +12 -17
- data/spec/helpers/test_helper.rb +27 -0
- data/spec/unit/delegate_spec.rb +4 -67
- data/spec/unit/image_title_screen.rb +9 -0
- data/spec/unit/image_view_title_screen.rb +9 -0
- data/spec/unit/load_view_spec.rb +27 -0
- data/spec/unit/main_spec.rb +0 -6
- data/spec/unit/screen_helpers_spec.rb +23 -17
- data/spec/unit/screen_spec.rb +21 -17
- data/spec/unit/searchable_table_spec.rb +55 -0
- data/spec/unit/split_screen_in_tab_bar_spec.rb +5 -5
- data/spec/unit/split_screen_spec.rb +4 -4
- data/spec/unit/tab_bar_spec.rb +79 -0
- data/spec/unit/tab_spec.rb +11 -5
- data/spec/unit/tables/table_module_spec.rb +22 -8
- data/spec/unit/tables/table_screen_spec.rb +1 -1
- data/spec/unit/tables/table_view_cell_spec.rb +16 -16
- data/spec/unit/view_helper_spec.rb +6 -81
- data/spec/unit/view_title_screen.rb +10 -0
- data/spec/unit/web_spec.rb +31 -37
- metadata +37 -111
- data/.gitignore +0 -33
- data/.travis.yml +0 -4
- data/CONTRIBUTING.md +0 -20
- data/Gemfile +0 -5
- data/LICENSE +0 -22
- data/ProMotion.gemspec +0 -30
- data/Rakefile +0 -66
- data/app/app_delegate.rb +0 -7
- data/app/screens/basic_screen.rb +0 -15
- data/lib/ProMotion/delegate/delegate_notifications.rb +0 -70
- data/lib/ProMotion/extensions/conversions.rb +0 -20
- data/lib/ProMotion/map/map_screen.rb +0 -10
- data/lib/ProMotion/map/map_screen_annotation.rb +0 -65
- data/lib/ProMotion/map/map_screen_module.rb +0 -212
- data/lib/ProMotion/push_notification/push_notification.rb +0 -58
- data/resources/WebScreen.html +0 -6
- data/resources/list.png +0 -0
- data/resources/test.png +0 -0
- data/spec/functional/func_image_title_screen.rb +0 -20
- data/spec/functional/func_image_view_title_screen.rb +0 -20
- data/spec/functional/func_map_screen_spec.rb +0 -162
- data/spec/functional/func_searchable_table_spec.rb +0 -56
- data/spec/functional/func_tab_bar_spec.rb +0 -78
- data/spec/functional/func_view_title_screen.rb +0 -21
- data/spec/helpers/basic_screen.rb +0 -3
- data/spec/helpers/custom_title_view.rb +0 -4
- data/spec/helpers/detail_screen.rb +0 -3
- data/spec/helpers/dummy_class.rb +0 -3
- data/spec/helpers/functional_screen.rb +0 -15
- data/spec/helpers/home_screen.rb +0 -19
- data/spec/helpers/image_title_screen.rb +0 -15
- data/spec/helpers/image_view_title_screen.rb +0 -15
- data/spec/helpers/map_screen.rb +0 -53
- data/spec/helpers/master_screen.rb +0 -3
- data/spec/helpers/present_screen.rb +0 -26
- data/spec/helpers/screen_module_view_controller.rb +0 -55
- data/spec/helpers/tab_screen.rb +0 -4
- data/spec/helpers/table_screen.rb +0 -117
- data/spec/helpers/table_screen_indexable.rb +0 -18
- data/spec/helpers/table_screen_refreshable.rb +0 -11
- data/spec/helpers/table_screen_searchable.rb +0 -72
- data/spec/helpers/test_delegate.rb +0 -34
- data/spec/helpers/test_delegate_colors.rb +0 -17
- data/spec/helpers/view_title_screen.rb +0 -15
- data/spec/helpers/web_screen.rb +0 -23
- data/spec/unit/map_spec.rb +0 -71
@@ -0,0 +1,79 @@
|
|
1
|
+
describe "PM::Tabs" do
|
2
|
+
def app
|
3
|
+
@app ||= TestDelegate.new
|
4
|
+
end
|
5
|
+
|
6
|
+
def tab_bar
|
7
|
+
@tab_bar ||= begin
|
8
|
+
@screen1 = BasicScreen.new(nav_bar: true, title: "Screen 1")
|
9
|
+
@screen2 = BasicScreen.new(nav_bar: true, title: "Screen 2")
|
10
|
+
@screen3 = BasicScreen.new(title: "Screen 3")
|
11
|
+
@screen4 = BasicScreen.new(title: "Screen 4")
|
12
|
+
|
13
|
+
app.open_tab_bar(@screen1, @screen2, @screen3, @screen4)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should create a UITabBarController" do
|
18
|
+
tab_bar
|
19
|
+
app.window.rootViewController.should.be.kind_of UITabBarController
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should have four tabs" do
|
23
|
+
tab_bar.viewControllers.length.should == 4
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should have the right screens in the right places" do
|
27
|
+
tab_bar.viewControllers[0].should == @screen1.navigationController
|
28
|
+
tab_bar.viewControllers[1].should == @screen2.navigationController
|
29
|
+
tab_bar.viewControllers[2].should == @screen3
|
30
|
+
tab_bar.viewControllers[3].should == @screen4
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should allow opening a tab by the name from any screen" do
|
34
|
+
@screen1.open_tab "Screen 2"
|
35
|
+
tab_bar.selectedIndex.should == 1
|
36
|
+
@screen2.open_tab "Screen 3"
|
37
|
+
tab_bar.selectedIndex.should == 2
|
38
|
+
@screen3.open_tab "Screen 4"
|
39
|
+
tab_bar.selectedIndex.should == 3
|
40
|
+
@screen4.open_tab "Screen 1"
|
41
|
+
tab_bar.selectedIndex.should == 0
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should allow opening a tab by the index from any screen" do
|
45
|
+
@screen1.open_tab 1
|
46
|
+
tab_bar.selectedIndex.should == 1
|
47
|
+
@screen2.open_tab 2
|
48
|
+
tab_bar.selectedIndex.should == 2
|
49
|
+
@screen3.open_tab 3
|
50
|
+
tab_bar.selectedIndex.should == 3
|
51
|
+
@screen4.open_tab 0
|
52
|
+
tab_bar.selectedIndex.should == 0
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should allow opening a tab from the app_delegate" do
|
56
|
+
app.open_tab "Screen 2"
|
57
|
+
tab_bar.selectedIndex.should == 1
|
58
|
+
app.open_tab "Screen 3"
|
59
|
+
tab_bar.selectedIndex.should == 2
|
60
|
+
app.open_tab "Screen 4"
|
61
|
+
tab_bar.selectedIndex.should == 3
|
62
|
+
app.open_tab "Screen 1"
|
63
|
+
tab_bar.selectedIndex.should == 0
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should allow opening a tab by accessing the tab bar directly" do
|
67
|
+
tab_bar.open_tab "Screen 2"
|
68
|
+
tab_bar.selectedIndex.should == 1
|
69
|
+
tab_bar.open_tab "Screen 3"
|
70
|
+
tab_bar.selectedIndex.should == 2
|
71
|
+
tab_bar.open_tab "Screen 4"
|
72
|
+
tab_bar.selectedIndex.should == 3
|
73
|
+
tab_bar.open_tab "Screen 1"
|
74
|
+
tab_bar.selectedIndex.should == 0
|
75
|
+
end
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
end
|
data/spec/unit/tab_spec.rb
CHANGED
@@ -12,7 +12,7 @@ describe "tab bar functionality" do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
after do
|
15
|
-
|
15
|
+
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should have created a tab bar with four items" do
|
@@ -20,22 +20,28 @@ describe "tab bar functionality" do
|
|
20
20
|
@tab_bar.should.be.kind_of(UITabBarController)
|
21
21
|
@tab_bar.viewControllers.length.should == 4
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
it "should have set a custom tab bar item" do
|
25
25
|
@tab_bar.tabBar.items.first.title.should == "Tab Item"
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
it "should have set the others to their respective titles" do
|
29
29
|
@tab_bar.tabBar.items[1].title.should == "Basic"
|
30
30
|
@tab_bar.tabBar.items[2].title.should == "Home"
|
31
31
|
@tab_bar.tabBar.items[3].title.should == "TestTableScreen"
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
it "should allow changing the tab bar item with set_tab_bar_item" do
|
35
|
-
@tab_1.set_tab_bar_item title: "Custom",
|
35
|
+
@tab_1.set_tab_bar_item title: "Custom", item: "test.jpeg"
|
36
36
|
@tab_bar.tabBar.items.first.title.should == "Custom"
|
37
37
|
end
|
38
38
|
|
39
|
+
it "should allow replacing a view controller with `open`" do
|
40
|
+
new_screen = BasicScreen.new
|
41
|
+
@tab_4.open new_screen, in_tab: "Home"
|
42
|
+
@tab_bar.viewControllers[2].should == new_screen
|
43
|
+
end
|
44
|
+
|
39
45
|
end
|
40
46
|
|
41
47
|
|
@@ -11,24 +11,28 @@ describe "PM::Table module" do
|
|
11
11
|
subtitle: "This is way too huge..see note",
|
12
12
|
arguments: { data: [ "lots", "of", "data" ] },
|
13
13
|
action: :tapped_cell_1,
|
14
|
+
long_press_action: :long_press_cell_1,
|
14
15
|
height: 50, # manually changes the cell's height
|
15
16
|
cell_style: UITableViewCellStyleSubtitle,
|
16
17
|
cell_identifier: "Cell",
|
17
18
|
cell_class: PM::TableViewCell,
|
18
|
-
|
19
|
-
background_color: UIColor.colorWithPatternImage(@image),
|
20
|
-
selection_style: UITableViewCellSelectionStyleGray,
|
19
|
+
selection_style: :gray,
|
21
20
|
accessory: {
|
22
21
|
view: :switch, # currently only :switch is supported
|
23
22
|
type: UITableViewCellAccessoryCheckmark,
|
24
|
-
|
23
|
+
value: true # whether it's "checked" or not
|
25
24
|
},
|
26
25
|
image: { image: @image, radius: 15 },
|
27
26
|
remote_image: { # remote image, requires JMImageCache CocoaPod
|
28
|
-
url: "http://placekitten.com/200/300",
|
29
|
-
|
27
|
+
url: "http://placekitten.com/200/300",
|
28
|
+
placeholder: "some-local-image",
|
29
|
+
size: 50,
|
30
|
+
radius: 15
|
30
31
|
},
|
31
|
-
|
32
|
+
style: {
|
33
|
+
masks_to_bounds: true,
|
34
|
+
background_color: UIColor.colorWithPatternImage(@image)
|
35
|
+
}
|
32
36
|
})
|
33
37
|
end
|
34
38
|
|
@@ -40,7 +44,7 @@ describe "PM::Table module" do
|
|
40
44
|
},{
|
41
45
|
title: "Table cell group 2", cells: [ cell_factory ]
|
42
46
|
},{
|
43
|
-
title: "Table cell group 3", cells: [ cell_factory(title: "3-1"), cell_factory(title: "3-2", background_color: UIColor.blueColor) ]
|
47
|
+
title: "Table cell group 3", cells: [ cell_factory(title: "3-1"), cell_factory({title: "3-2", style: { background_color: UIColor.blueColor } }) ]
|
44
48
|
},{
|
45
49
|
title: "Table cell group 4", cells: [ custom_cell, cell_factory(title: "4-2"), cell_factory(title: "4-3"), cell_factory(title: "4-4") ]
|
46
50
|
},{
|
@@ -111,6 +115,16 @@ describe "PM::Table module" do
|
|
111
115
|
@subject.tableView(@subject.table_view, didSelectRowAtIndexPath:@custom_ip)
|
112
116
|
end
|
113
117
|
|
118
|
+
# TODO - make this test work when MacBacon supports long press gestures
|
119
|
+
# https://github.com/HipByte/RubyMotion/issues/160
|
120
|
+
#
|
121
|
+
# it "should trigger the right action on a long_press" do
|
122
|
+
# @subject.mock! :long_press_cell_1 do |args|
|
123
|
+
# args[:data].should == [ "lots", "of", "data" ]
|
124
|
+
# end
|
125
|
+
# tap(@subject.table_view, :at => location, :times => number_of_taps, :touches => number_of_fingers)
|
126
|
+
# end
|
127
|
+
|
114
128
|
it "should set a custom cell background image" do
|
115
129
|
@image.should.not.be.nil
|
116
130
|
ip = NSIndexPath.indexPathForRow(0, inSection: 3) # Cell 2-1
|
@@ -10,12 +10,21 @@ describe "PM::TableViewCellModule" do
|
|
10
10
|
cell_style: UITableViewCellStyleSubtitle,
|
11
11
|
cell_identifier: "Custom Cell",
|
12
12
|
cell_class: PM::TableViewCell,
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
image: {
|
18
|
-
|
13
|
+
accessory: {
|
14
|
+
view: :switch, # currently only :switch is supported
|
15
|
+
value: true
|
16
|
+
},
|
17
|
+
image: {
|
18
|
+
image: UIImage.imageNamed("list"),
|
19
|
+
radius: 15
|
20
|
+
},
|
21
|
+
selection_style: :gray,
|
22
|
+
style: {
|
23
|
+
layer: {
|
24
|
+
masks_to_bounds: true
|
25
|
+
},
|
26
|
+
background_color: UIColor.redColor
|
27
|
+
}
|
19
28
|
}
|
20
29
|
end
|
21
30
|
|
@@ -38,7 +47,7 @@ describe "PM::TableViewCellModule" do
|
|
38
47
|
{
|
39
48
|
title: "",
|
40
49
|
cells: [
|
41
|
-
{ title: "Test 1", accessory_type: UITableViewCellStateShowingEditControlMask },
|
50
|
+
{ title: "Test 1", style: { accessory_type: UITableViewCellStateShowingEditControlMask } },
|
42
51
|
custom_cell,
|
43
52
|
{ title: "Test2", accessory: { view: button } },
|
44
53
|
attributed_cell
|
@@ -127,15 +136,6 @@ describe "PM::TableViewCellModule" do
|
|
127
136
|
@subject.imageView.layer.cornerRadius.should == 15.0
|
128
137
|
end
|
129
138
|
|
130
|
-
it "should create two extra subviews" do
|
131
|
-
content_view = TestHelper.ios7 ? @subject.subviews.first : @subject
|
132
|
-
content_view.subviews.length.should == 3
|
133
|
-
content_view.subviews[1].class.should == UIView
|
134
|
-
content_view.subviews[2].class.should == UILabel
|
135
|
-
end
|
136
|
-
|
137
|
-
|
138
|
-
|
139
139
|
end
|
140
140
|
|
141
141
|
|
@@ -41,6 +41,12 @@ describe "view helpers" do
|
|
41
41
|
layered_view.layer.mask.backgroundColor.should == UIColor.redColor.CGColor
|
42
42
|
end
|
43
43
|
|
44
|
+
it "should allow you to set an accessor to a hash" do
|
45
|
+
view_with_attr = CustomTitleView.new
|
46
|
+
@dummy.set_attributes view_with_attr, { title: { jamon: 1 } }
|
47
|
+
view_with_attr.title.should == { jamon: 1 }
|
48
|
+
end
|
49
|
+
|
44
50
|
it "should allow you to set snake_case attributes" do
|
45
51
|
layered_view = UIView.alloc.initWithFrame(CGRectMake(0, 0, 10, 10))
|
46
52
|
|
@@ -91,85 +97,4 @@ describe "view helpers" do
|
|
91
97
|
|
92
98
|
end
|
93
99
|
|
94
|
-
describe "set_easy_attributes" do
|
95
|
-
|
96
|
-
before do
|
97
|
-
@dummy = UIView.alloc.initWithFrame CGRectZero
|
98
|
-
@dummy.extend ProMotion::Styling
|
99
|
-
|
100
|
-
@parent = UIView.alloc.initWithFrame(CGRectMake(0, 0, 320, 480))
|
101
|
-
@child = UIView.alloc.initWithFrame(CGRectZero)
|
102
|
-
end
|
103
|
-
|
104
|
-
it "Should set the autoresizingMask for all" do
|
105
|
-
@dummy.set_easy_attributes @parent, @child, {
|
106
|
-
resize: [:left, :right, :top, :bottom, :width, :height]
|
107
|
-
}
|
108
|
-
|
109
|
-
mask = UIViewAutoresizingFlexibleLeftMargin |
|
110
|
-
UIViewAutoresizingFlexibleRightMargin |
|
111
|
-
UIViewAutoresizingFlexibleTopMargin |
|
112
|
-
UIViewAutoresizingFlexibleBottomMargin |
|
113
|
-
UIViewAutoresizingFlexibleWidth |
|
114
|
-
UIViewAutoresizingFlexibleHeight
|
115
|
-
|
116
|
-
@child.autoresizingMask.should == mask
|
117
|
-
end
|
118
|
-
|
119
|
-
it "Should set the autoresizingMask for half" do
|
120
|
-
@dummy.set_easy_attributes @parent, @child, {
|
121
|
-
resize: [:left, :right, :top]
|
122
|
-
}
|
123
|
-
|
124
|
-
mask = UIViewAutoresizingFlexibleLeftMargin |
|
125
|
-
UIViewAutoresizingFlexibleRightMargin |
|
126
|
-
UIViewAutoresizingFlexibleTopMargin
|
127
|
-
|
128
|
-
@child.autoresizingMask.should == mask
|
129
|
-
end
|
130
|
-
|
131
|
-
it "Should set the autoresizingMask for the second half" do
|
132
|
-
@dummy.set_easy_attributes @parent, @child, {
|
133
|
-
resize: [:bottom, :width, :height]
|
134
|
-
}
|
135
|
-
|
136
|
-
mask = UIViewAutoresizingFlexibleBottomMargin |
|
137
|
-
UIViewAutoresizingFlexibleWidth |
|
138
|
-
UIViewAutoresizingFlexibleHeight
|
139
|
-
|
140
|
-
@child.autoresizingMask.should == mask
|
141
|
-
end
|
142
|
-
|
143
|
-
it "Should not set the autoresizingMask" do
|
144
|
-
@dummy.set_easy_attributes @parent, @child, {}
|
145
|
-
|
146
|
-
mask = UIViewAutoresizingNone
|
147
|
-
|
148
|
-
@child.autoresizingMask.should == mask
|
149
|
-
end
|
150
|
-
|
151
|
-
it "Should create a frame" do
|
152
|
-
@dummy.set_easy_attributes @parent, @child, {
|
153
|
-
left: 10,
|
154
|
-
top: 20,
|
155
|
-
width: 100,
|
156
|
-
height: 50
|
157
|
-
}
|
158
|
-
|
159
|
-
@child.frame.should == CGRectMake(10, 20, 100, 50)
|
160
|
-
end
|
161
|
-
|
162
|
-
it "Should create a frame with x & y" do
|
163
|
-
@dummy.set_easy_attributes @parent, @child, {
|
164
|
-
x: 10,
|
165
|
-
y: 20,
|
166
|
-
width: 100,
|
167
|
-
height: 50
|
168
|
-
}
|
169
|
-
|
170
|
-
@child.frame.should == CGRectMake(10, 20, 100, 50)
|
171
|
-
end
|
172
|
-
|
173
|
-
end
|
174
|
-
|
175
100
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
describe "ProMotion::Screen UIView title functionality" do
|
2
|
+
def controller
|
3
|
+
@controller ||= ViewTitleScreen.new(nav_bar: true)
|
4
|
+
end
|
5
|
+
|
6
|
+
it "should allow a non-image UIView title" do
|
7
|
+
controller.navigationItem.titleView.should.not.be.kind_of UIImageView
|
8
|
+
controller.navigationItem.titleView.should.be.kind_of UIView
|
9
|
+
end
|
10
|
+
end
|
data/spec/unit/web_spec.rb
CHANGED
@@ -34,7 +34,7 @@ describe "web screen properties" do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
it "should
|
37
|
+
it "should call on_request hook" do
|
38
38
|
@webscreen.open_url(NSURL.URLWithString('http://mixi.jp/'))
|
39
39
|
|
40
40
|
wait_for_change @webscreen, 'on_request' do
|
@@ -46,42 +46,7 @@ describe "web screen properties" do
|
|
46
46
|
|
47
47
|
end
|
48
48
|
|
49
|
-
describe "when
|
50
|
-
before do
|
51
|
-
class TestWebScreenWithRPC < TestWebScreen
|
52
|
-
attr_accessor :on_request, :on_request_args
|
53
|
-
|
54
|
-
def on_request(request, type)
|
55
|
-
self.on_request_args = [request, type]
|
56
|
-
self.on_request = true
|
57
|
-
# return false to prevent loadRequest
|
58
|
-
false
|
59
|
-
end
|
60
|
-
end
|
61
|
-
stub_request(:get, "http://mixi.jp/").
|
62
|
-
to_return(body: "<html><body>[mixi]</body></html>", content_type: "text/html")
|
63
|
-
# Simulate AppDelegate setup of web screen
|
64
|
-
@webscreen = TestWebScreenWithRPC.new modal: true, nav_bar: true, external_links: false
|
65
|
-
end
|
66
|
-
|
67
|
-
it "should called on_request hook" do
|
68
|
-
# simulate web bridge request from html links
|
69
|
-
@webscreen.open_url(NSURL.URLWithString('webbridge://method'))
|
70
|
-
|
71
|
-
wait_for_change @webscreen, 'on_request' do
|
72
|
-
request = @webscreen.on_request_args[0]
|
73
|
-
# on_request is called when @webscreen request for some iframe
|
74
|
-
request.URL.absoluteString.should == 'webbridge://method'
|
75
|
-
end
|
76
|
-
|
77
|
-
wait 0.3 do
|
78
|
-
# it should not load request when return false in on_request
|
79
|
-
!!(@webscreen.is_load_finished.should) == false
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
describe "when load static html file" do
|
49
|
+
describe "when loading a static html file" do
|
85
50
|
before do
|
86
51
|
# Simulate AppDelegate setup of web screen
|
87
52
|
@webscreen = TestWebScreen.new modal: true, nav_bar: true, external_links: false
|
@@ -103,4 +68,33 @@ describe "web screen properties" do
|
|
103
68
|
end
|
104
69
|
end
|
105
70
|
|
71
|
+
describe "when setting attributes" do
|
72
|
+
it "should have a default values" do
|
73
|
+
webscreen = TestWebScreen.new()
|
74
|
+
webscreen.web.dataDetectorTypes.should == UIDataDetectorTypeNone
|
75
|
+
webscreen.web.scalesPageToFit.should == false
|
76
|
+
webscreen.external_links.should == false
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should set a single data detector" do
|
80
|
+
webscreen = TestWebScreen.new(detector_types: :phone)
|
81
|
+
webscreen.web.dataDetectorTypes.should == UIDataDetectorTypePhoneNumber
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should set multiple data detectors" do
|
85
|
+
webscreen = TestWebScreen.new(detector_types: [:phone, :link])
|
86
|
+
webscreen.web.dataDetectorTypes.should == UIDataDetectorTypePhoneNumber | UIDataDetectorTypeLink
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should set the scaling mode of the screen" do
|
90
|
+
webscreen = TestWebScreen.new(scale_to_fit: true)
|
91
|
+
webscreen.web.scalesPageToFit.should == true
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should have the ability to open links externally" do
|
95
|
+
webscreen = TestWebScreen.new(external_links: true)
|
96
|
+
webscreen.external_links.should == true
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
106
100
|
end
|
metadata
CHANGED
@@ -1,45 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ProMotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
8
|
-
- Silas Matson
|
9
8
|
- Mark Rickert
|
9
|
+
- Silas Matson
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
date: 2014-06-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: motion-require
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - "~>"
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0.2'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
requirements:
|
26
|
-
- - "~>"
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
version: '0.2'
|
29
15
|
- !ruby/object:Gem::Dependency
|
30
16
|
name: methadone
|
31
17
|
requirement: !ruby/object:Gem::Requirement
|
32
18
|
requirements:
|
33
19
|
- - "~>"
|
34
20
|
- !ruby/object:Gem::Version
|
35
|
-
version: '1.
|
21
|
+
version: '1.4'
|
36
22
|
type: :runtime
|
37
23
|
prerelease: false
|
38
24
|
version_requirements: !ruby/object:Gem::Requirement
|
39
25
|
requirements:
|
40
26
|
- - "~>"
|
41
27
|
- !ruby/object:Gem::Version
|
42
|
-
version: '1.
|
28
|
+
version: '1.4'
|
43
29
|
- !ruby/object:Gem::Dependency
|
44
30
|
name: webstub
|
45
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,130 +72,88 @@ dependencies:
|
|
86
72
|
name: rake
|
87
73
|
requirement: !ruby/object:Gem::Requirement
|
88
74
|
requirements:
|
89
|
-
- - "
|
75
|
+
- - ">="
|
90
76
|
- !ruby/object:Gem::Version
|
91
|
-
version: '10.
|
77
|
+
version: '10.0'
|
92
78
|
type: :development
|
93
79
|
prerelease: false
|
94
80
|
version_requirements: !ruby/object:Gem::Requirement
|
95
81
|
requirements:
|
96
|
-
- - "
|
82
|
+
- - ">="
|
97
83
|
- !ruby/object:Gem::Version
|
98
|
-
version: '10.
|
99
|
-
description:
|
100
|
-
development more like Ruby and less like Objective-C.\n It
|
101
|
-
introduces a clean, Ruby-style syntax for building screens that is easy to learn
|
102
|
-
and remember and\n abstracts a ton of boilerplate UIViewController,
|
103
|
-
UINavigationController, and other iOS code into a\n simple,
|
104
|
-
Ruby-like DSL.\n "
|
84
|
+
version: '10.0'
|
85
|
+
description: ProMotion is a fast way to get started building RubyMotion iOS apps.
|
105
86
|
email:
|
106
87
|
- jamon@clearsightstudio.com
|
107
|
-
- silas@clearsightstudio.com
|
108
88
|
- mark@mohawkapps.com
|
89
|
+
- silas@clearsightstudio.com
|
109
90
|
executables:
|
110
91
|
- promotion
|
111
92
|
extensions: []
|
112
93
|
extra_rdoc_files: []
|
113
94
|
files:
|
114
|
-
- ".gitignore"
|
115
|
-
- ".travis.yml"
|
116
|
-
- CONTRIBUTING.md
|
117
|
-
- Gemfile
|
118
|
-
- Gemfile.lock
|
119
|
-
- LICENSE
|
120
|
-
- ProMotion.gemspec
|
121
95
|
- README.md
|
122
|
-
- Rakefile
|
123
|
-
- app/app_delegate.rb
|
124
|
-
- app/screens/basic_screen.rb
|
125
96
|
- bin/promotion
|
126
97
|
- lib/ProMotion.rb
|
127
98
|
- lib/ProMotion/cocoatouch/navigation_controller.rb
|
99
|
+
- lib/ProMotion/cocoatouch/ns_string.rb
|
100
|
+
- lib/ProMotion/cocoatouch/ns_url.rb
|
128
101
|
- lib/ProMotion/cocoatouch/split_view_controller.rb
|
129
102
|
- lib/ProMotion/cocoatouch/tab_bar_controller.rb
|
130
103
|
- lib/ProMotion/cocoatouch/table_view_cell.rb
|
131
104
|
- lib/ProMotion/cocoatouch/table_view_controller.rb
|
132
105
|
- lib/ProMotion/cocoatouch/view_controller.rb
|
133
|
-
- lib/ProMotion/containers/split_screen.rb
|
134
|
-
- lib/ProMotion/containers/tabs.rb
|
135
106
|
- lib/ProMotion/delegate/delegate.rb
|
136
107
|
- lib/ProMotion/delegate/delegate_module.rb
|
137
|
-
- lib/ProMotion/delegate/delegate_notifications.rb
|
138
108
|
- lib/ProMotion/delegate/delegate_parent.rb
|
139
|
-
- lib/ProMotion/
|
140
|
-
- lib/ProMotion/logger.rb
|
141
|
-
- lib/ProMotion/map/map_screen.rb
|
142
|
-
- lib/ProMotion/map/map_screen_annotation.rb
|
143
|
-
- lib/ProMotion/map/map_screen_module.rb
|
109
|
+
- lib/ProMotion/ipad/split_screen.rb
|
110
|
+
- lib/ProMotion/logger/logger.rb
|
144
111
|
- lib/ProMotion/pro_motion.rb
|
145
|
-
- lib/ProMotion/
|
112
|
+
- lib/ProMotion/screen/nav_bar_module.rb
|
146
113
|
- lib/ProMotion/screen/screen.rb
|
147
114
|
- lib/ProMotion/screen/screen_module.rb
|
148
115
|
- lib/ProMotion/screen/screen_navigation.rb
|
116
|
+
- lib/ProMotion/styling/styling.rb
|
149
117
|
- lib/ProMotion/table/cell/table_view_cell_module.rb
|
150
118
|
- lib/ProMotion/table/data/table_data.rb
|
151
119
|
- lib/ProMotion/table/extensions/indexable.rb
|
120
|
+
- lib/ProMotion/table/extensions/longpressable.rb
|
152
121
|
- lib/ProMotion/table/extensions/refreshable.rb
|
153
122
|
- lib/ProMotion/table/extensions/searchable.rb
|
154
123
|
- lib/ProMotion/table/grouped_table.rb
|
155
124
|
- lib/ProMotion/table/grouped_table_screen.rb
|
156
125
|
- lib/ProMotion/table/table.rb
|
157
126
|
- lib/ProMotion/table/table_screen.rb
|
127
|
+
- lib/ProMotion/tabs/tabs.rb
|
158
128
|
- lib/ProMotion/version.rb
|
159
|
-
- lib/ProMotion/view/styling.rb
|
160
129
|
- lib/ProMotion/web/web_screen.rb
|
161
130
|
- lib/ProMotion/web/web_screen_module.rb
|
162
|
-
- resources/WebScreen.html
|
163
|
-
- resources/list.png
|
164
|
-
- resources/test.png
|
165
|
-
- spec/functional/func_image_title_screen.rb
|
166
|
-
- spec/functional/func_image_view_title_screen.rb
|
167
|
-
- spec/functional/func_map_screen_spec.rb
|
168
131
|
- spec/functional/func_screen_spec.rb
|
169
|
-
- spec/functional/func_searchable_table_spec.rb
|
170
132
|
- spec/functional/func_split_screen_spec.rb
|
171
|
-
- spec/functional/func_tab_bar_spec.rb
|
172
133
|
- spec/functional/func_table_screen_spec.rb
|
173
|
-
- spec/functional/func_view_title_screen.rb
|
174
134
|
- spec/functional/func_web_screen_spec.rb
|
175
|
-
- spec/helpers/basic_screen.rb
|
176
|
-
- spec/helpers/custom_title_view.rb
|
177
|
-
- spec/helpers/detail_screen.rb
|
178
|
-
- spec/helpers/dummy_class.rb
|
179
|
-
- spec/helpers/functional_screen.rb
|
180
|
-
- spec/helpers/home_screen.rb
|
181
|
-
- spec/helpers/image_title_screen.rb
|
182
|
-
- spec/helpers/image_view_title_screen.rb
|
183
|
-
- spec/helpers/map_screen.rb
|
184
|
-
- spec/helpers/master_screen.rb
|
185
|
-
- spec/helpers/present_screen.rb
|
186
|
-
- spec/helpers/screen_module_view_controller.rb
|
187
|
-
- spec/helpers/tab_screen.rb
|
188
|
-
- spec/helpers/table_screen.rb
|
189
|
-
- spec/helpers/table_screen_indexable.rb
|
190
|
-
- spec/helpers/table_screen_refreshable.rb
|
191
|
-
- spec/helpers/table_screen_searchable.rb
|
192
|
-
- spec/helpers/test_delegate.rb
|
193
|
-
- spec/helpers/test_delegate_colors.rb
|
194
135
|
- spec/helpers/test_helper.rb
|
195
|
-
- spec/helpers/view_title_screen.rb
|
196
|
-
- spec/helpers/web_screen.rb
|
197
136
|
- spec/unit/delegate_spec.rb
|
137
|
+
- spec/unit/image_title_screen.rb
|
138
|
+
- spec/unit/image_view_title_screen.rb
|
139
|
+
- spec/unit/load_view_spec.rb
|
198
140
|
- spec/unit/logger_spec.rb
|
199
141
|
- spec/unit/main_spec.rb
|
200
|
-
- spec/unit/map_spec.rb
|
201
142
|
- spec/unit/screen_helpers_spec.rb
|
202
143
|
- spec/unit/screen_module_spec.rb
|
203
144
|
- spec/unit/screen_spec.rb
|
145
|
+
- spec/unit/searchable_table_spec.rb
|
204
146
|
- spec/unit/split_screen_in_tab_bar_spec.rb
|
205
147
|
- spec/unit/split_screen_open_screen_spec.rb
|
206
148
|
- spec/unit/split_screen_spec.rb
|
149
|
+
- spec/unit/tab_bar_spec.rb
|
207
150
|
- spec/unit/tab_spec.rb
|
208
151
|
- spec/unit/tables/table_indexable_spec.rb
|
209
152
|
- spec/unit/tables/table_module_spec.rb
|
210
153
|
- spec/unit/tables/table_screen_spec.rb
|
211
154
|
- spec/unit/tables/table_view_cell_spec.rb
|
212
155
|
- spec/unit/view_helper_spec.rb
|
156
|
+
- spec/unit/view_title_screen.rb
|
213
157
|
- spec/unit/web_spec.rb
|
214
158
|
homepage: https://github.com/clearsightstudio/ProMotion
|
215
159
|
licenses:
|
@@ -226,62 +170,44 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
226
170
|
version: '0'
|
227
171
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
172
|
requirements:
|
229
|
-
- - "
|
173
|
+
- - ">"
|
230
174
|
- !ruby/object:Gem::Version
|
231
|
-
version:
|
175
|
+
version: 1.3.1
|
232
176
|
requirements: []
|
233
177
|
rubyforge_project:
|
234
178
|
rubygems_version: 2.2.2
|
235
179
|
signing_key:
|
236
180
|
specification_version: 4
|
237
|
-
summary: ProMotion
|
181
|
+
summary: ProMotion is a fast way to get started building RubyMotion apps. Instead
|
182
|
+
of dealing with UIViewControllers, UITableViewControllers, and the like, you work
|
183
|
+
with Screens. We abstract the view controller boilerplate to make iOS development
|
184
|
+
more like Ruby and less like Objective-C. With a memorable, concise syntax and a
|
185
|
+
friendly, helpful community, ProMotion is a great way to get started with iOS development.
|
238
186
|
test_files:
|
239
|
-
- spec/functional/func_image_title_screen.rb
|
240
|
-
- spec/functional/func_image_view_title_screen.rb
|
241
|
-
- spec/functional/func_map_screen_spec.rb
|
242
187
|
- spec/functional/func_screen_spec.rb
|
243
|
-
- spec/functional/func_searchable_table_spec.rb
|
244
188
|
- spec/functional/func_split_screen_spec.rb
|
245
|
-
- spec/functional/func_tab_bar_spec.rb
|
246
189
|
- spec/functional/func_table_screen_spec.rb
|
247
|
-
- spec/functional/func_view_title_screen.rb
|
248
190
|
- spec/functional/func_web_screen_spec.rb
|
249
|
-
- spec/helpers/basic_screen.rb
|
250
|
-
- spec/helpers/custom_title_view.rb
|
251
|
-
- spec/helpers/detail_screen.rb
|
252
|
-
- spec/helpers/dummy_class.rb
|
253
|
-
- spec/helpers/functional_screen.rb
|
254
|
-
- spec/helpers/home_screen.rb
|
255
|
-
- spec/helpers/image_title_screen.rb
|
256
|
-
- spec/helpers/image_view_title_screen.rb
|
257
|
-
- spec/helpers/map_screen.rb
|
258
|
-
- spec/helpers/master_screen.rb
|
259
|
-
- spec/helpers/present_screen.rb
|
260
|
-
- spec/helpers/screen_module_view_controller.rb
|
261
|
-
- spec/helpers/tab_screen.rb
|
262
|
-
- spec/helpers/table_screen.rb
|
263
|
-
- spec/helpers/table_screen_indexable.rb
|
264
|
-
- spec/helpers/table_screen_refreshable.rb
|
265
|
-
- spec/helpers/table_screen_searchable.rb
|
266
|
-
- spec/helpers/test_delegate.rb
|
267
|
-
- spec/helpers/test_delegate_colors.rb
|
268
191
|
- spec/helpers/test_helper.rb
|
269
|
-
- spec/helpers/view_title_screen.rb
|
270
|
-
- spec/helpers/web_screen.rb
|
271
192
|
- spec/unit/delegate_spec.rb
|
193
|
+
- spec/unit/image_title_screen.rb
|
194
|
+
- spec/unit/image_view_title_screen.rb
|
195
|
+
- spec/unit/load_view_spec.rb
|
272
196
|
- spec/unit/logger_spec.rb
|
273
197
|
- spec/unit/main_spec.rb
|
274
|
-
- spec/unit/map_spec.rb
|
275
198
|
- spec/unit/screen_helpers_spec.rb
|
276
199
|
- spec/unit/screen_module_spec.rb
|
277
200
|
- spec/unit/screen_spec.rb
|
201
|
+
- spec/unit/searchable_table_spec.rb
|
278
202
|
- spec/unit/split_screen_in_tab_bar_spec.rb
|
279
203
|
- spec/unit/split_screen_open_screen_spec.rb
|
280
204
|
- spec/unit/split_screen_spec.rb
|
205
|
+
- spec/unit/tab_bar_spec.rb
|
281
206
|
- spec/unit/tab_spec.rb
|
282
207
|
- spec/unit/tables/table_indexable_spec.rb
|
283
208
|
- spec/unit/tables/table_module_spec.rb
|
284
209
|
- spec/unit/tables/table_screen_spec.rb
|
285
210
|
- spec/unit/tables/table_view_cell_spec.rb
|
286
211
|
- spec/unit/view_helper_spec.rb
|
212
|
+
- spec/unit/view_title_screen.rb
|
287
213
|
- spec/unit/web_spec.rb
|