ProMotion 2.4.2 → 2.5.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -13
  3. data/lib/ProMotion.rb +40 -14
  4. data/lib/ProMotion/cocoatouch/collection_view_cell.rb +8 -0
  5. data/lib/ProMotion/cocoatouch/collection_view_controller.rb +49 -0
  6. data/lib/ProMotion/cocoatouch/view_controller.rb +5 -0
  7. data/lib/ProMotion/collection/cell/collection_view_cell_module.rb +17 -0
  8. data/lib/ProMotion/collection/collection.rb +106 -0
  9. data/lib/ProMotion/collection/collection_builder.rb +39 -0
  10. data/lib/ProMotion/collection/collection_class_methods.rb +38 -0
  11. data/lib/ProMotion/collection/collection_screen.rb +8 -0
  12. data/lib/ProMotion/collection/data/collection_data.rb +32 -0
  13. data/lib/ProMotion/collection/data/collection_data_builder.rb +18 -0
  14. data/lib/ProMotion/delegate/delegate_module.rb +1 -1
  15. data/lib/ProMotion/ipad/split_screen.rb +0 -1
  16. data/lib/ProMotion/repl/live_reloader.rb +76 -0
  17. data/lib/ProMotion/repl/repl.rb +65 -0
  18. data/lib/ProMotion/screen/nav_bar_module.rb +8 -1
  19. data/lib/ProMotion/screen/screen_module.rb +26 -3
  20. data/lib/ProMotion/screen/screen_navigation.rb +3 -0
  21. data/lib/ProMotion/table/cell/table_view_cell_module.rb +11 -0
  22. data/lib/ProMotion/table/extensions/searchable.rb +11 -0
  23. data/lib/ProMotion/table/table.rb +12 -1
  24. data/lib/ProMotion/table/table_builder.rb +7 -5
  25. data/lib/ProMotion/tabs/tabs.rb +6 -3
  26. data/lib/ProMotion/version.rb +1 -1
  27. data/spec/functional/func_screen_spec.rb +25 -20
  28. data/spec/functional/func_split_screen_spec.rb +2 -2
  29. data/spec/unit/collection_screen_spec.rb +133 -0
  30. data/spec/unit/screen_helpers_spec.rb +1 -1
  31. data/spec/unit/screen_spec.rb +44 -6
  32. data/spec/unit/tables/table_module_spec.rb +28 -2
  33. data/spec/unit/tables/table_refreshable_spec.rb +25 -0
  34. data/spec/unit/tables/table_screen_spec.rb +0 -56
  35. data/spec/unit/tables/table_searchable_spec.rb +41 -0
  36. data/spec/unit/tables/table_view_cell_spec.rb +20 -1
  37. metadata +22 -5
@@ -0,0 +1,41 @@
1
+ describe "table screen searchable functionality" do
2
+ before do
3
+ @screen = TableScreenSearchable.new
4
+ @screen.on_load
5
+ end
6
+
7
+ it "should be searchable" do
8
+ @screen.class.get_searchable.should == true
9
+ end
10
+
11
+ it "should create a search header" do
12
+ @screen.tableView.tableHeaderView.should.be.kind_of UISearchBar
13
+ end
14
+
15
+ it "should not hide the search bar initally by default" do
16
+ @screen.tableView.contentOffset.should == CGPointMake(0,0)
17
+ end
18
+
19
+ it "should allow hiding the search bar initally" do
20
+ class HiddenSearchScreen < TableScreenSearchable
21
+ searchable hide_initially: true
22
+ end
23
+ screen = HiddenSearchScreen.new
24
+ screen.on_load
25
+ screen.tableView.contentOffset.should == CGPointMake(0,screen.searchDisplayController.searchBar.frame.size.height)
26
+ end
27
+
28
+ it "should display a custom message when there are no results" do
29
+ table_screen = TableScreenSymbolSearchableNoResults.new
30
+ table_screen.on_load
31
+
32
+ table_screen.searchDisplayControllerWillBeginSearch(table_screen.searchDisplayController)
33
+ table_screen.searchDisplayController(table_screen.searchDisplayController, shouldReloadTableForSearchString:"supercalifragilisticexpialidocious")
34
+ table_screen.update_table_data
35
+
36
+ results_label = table_screen.searchDisplayController.searchResultsTableView.subviews.detect{|v| v.is_a?(UILabel)}
37
+ wait_for_change results_label, 'text' do
38
+ results_label.text.should == "Nada!"
39
+ end
40
+ end
41
+ end
@@ -51,7 +51,8 @@ describe "PM::TableViewCellModule" do
51
51
  { title: "Test 1", properties: { accessory_type: UITableViewCellStateShowingEditControlMask } },
52
52
  custom_cell,
53
53
  { title: "Test2", accessory: { view: button } },
54
- attributed_cell
54
+ attributed_cell,
55
+ { title: "Image Size Test", image: {image: UIImage.imageNamed("list"), size: 20} },
55
56
  ]
56
57
  }
57
58
  ]
@@ -61,6 +62,7 @@ describe "PM::TableViewCellModule" do
61
62
 
62
63
  @custom_ip = NSIndexPath.indexPathForRow(1, inSection: 1) # Cell "Crazy Full Featured Cell"
63
64
  @attributed_ip = NSIndexPath.indexPathForRow(3, inSection: 1) # Attributed Cell
65
+ @image_size_ip = NSIndexPath.indexPathForRow(4, inSection: 1) # Attributed Cell
64
66
 
65
67
  @screen.update_table_data
66
68
 
@@ -137,6 +139,23 @@ describe "PM::TableViewCellModule" do
137
139
  @subject.imageView.layer.cornerRadius.should == 15.0
138
140
  end
139
141
 
142
+ it "should set an image size" do
143
+ cell_for_height = UITableViewCell.alloc.initWithStyle(UITableViewCellStyleDefault, reuseIdentifier:"CellForHeight")
144
+ default_cell_height = cell_for_height.frame.size.height
145
+
146
+ @subject.layoutSubviews
147
+ @subject.imageView.frame.size.should == UIImage.imageNamed("list").size
148
+
149
+ image_cell = @screen.tableView(@screen.table_view, cellForRowAtIndexPath: @image_size_ip)
150
+ image_cell.layoutSubviews
151
+
152
+ image_cell.imageView.frame.origin.should.not == CGPointMake(0,0)
153
+ image_cell.imageView.bounds.origin.should == CGPointMake(0,0)
154
+
155
+ image_cell.imageView.frame.size.should == CGSizeMake(20,20)
156
+ image_cell.imageView.bounds.size.should == CGSizeMake(20,20)
157
+ end
158
+
140
159
  it "should have the proper accessory type" do
141
160
  @subject.accessoryType.should == UITableViewCellAccessoryDisclosureIndicator
142
161
  end
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.4.2
4
+ version: 2.5.0.beta1
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-05-21 00:00:00.000000000 Z
13
+ date: 2015-08-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: methadone
@@ -109,6 +109,8 @@ files:
109
109
  - README.md
110
110
  - bin/promotion
111
111
  - lib/ProMotion.rb
112
+ - lib/ProMotion/cocoatouch/collection_view_cell.rb
113
+ - lib/ProMotion/cocoatouch/collection_view_controller.rb
112
114
  - lib/ProMotion/cocoatouch/navigation_controller.rb
113
115
  - lib/ProMotion/cocoatouch/ns_string.rb
114
116
  - lib/ProMotion/cocoatouch/ns_url.rb
@@ -117,12 +119,21 @@ files:
117
119
  - lib/ProMotion/cocoatouch/table_view_cell.rb
118
120
  - lib/ProMotion/cocoatouch/table_view_controller.rb
119
121
  - lib/ProMotion/cocoatouch/view_controller.rb
122
+ - lib/ProMotion/collection/cell/collection_view_cell_module.rb
123
+ - lib/ProMotion/collection/collection.rb
124
+ - lib/ProMotion/collection/collection_builder.rb
125
+ - lib/ProMotion/collection/collection_class_methods.rb
126
+ - lib/ProMotion/collection/collection_screen.rb
127
+ - lib/ProMotion/collection/data/collection_data.rb
128
+ - lib/ProMotion/collection/data/collection_data_builder.rb
120
129
  - lib/ProMotion/delegate/delegate.rb
121
130
  - lib/ProMotion/delegate/delegate_module.rb
122
131
  - lib/ProMotion/delegate/delegate_parent.rb
123
132
  - lib/ProMotion/ipad/split_screen.rb
124
133
  - lib/ProMotion/logger/logger.rb
125
134
  - lib/ProMotion/pro_motion.rb
135
+ - lib/ProMotion/repl/live_reloader.rb
136
+ - lib/ProMotion/repl/repl.rb
126
137
  - lib/ProMotion/screen/nav_bar_module.rb
127
138
  - lib/ProMotion/screen/screen.rb
128
139
  - lib/ProMotion/screen/screen_module.rb
@@ -156,6 +167,7 @@ files:
156
167
  - spec/functional/func_table_screen_updating_spec.rb
157
168
  - spec/functional/func_web_screen_spec.rb
158
169
  - spec/helpers/test_helper.rb
170
+ - spec/unit/collection_screen_spec.rb
159
171
  - spec/unit/delegate_spec.rb
160
172
  - spec/unit/image_title_screen_spec.rb
161
173
  - spec/unit/image_view_title_screen_spec.rb
@@ -173,7 +185,9 @@ files:
173
185
  - spec/unit/tab_spec.rb
174
186
  - spec/unit/tables/table_indexable_spec.rb
175
187
  - spec/unit/tables/table_module_spec.rb
188
+ - spec/unit/tables/table_refreshable_spec.rb
176
189
  - spec/unit/tables/table_screen_spec.rb
190
+ - spec/unit/tables/table_searchable_spec.rb
177
191
  - spec/unit/tables/table_utils_spec.rb
178
192
  - spec/unit/tables/table_view_cell_spec.rb
179
193
  - spec/unit/view_helper_spec.rb
@@ -194,12 +208,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
194
208
  version: '0'
195
209
  required_rubygems_version: !ruby/object:Gem::Requirement
196
210
  requirements:
197
- - - ">="
211
+ - - ">"
198
212
  - !ruby/object:Gem::Version
199
- version: '0'
213
+ version: 1.3.1
200
214
  requirements: []
201
215
  rubyforge_project:
202
- rubygems_version: 2.2.0
216
+ rubygems_version: 2.4.5
203
217
  signing_key:
204
218
  specification_version: 4
205
219
  summary: ProMotion is a fast way to get started building RubyMotion apps. Instead
@@ -215,6 +229,7 @@ test_files:
215
229
  - spec/functional/func_table_screen_updating_spec.rb
216
230
  - spec/functional/func_web_screen_spec.rb
217
231
  - spec/helpers/test_helper.rb
232
+ - spec/unit/collection_screen_spec.rb
218
233
  - spec/unit/delegate_spec.rb
219
234
  - spec/unit/image_title_screen_spec.rb
220
235
  - spec/unit/image_view_title_screen_spec.rb
@@ -232,7 +247,9 @@ test_files:
232
247
  - spec/unit/tab_spec.rb
233
248
  - spec/unit/tables/table_indexable_spec.rb
234
249
  - spec/unit/tables/table_module_spec.rb
250
+ - spec/unit/tables/table_refreshable_spec.rb
235
251
  - spec/unit/tables/table_screen_spec.rb
252
+ - spec/unit/tables/table_searchable_spec.rb
236
253
  - spec/unit/tables/table_utils_spec.rb
237
254
  - spec/unit/tables/table_view_cell_spec.rb
238
255
  - spec/unit/view_helper_spec.rb