ProMotion 2.5.0.beta1 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -25
- data/lib/ProMotion/collection/collection.rb +2 -0
- data/lib/ProMotion/screen/screen_module.rb +3 -2
- data/lib/ProMotion/table/data/table_data.rb +12 -1
- data/lib/ProMotion/table/extensions/refreshable.rb +1 -1
- data/lib/ProMotion/table/table.rb +48 -6
- data/lib/ProMotion/version.rb +1 -1
- data/lib/ProMotion/web/web_screen_module.rb +7 -1
- data/spec/functional/func_table_screen_spec.rb +1 -0
- data/spec/unit/screen_spec.rb +3 -1
- data/spec/unit/tables/table_module_spec.rb +65 -15
- data/spec/unit/web_spec.rb +9 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64a321e5c84fb57549e6926cf53e2c1024a37b87
|
4
|
+
data.tar.gz: b9a9fda8c8db70cda658faa046798fe47a01bcdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bda6e2a93b03f8e4e1e1153766e010b762dea1d7a4dae3c64b39defaa9124a0077c030312cf158e86c3fc289c20cb96a7ba6309b3e401b86d6773e8a87d7dce3
|
7
|
+
data.tar.gz: 92d22300edaca3ad9d5f50c555c526b1e30c9ef5a76f783301eef55c09dd60c338449bc7e4e1059b97db357bbe810630f81c231bb101256ed35db83cbeb83970
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# ProMotion
|
2
2
|
|
3
3
|
[![Gem Version](https://img.shields.io/gem/v/ProMotion.svg?style=flat)](https://rubygems.org/gems/ProMotion)
|
4
|
-
[![Build Status](https://img.shields.io/travis/
|
5
|
-
[![Code Climate](https://img.shields.io/codeclimate/github/
|
4
|
+
[![Build Status](https://img.shields.io/travis/infinitered/ProMotion.svg?style=flat)](https://travis-ci.org/infinitered/ProMotion)
|
5
|
+
[![Code Climate](https://img.shields.io/codeclimate/github/infinitered/ProMotion.svg?style=flat)](https://codeclimate.com/github/infinitered/ProMotion)
|
6
6
|
|
7
7
|
## iPhone Apps, Ruby-style
|
8
8
|
|
@@ -74,19 +74,28 @@ end
|
|
74
74
|
|---|---|---|
|
75
75
|
|[![ProMotion SplitScreens](https://f.cloud.github.com/assets/1479215/1534507/0edb8dd4-4c96-11e3-9896-d4583d0ed161.png)](http://promotion.readthedocs.org/en/master/Reference/ProMotion%20SplitScreen/)|[![MapScreen](https://f.cloud.github.com/assets/1479215/1534628/f7dbf7e8-4c97-11e3-8817-4c2a58824771.png)](http://promotion.readthedocs.org/en/master/Reference/ProMotion%20MapScreen/)|[![ProMotion WebScreen](https://f.cloud.github.com/assets/1479215/1534631/ffe1b36a-4c97-11e3-8c8f-c7b14e26182d.png)](http://promotion.readthedocs.org/en/master/Reference/ProMotion%20WebScreen/)|
|
76
76
|
|
77
|
-
**NEW** [Live reloading!](http://promotion.readthedocs.org/en/master/Guides/Live Screen Reloading/) Use `
|
77
|
+
**NEW** [Live reloading!](http://promotion.readthedocs.org/en/master/Guides/Live Screen Reloading/) Use `pm_live` to enable it, and `on_live_reload` in your screen to refresh things.
|
78
78
|
|
79
79
|
#### ...and much more.
|
80
80
|
|
81
81
|
# Getting Started
|
82
82
|
|
83
|
-
1. Check out the [Getting Started Guide](https://github.com/
|
83
|
+
1. Check out the [Getting Started Guide](https://github.com/infinitered/ProMotion/blob/master/docs/Guides/Getting%20Started.md)
|
84
84
|
2. Watch the excellent [MotionInMotion screencast about ProMotion](https://motioninmotion.tv/screencasts/8) (very reasonably priced subscription required)
|
85
85
|
3. Follow a tutorial: [Building an ESPN app using RubyMotion, ProMotion, and TDD](http://jamonholmgren.com/building-an-espn-app-using-rubymotion-promotion-and-tdd)
|
86
|
-
4. Read the [Documentation](https://github.com/
|
86
|
+
4. Read the [Documentation](https://github.com/infinitered/ProMotion/blob/master/docs)
|
87
87
|
|
88
88
|
# Changelog
|
89
89
|
|
90
|
+
## Version 2.5.0
|
91
|
+
|
92
|
+
This release includes some new features and bugfixes and is backwards compatible with all 2.x releases.
|
93
|
+
|
94
|
+
* PR #763 Adds footer_view to TableScreens
|
95
|
+
* PR #705 Adds split-screen support for large iPhones
|
96
|
+
* PR #736 Adds the index path when deleting a cell
|
97
|
+
* Several other bugfix PRs
|
98
|
+
|
90
99
|
## Version 2.4.0
|
91
100
|
|
92
101
|
This release includes several new features and is backwards compatible with all 2.x releases.
|
@@ -97,22 +106,6 @@ This release includes several new features and is backwards compatible with all
|
|
97
106
|
* PR #677 Added `add_child_screen` and `remove_child_screen` methods to `PM::Screen`.
|
98
107
|
* PR #687 Adds persisting tab order when changed by the user for tab bars over 5 screens.
|
99
108
|
|
100
|
-
## Version 2.3.0
|
101
|
-
|
102
|
-
This release includes several new features and is backwards compatible with all 2.x releases.
|
103
|
-
|
104
|
-
* PR #618 Allow search bar to be hidden initially
|
105
|
-
* PR #606 Adds capability for table_footer_view
|
106
|
-
* PR #602 Add image inset support for tab bar item
|
107
|
-
* PR #595 Feature/support module
|
108
|
-
* PR #582 Allow setting of multiple nav bar buttons instead of just one left an one right
|
109
|
-
* PR #581 Adds on_tab_selected
|
110
|
-
* PR #579 implemented nav_bar_button class method RE #272
|
111
|
-
* PR #565 Adds header_will_display method to PM::TableScreen
|
112
|
-
* PR #663 Adds `on_load` back to cell dequeue code
|
113
|
-
* PR #641 Custom search for PM::TableScreen
|
114
|
-
* PR #658 Fix cell height issue
|
115
|
-
|
116
109
|
# Apps built on ProMotion
|
117
110
|
|
118
111
|
[Apps built on ProMotion](http://promotion.readthedocs.org/en/master/ProMotion%20Apps/)
|
@@ -125,7 +118,7 @@ Open a pull request! We love adding new ProMotion-built apps.
|
|
125
118
|
|
126
119
|
We've created a comprehensive and always updated wiki with code examples, usage examples, and API reference.
|
127
120
|
|
128
|
-
### [ProMotion Documentation](https://github.com/
|
121
|
+
### [ProMotion Documentation](https://github.com/infinitered/ProMotion/blob/master/docs)
|
129
122
|
|
130
123
|
# Screencasts
|
131
124
|
|
@@ -138,11 +131,11 @@ interviews Jamon Holmgren about ProMotion
|
|
138
131
|
ProMotion is not only an easy DSL to get started. The community is very helpful and
|
139
132
|
welcoming to new RubyMotion developers. We don't mind newbie questions.
|
140
133
|
|
141
|
-
If you need help, feel free to open an issue on GitHub. If we don't respond within a day, tweet us a link to the issue -- sometimes we get busy.
|
134
|
+
The quickest way to get help is to join the [Motioneers Slack Group](http://motioneers.herokuapp.com). If you still need help, feel free to open an issue on GitHub. If we don't respond within a day, tweet us a link to the issue -- sometimes we get busy.
|
142
135
|
|
143
136
|
# Contributing
|
144
137
|
|
145
|
-
See [CONTRIBUTING.md](https://github.com/
|
138
|
+
See [CONTRIBUTING.md](https://github.com/infinitered/ProMotion/blob/master/CONTRIBUTING.md).
|
146
139
|
|
147
140
|
## Core Team
|
148
141
|
|
@@ -154,4 +147,4 @@ See [CONTRIBUTING.md](https://github.com/clearsightstudio/ProMotion/blob/master/
|
|
154
147
|
|
155
148
|
## Other Contributors
|
156
149
|
|
157
|
-
* [Many others](https://github.com/
|
150
|
+
* [Many others](https://github.com/infinitered/ProMotion/graphs/contributors)
|
@@ -7,7 +7,8 @@ module ProMotion
|
|
7
7
|
include ProMotion::Tabs
|
8
8
|
include ProMotion::SplitScreen if UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad || (UIDevice.currentDevice.systemVersion.to_i >= 8 )
|
9
9
|
|
10
|
-
|
10
|
+
attr_reader :parent_screen
|
11
|
+
attr_accessor :first_screen, :modal, :split_screen
|
11
12
|
|
12
13
|
def screen_init(args = {})
|
13
14
|
@screen_options = args
|
@@ -154,7 +155,7 @@ module ProMotion
|
|
154
155
|
def add_child_screen(screen)
|
155
156
|
screen = screen.new if screen.respond_to?(:new)
|
156
157
|
addChildViewController(screen)
|
157
|
-
screen.parent_screen =
|
158
|
+
screen.parent_screen = self
|
158
159
|
screen.didMoveToParentViewController(self) # Required
|
159
160
|
screen
|
160
161
|
end
|
@@ -7,7 +7,18 @@ module ProMotion
|
|
7
7
|
|
8
8
|
def initialize(data, table_view, search_action = nil)
|
9
9
|
@search_action ||= search_action
|
10
|
-
|
10
|
+
|
11
|
+
if data.include?(nil)
|
12
|
+
mp("Warning: You have a `nil` section in your table_data method.", force_color: :yellow)
|
13
|
+
end
|
14
|
+
|
15
|
+
self.data = data.compact.each_with_index.map do |section,index|
|
16
|
+
if section[:cells].include?(nil)
|
17
|
+
mp("Warning: You have a `nil` cell in table section #{index}.", force_color: :yellow)
|
18
|
+
section[:cells].compact!
|
19
|
+
end
|
20
|
+
section
|
21
|
+
end
|
11
22
|
self.table_view = WeakRef.new(table_view)
|
12
23
|
end
|
13
24
|
|
@@ -19,7 +19,7 @@ module ProMotion
|
|
19
19
|
return unless @refresh_control
|
20
20
|
|
21
21
|
@refresh_control.beginRefreshing
|
22
|
-
|
22
|
+
@refresh_control.attributedTitle = NSAttributedString.alloc.initWithString(@refreshing)
|
23
23
|
# Scrolls the table down to show the refresh control when invoked programatically
|
24
24
|
tableView.setContentOffset(CGPointMake(0, tableView.contentOffset.y-@refresh_control.frame.size.height), animated:true) if tableView.contentOffset.y > -65.0
|
25
25
|
end
|
@@ -135,7 +135,8 @@ module ProMotion
|
|
135
135
|
deletable_index_paths = []
|
136
136
|
Array(index_paths).each do |index_path|
|
137
137
|
delete_cell = false
|
138
|
-
|
138
|
+
|
139
|
+
delete_cell = trigger_action(:on_cell_deleted, cell_at(index_path: index_path), index_path) if respond_to?(:on_cell_deleted)
|
139
140
|
unless delete_cell == false
|
140
141
|
self.promotion_table_data.delete_cell(index_path: index_path)
|
141
142
|
deletable_index_paths << index_path
|
@@ -186,6 +187,11 @@ module ProMotion
|
|
186
187
|
section && section[:title]
|
187
188
|
end
|
188
189
|
|
190
|
+
def tableView(_, titleForFooterInSection: section)
|
191
|
+
section = promotion_table_data.section(section)
|
192
|
+
section && section[:footer]
|
193
|
+
end
|
194
|
+
|
189
195
|
# Set table_data_index if you want the right hand index column (jumplist)
|
190
196
|
def sectionIndexTitlesForTableView(_)
|
191
197
|
return if self.promotion_table_data.filtered
|
@@ -218,12 +224,12 @@ module ProMotion
|
|
218
224
|
end
|
219
225
|
|
220
226
|
def tableView(_, canEditRowAtIndexPath:index_path)
|
221
|
-
data_cell = cell_at(index_path: index_path, unfiltered:
|
227
|
+
data_cell = cell_at(index_path: index_path, unfiltered: !searching?)
|
222
228
|
[:insert,:delete].include?(data_cell[:editing_style])
|
223
229
|
end
|
224
230
|
|
225
231
|
def tableView(_, editingStyleForRowAtIndexPath: index_path)
|
226
|
-
data_cell = cell_at(index_path: index_path, unfiltered:
|
232
|
+
data_cell = cell_at(index_path: index_path, unfiltered: !searching?)
|
227
233
|
map_cell_editing_style(data_cell[:editing_style])
|
228
234
|
end
|
229
235
|
|
@@ -234,7 +240,7 @@ module ProMotion
|
|
234
240
|
end
|
235
241
|
|
236
242
|
def tableView(_, canMoveRowAtIndexPath:index_path)
|
237
|
-
data_cell = cell_at(index_path: index_path, unfiltered:
|
243
|
+
data_cell = cell_at(index_path: index_path, unfiltered: !searching?)
|
238
244
|
|
239
245
|
if (!data_cell[:moveable].nil? || data_cell[:moveable].is_a?(Symbol)) && data_cell[:moveable] != false
|
240
246
|
true
|
@@ -244,7 +250,7 @@ module ProMotion
|
|
244
250
|
end
|
245
251
|
|
246
252
|
def tableView(_, targetIndexPathForMoveFromRowAtIndexPath:source_index_path, toProposedIndexPath:proposed_destination_index_path)
|
247
|
-
data_cell = cell_at(index_path: source_index_path, unfiltered:
|
253
|
+
data_cell = cell_at(index_path: source_index_path, unfiltered: !searching?)
|
248
254
|
|
249
255
|
if data_cell[:moveable] == :section && source_index_path.section != proposed_destination_index_path.section
|
250
256
|
source_index_path
|
@@ -286,7 +292,7 @@ module ProMotion
|
|
286
292
|
delete_row(index_paths, animation)
|
287
293
|
end
|
288
294
|
|
289
|
-
# Section view methods
|
295
|
+
# Section header view methods
|
290
296
|
def tableView(_, viewForHeaderInSection: index)
|
291
297
|
section = promotion_table_data.section(index)
|
292
298
|
view = section[:title_view]
|
@@ -322,6 +328,42 @@ module ProMotion
|
|
322
328
|
end
|
323
329
|
end
|
324
330
|
|
331
|
+
# Section footer view methods
|
332
|
+
def tableView(_, viewForFooterInSection: index)
|
333
|
+
section = promotion_table_data.section(index)
|
334
|
+
view = section[:footer_view]
|
335
|
+
view = section[:footer_view].new if section[:footer_view].respond_to?(:new)
|
336
|
+
view.on_load if view.respond_to?(:on_load)
|
337
|
+
view.title = section[:footer] if view.respond_to?(:title=)
|
338
|
+
view
|
339
|
+
end
|
340
|
+
|
341
|
+
def tableView(_, heightForFooterInSection: index)
|
342
|
+
section = promotion_table_data.section(index)
|
343
|
+
if section[:footer_view] || section[:footer].to_s.length > 0
|
344
|
+
if section[:footer_view_height]
|
345
|
+
section[:footer_view_height]
|
346
|
+
elsif (section_footer = tableView(_, viewForFooterInSection: index)) && section_footer.respond_to?(:height)
|
347
|
+
section_footer.height
|
348
|
+
else
|
349
|
+
tableView.sectionFooterHeight
|
350
|
+
end
|
351
|
+
else
|
352
|
+
0.0
|
353
|
+
end
|
354
|
+
end
|
355
|
+
|
356
|
+
def tableView(_, willDisplayFooterView:view, forSection:section)
|
357
|
+
action = :will_display_footer
|
358
|
+
if respond_to?(action)
|
359
|
+
case self.method(action).arity
|
360
|
+
when 0 then self.send(action)
|
361
|
+
when 2 then self.send(action, view, section)
|
362
|
+
else self.send(action, view)
|
363
|
+
end
|
364
|
+
end
|
365
|
+
end
|
366
|
+
|
325
367
|
protected
|
326
368
|
|
327
369
|
def map_cell_editing_style(symbol)
|
data/lib/ProMotion/version.rb
CHANGED
@@ -34,7 +34,13 @@ module ProMotion
|
|
34
34
|
|
35
35
|
def set_initial_content
|
36
36
|
return unless self.respond_to?(:content) && self.content
|
37
|
-
self.content.is_a?(NSURL)
|
37
|
+
if self.content.is_a?(NSURL)
|
38
|
+
open_url(self.content)
|
39
|
+
elsif self.content.is_a?(NSMutableURLRequest)
|
40
|
+
web.loadRequest self.content
|
41
|
+
else
|
42
|
+
set_content(self.content)
|
43
|
+
end
|
38
44
|
end
|
39
45
|
|
40
46
|
def set_content(content)
|
@@ -75,6 +75,7 @@ describe "ProMotion::TableScreen functionality" do
|
|
75
75
|
wait 0.01 do
|
76
76
|
table_screen.tableView(table_screen.tableView, numberOfRowsInSection:0).should == 6
|
77
77
|
table_screen.cell_was_deleted.should == true
|
78
|
+
table_screen.cell_deleted_index_path.should == NSIndexPath.indexPathForRow(3, inSection:0)
|
78
79
|
end
|
79
80
|
end
|
80
81
|
end
|
data/spec/unit/screen_spec.rb
CHANGED
@@ -449,7 +449,9 @@ describe "child screen management" do
|
|
449
449
|
end
|
450
450
|
|
451
451
|
it "#add_child_screen" do
|
452
|
-
|
452
|
+
autorelease_pool do
|
453
|
+
@screen.add_child_screen @child
|
454
|
+
end
|
453
455
|
@screen.childViewControllers.should.include(@child)
|
454
456
|
@screen.childViewControllers.length.should == 1
|
455
457
|
@child.parent_screen.should == @screen
|
@@ -52,40 +52,55 @@ describe "PM::Table module" do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def default_cell_height
|
55
|
-
return UITableViewAutomaticDimension if TestHelper.
|
55
|
+
return UITableViewAutomaticDimension if TestHelper.gte_ios8
|
56
56
|
return 97.0 if TestHelper.ios7 # Normally 44, but 97 because of `row_height` designation
|
57
57
|
end
|
58
58
|
|
59
59
|
def default_header_height
|
60
60
|
# Thanks, Apple.
|
61
|
-
return -1.0 if TestHelper.
|
61
|
+
return -1.0 if TestHelper.gte_ios8
|
62
62
|
return 23.0 if TestHelper.ios7
|
63
63
|
return 22.0 if TestHelper.ios6
|
64
64
|
end
|
65
65
|
|
66
|
+
def default_footer_height
|
67
|
+
# Couldn't alias_method inside of a Bacon::Context so I'm defining this
|
68
|
+
# method to just call default_header_height. I'm reasonably sure that
|
69
|
+
# the defaults are the same for section headers and footers.
|
70
|
+
default_header_height
|
71
|
+
end
|
72
|
+
|
66
73
|
before do
|
67
74
|
@subject = TestTableScreen.new
|
68
75
|
@subject.mock! :table_data do
|
69
76
|
[{
|
70
|
-
title: "Table cell group 1", cells: [ ]
|
71
|
-
},{
|
72
|
-
title: "Table cell group 2", cells: [ cell_factory ]
|
73
|
-
},{
|
74
|
-
title: "Table cell group 3", cells: [ cell_factory(title: "3-1"), cell_factory({title: "3-2", properties: { background_color: UIColor.blueColor } }) ]
|
75
|
-
},{
|
76
|
-
title: "Table cell group 4", cells: [ custom_cell, cell_factory(title: "4-2"), cell_factory(title: "4-3"), cell_factory(title: "4-4") ]
|
77
|
-
},{
|
77
|
+
title: "Table cell group 1", :footer => "Footer for table cell group 1", cells: [ ]
|
78
|
+
}, {
|
79
|
+
title: "Table cell group 2", :footer => "Footer for table cell group 2", cells: [ cell_factory ]
|
80
|
+
}, {
|
81
|
+
title: "Table cell group 3", :footer => "Footer for table cell group 3", cells: [ cell_factory(title: "3-1"), cell_factory({title: "3-2", properties: { background_color: UIColor.blueColor } }) ]
|
82
|
+
}, {
|
83
|
+
title: "Table cell group 4", :footer => "Footer for table cell group 4", cells: [ custom_cell, cell_factory(title: "4-2"), cell_factory(title: "4-3"), cell_factory(title: "4-4") ]
|
84
|
+
}, {
|
78
85
|
title: "Custom section title 1", title_view: CustomTitleView, cells: [ ]
|
79
|
-
},{
|
86
|
+
}, {
|
80
87
|
title: "Custom section title 2", title_view: CustomTitleView.new, title_view_height: 50, cells: [ ]
|
81
|
-
},{
|
88
|
+
}, {
|
82
89
|
title: "Action With Index Path Group", cells: [ cell_factory(title: "IndexPath Group 1", action: :tests_index_path) ]
|
83
90
|
}, {
|
84
91
|
title: "Action With A Proc", cells: [ proc_cell ]
|
85
|
-
},{
|
92
|
+
}, {
|
86
93
|
title: "test 40", title_view: DynamicHeightTitleView40, cells: []
|
87
94
|
}, {
|
88
95
|
title: "test 121", title_view: DynamicHeightTitleView121, cells: []
|
96
|
+
}, {
|
97
|
+
footer: "Custom section footer 1", footer_view: CustomFooterView, cells: [ ]
|
98
|
+
}, {
|
99
|
+
footer: "Custom section footer 2", footer_view: CustomFooterView.new, footer_view_height: 50, cells: [ ]
|
100
|
+
}, {
|
101
|
+
footer: "Footer test 40", footer_view: DynamicHeightFooterView40, cells: []
|
102
|
+
}, {
|
103
|
+
footer: "Footer test 121", footer_view: DynamicHeightFooterView121, cells: []
|
89
104
|
}]
|
90
105
|
end
|
91
106
|
|
@@ -99,7 +114,7 @@ describe "PM::Table module" do
|
|
99
114
|
end
|
100
115
|
|
101
116
|
it "should have the right number of sections" do
|
102
|
-
@subject.numberOfSectionsInTableView(@subject.table_view).should ==
|
117
|
+
@subject.numberOfSectionsInTableView(@subject.table_view).should == 14
|
103
118
|
end
|
104
119
|
|
105
120
|
it "should set the section titles" do
|
@@ -111,6 +126,15 @@ describe "PM::Table module" do
|
|
111
126
|
@subject.tableView(@subject.table_view, titleForHeaderInSection:5).should == "Custom section title 2"
|
112
127
|
end
|
113
128
|
|
129
|
+
it "should set the section footers" do
|
130
|
+
@subject.tableView(@subject.table_view, titleForFooterInSection:0).should == "Footer for table cell group 1"
|
131
|
+
@subject.tableView(@subject.table_view, titleForFooterInSection:1).should == "Footer for table cell group 2"
|
132
|
+
@subject.tableView(@subject.table_view, titleForFooterInSection:2).should == "Footer for table cell group 3"
|
133
|
+
@subject.tableView(@subject.table_view, titleForFooterInSection:3).should == "Footer for table cell group 4"
|
134
|
+
@subject.tableView(@subject.table_view, titleForFooterInSection:10).should == "Custom section footer 1"
|
135
|
+
@subject.tableView(@subject.table_view, titleForFooterInSection:11).should == "Custom section footer 2"
|
136
|
+
end
|
137
|
+
|
114
138
|
it "should create the right number of cells" do
|
115
139
|
@subject.tableView(@subject.table_view, numberOfRowsInSection:0).should == 0
|
116
140
|
@subject.tableView(@subject.table_view, numberOfRowsInSection:1).should == 1
|
@@ -121,7 +145,7 @@ describe "PM::Table module" do
|
|
121
145
|
end
|
122
146
|
|
123
147
|
it "should create the jumplist" do
|
124
|
-
@subject.mock!
|
148
|
+
@subject.mock!(:table_data_index) do
|
125
149
|
Array("A".."Z")
|
126
150
|
end
|
127
151
|
|
@@ -226,6 +250,32 @@ describe "PM::Table module" do
|
|
226
250
|
end
|
227
251
|
end
|
228
252
|
|
253
|
+
describe("section with custom footer_view") do
|
254
|
+
|
255
|
+
it "should use the correct class for section view" do
|
256
|
+
cell = @subject.tableView(@subject.table_view, viewForFooterInSection: 10)
|
257
|
+
cell.should.be.kind_of(CustomFooterView)
|
258
|
+
end
|
259
|
+
|
260
|
+
it "should use the default section height if none is specified" do
|
261
|
+
@subject.tableView(@subject.table_view, heightForFooterInSection: 10).should == default_footer_height
|
262
|
+
end
|
263
|
+
|
264
|
+
it "should use the set footer_view_height if one is specified" do
|
265
|
+
@subject.tableView(@subject.table_view, heightForFooterInSection: 11).should == 50.0
|
266
|
+
end
|
267
|
+
|
268
|
+
it "should use the instantiated section view if one is specified" do
|
269
|
+
cell = @subject.tableView(@subject.table_view, viewForFooterInSection: 11)
|
270
|
+
cell.should.be.kind_of(CustomFooterView)
|
271
|
+
end
|
272
|
+
|
273
|
+
it "should set the height of a title view when the method `height` is implemented" do
|
274
|
+
@subject.tableView(@subject.table_view, heightForFooterInSection: 12).should == 40.0
|
275
|
+
@subject.tableView(@subject.table_view, heightForFooterInSection: 13).should == 121.0
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
229
279
|
describe "header view modifications" do
|
230
280
|
|
231
281
|
it "should call will_display_header" do
|
data/spec/unit/web_spec.rb
CHANGED
@@ -31,6 +31,15 @@ describe "web screen properties" do
|
|
31
31
|
@webscreen.current_url.should == 'http://mixi.jp/'
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
it "should open web page via NSMutableURLRequest" do
|
36
|
+
nsurl = NSURL.URLWithString('http://mixi.jp/')
|
37
|
+
@webscreen.web.loadRequest NSMutableURLRequest.requestWithURL(nsurl)
|
38
|
+
|
39
|
+
wait_for_change @webscreen, 'is_load_finished' do
|
40
|
+
@webscreen.current_url.should == 'http://mixi.jp/'
|
41
|
+
end
|
42
|
+
end
|
34
43
|
|
35
44
|
it "should open web page by url string" do
|
36
45
|
@webscreen.open_url('http://mixi.jp/')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ProMotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.0
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-11-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: methadone
|
@@ -208,9 +208,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
208
|
version: '0'
|
209
209
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
210
210
|
requirements:
|
211
|
-
- - "
|
211
|
+
- - ">="
|
212
212
|
- !ruby/object:Gem::Version
|
213
|
-
version:
|
213
|
+
version: '0'
|
214
214
|
requirements: []
|
215
215
|
rubyforge_project:
|
216
216
|
rubygems_version: 2.4.5
|