motion-kit 0.18.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -1
  3. data/lib/motion-kit-tvos/deprecated.rb +31 -0
  4. data/lib/motion-kit-tvos/dummy.rb +93 -0
  5. data/lib/motion-kit-tvos/helpers/constraints_helpers.rb +24 -0
  6. data/lib/motion-kit-tvos/helpers/layout_device.rb +36 -0
  7. data/lib/motion-kit-tvos/helpers/layout_orientation.rb +54 -0
  8. data/lib/motion-kit-tvos/helpers/uibutton_helpers.rb +52 -0
  9. data/lib/motion-kit-tvos/helpers/uiview_autoresizing_helpers.rb +79 -0
  10. data/lib/motion-kit-tvos/helpers/uiview_constraints_helpers.rb +36 -0
  11. data/lib/motion-kit-tvos/helpers/uiview_frame_helpers.rb +316 -0
  12. data/lib/motion-kit-tvos/helpers/uiview_gradient_helpers.rb +22 -0
  13. data/lib/motion-kit-tvos/helpers/uiview_helpers.rb +28 -0
  14. data/lib/motion-kit-tvos/ios_util.rb +24 -0
  15. data/lib/motion-kit.rb +2 -0
  16. data/lib/motion-kit/version.rb +1 -1
  17. data/spec/tvos/apply_styles_spec.rb +37 -0
  18. data/spec/tvos/autoresizing_helper_spec.rb +240 -0
  19. data/spec/tvos/calayer_spec.rb +23 -0
  20. data/spec/tvos/calculate_spec.rb +322 -0
  21. data/spec/tvos/calculator_spec.rb +31 -0
  22. data/spec/tvos/child_layouts_spec.rb +65 -0
  23. data/spec/tvos/constraints_helpers/active_constraints_spec.rb +25 -0
  24. data/spec/tvos/constraints_helpers/attribute_lookup_spec.rb +27 -0
  25. data/spec/tvos/constraints_helpers/axis_lookup_spec.rb +13 -0
  26. data/spec/tvos/constraints_helpers/center_constraints_spec.rb +421 -0
  27. data/spec/tvos/constraints_helpers/constraint_placeholder_spec.rb +72 -0
  28. data/spec/tvos/constraints_helpers/priority_lookup_spec.rb +19 -0
  29. data/spec/tvos/constraints_helpers/relationship_lookup_spec.rb +27 -0
  30. data/spec/tvos/constraints_helpers/relative_corners_spec.rb +276 -0
  31. data/spec/tvos/constraints_helpers/relative_location_spec.rb +113 -0
  32. data/spec/tvos/constraints_helpers/scale_constraints_spec.rb +62 -0
  33. data/spec/tvos/constraints_helpers/simple_constraints_spec.rb +2755 -0
  34. data/spec/tvos/constraints_helpers/size_constraints_spec.rb +423 -0
  35. data/spec/tvos/constraints_helpers/view_lookup_constraints_spec.rb +95 -0
  36. data/spec/tvos/create_layout_spec.rb +40 -0
  37. data/spec/tvos/custom_layout_spec.rb +13 -0
  38. data/spec/tvos/custom_root_layout_spec.rb +57 -0
  39. data/spec/tvos/deferred_spec.rb +89 -0
  40. data/spec/tvos/device_helpers_spec.rb +58 -0
  41. data/spec/tvos/frame_helper_spec.rb +1160 -0
  42. data/spec/tvos/layer_layout_spec.rb +36 -0
  43. data/spec/tvos/layout_extensions_spec.rb +70 -0
  44. data/spec/tvos/layout_spec.rb +57 -0
  45. data/spec/tvos/layout_state_spec.rb +27 -0
  46. data/spec/tvos/memory_leak_spec.rb +74 -0
  47. data/spec/tvos/motion_kit_id_spec.rb +15 -0
  48. data/spec/tvos/motionkit_util_spec.rb +15 -0
  49. data/spec/tvos/nearest_spec.rb +80 -0
  50. data/spec/tvos/objc_selectors_spec.rb +10 -0
  51. data/spec/tvos/orientation_helper_specs.rb +67 -0
  52. data/spec/tvos/parent_layout_spec.rb +19 -0
  53. data/spec/tvos/parent_spec.rb +45 -0
  54. data/spec/tvos/prev_next_spec.rb +153 -0
  55. data/spec/tvos/reapply_frame.rb +64 -0
  56. data/spec/tvos/relative_layout.spec.rb +31 -0
  57. data/spec/tvos/remove_layout_spec.rb +28 -0
  58. data/spec/tvos/root_layout_spec.rb +53 -0
  59. data/spec/tvos/setters_spec.rb +63 -0
  60. data/spec/tvos/uibutton_layout_spec.rb +37 -0
  61. data/spec/tvos/uitextfield_spec.rb +14 -0
  62. data/spec/tvos/view_attr_spec.rb +32 -0
  63. metadata +118 -8
@@ -0,0 +1,37 @@
1
+ describe 'UIButton Layout and objc-style selectors' do
2
+
3
+ before do
4
+ @layout = TestButtonLayout.new
5
+ @layout.view
6
+ end
7
+
8
+ it 'should set the title' do
9
+ @layout.get(:button).currentTitle.should == TestButtonLayout::TITLE
10
+ end
11
+
12
+ it 'should set the highlighted title' do
13
+ @layout.get(:button).titleForState(UIControlStateHighlighted).should == TestButtonLayout::HIGHLIGHTED_TITLE
14
+ end
15
+
16
+ it 'should set the image' do
17
+ @layout.get(:button).currentImage.should == TestButtonLayout::IMAGE
18
+ end
19
+
20
+ it 'should set the highlighted image' do
21
+ @layout.get(:button).imageForState(UIControlStateHighlighted).should == TestButtonLayout::HIGHLIGHTED_IMAGE
22
+ end
23
+
24
+ it 'should set the titleLabel font' do
25
+ font = @layout.get(:button).titleLabel.font
26
+ should_be_font = UIFont.fontWithName(TestButtonLayout::FONT, size: TestButtonLayout::SIZE)
27
+
28
+ font.familyName.should == should_be_font.familyName
29
+ font.pointSize.should == should_be_font.pointSize
30
+ end
31
+
32
+ it 'should set the titleLabel textAlignment' do
33
+ alignment = @layout.get(:button).titleLabel.textAlignment
34
+ alignment.should == NSTextAlignmentCenter
35
+ end
36
+
37
+ end
@@ -0,0 +1,14 @@
1
+ describe 'UITextField Layout and objc-style selectors' do
2
+
3
+ before do
4
+ @layout = TestTextFieldLayout.new
5
+ @layout.view
6
+ end
7
+
8
+ it 'should set autocorrectionType' do
9
+ @layout.get(:field).autocorrectionType.should == UITextAutocorrectionTypeNo
10
+ @layout.get(:field).spellCheckingType.should == UITextSpellCheckingTypeNo
11
+ @layout.get(:field).autocapitalizationType.should == UITextAutocapitalizationTypeNone
12
+ end
13
+
14
+ end
@@ -0,0 +1,32 @@
1
+ describe 'View attr' do
2
+
3
+ before do
4
+ @layout = TestViewAttrLayout.new
5
+ end
6
+
7
+ it 'should get :button' do
8
+ @layout.view
9
+ button = @layout.button
10
+ button.should.be.kind_of(UIButton)
11
+ end
12
+
13
+ it 'should return the same :button' do
14
+ @layout.view
15
+ button = @layout.button
16
+ button.should == @layout.button
17
+ end
18
+
19
+ it 'should call layout if the view doesnt exist' do
20
+ label = @layout.label
21
+ label.should.be.kind_of(UILabel)
22
+ label.should == @layout.label
23
+ end
24
+
25
+ it 'should handle multiple views' do
26
+ @layout.view
27
+ text_field = @layout.text_field
28
+ text_field.should.be.kind_of(UITextField)
29
+ text_view = @layout.text_view
30
+ text_view.should.be.kind_of(UITextView)
31
+ end
32
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin T.A. Gray
@@ -9,20 +9,26 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-17 00:00:00.000000000 Z
12
+ date: 2016-01-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dbt
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.1'
21
+ - - ">="
19
22
  - !ruby/object:Gem::Version
20
23
  version: 1.1.5
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - ~>
28
+ - - "~>"
29
+ - !ruby/object:Gem::Version
30
+ version: '1.1'
31
+ - - ">="
26
32
  - !ruby/object:Gem::Version
27
33
  version: 1.1.5
28
34
  description: |
@@ -75,6 +81,18 @@ files:
75
81
  - lib/motion-kit-osx/helpers/nswindow_frame_helpers.rb
76
82
  - lib/motion-kit-osx/helpers/nswindow_helpers.rb
77
83
  - lib/motion-kit-osx/osx_util.rb
84
+ - lib/motion-kit-tvos/deprecated.rb
85
+ - lib/motion-kit-tvos/dummy.rb
86
+ - lib/motion-kit-tvos/helpers/constraints_helpers.rb
87
+ - lib/motion-kit-tvos/helpers/layout_device.rb
88
+ - lib/motion-kit-tvos/helpers/layout_orientation.rb
89
+ - lib/motion-kit-tvos/helpers/uibutton_helpers.rb
90
+ - lib/motion-kit-tvos/helpers/uiview_autoresizing_helpers.rb
91
+ - lib/motion-kit-tvos/helpers/uiview_constraints_helpers.rb
92
+ - lib/motion-kit-tvos/helpers/uiview_frame_helpers.rb
93
+ - lib/motion-kit-tvos/helpers/uiview_gradient_helpers.rb
94
+ - lib/motion-kit-tvos/helpers/uiview_helpers.rb
95
+ - lib/motion-kit-tvos/ios_util.rb
78
96
  - lib/motion-kit.rb
79
97
  - lib/motion-kit/calculator/calculate.rb
80
98
  - lib/motion-kit/calculator/calculator.rb
@@ -153,9 +171,55 @@ files:
153
171
  - spec/osx/nswindow_frame_helper_spec.rb
154
172
  - spec/osx/root_menu_spec.rb
155
173
  - spec/osx/table_view_spec.rb
174
+ - spec/tvos/apply_styles_spec.rb
175
+ - spec/tvos/autoresizing_helper_spec.rb
176
+ - spec/tvos/calayer_spec.rb
177
+ - spec/tvos/calculate_spec.rb
178
+ - spec/tvos/calculator_spec.rb
179
+ - spec/tvos/child_layouts_spec.rb
180
+ - spec/tvos/constraints_helpers/active_constraints_spec.rb
181
+ - spec/tvos/constraints_helpers/attribute_lookup_spec.rb
182
+ - spec/tvos/constraints_helpers/axis_lookup_spec.rb
183
+ - spec/tvos/constraints_helpers/center_constraints_spec.rb
184
+ - spec/tvos/constraints_helpers/constraint_placeholder_spec.rb
185
+ - spec/tvos/constraints_helpers/priority_lookup_spec.rb
186
+ - spec/tvos/constraints_helpers/relationship_lookup_spec.rb
187
+ - spec/tvos/constraints_helpers/relative_corners_spec.rb
188
+ - spec/tvos/constraints_helpers/relative_location_spec.rb
189
+ - spec/tvos/constraints_helpers/scale_constraints_spec.rb
190
+ - spec/tvos/constraints_helpers/simple_constraints_spec.rb
191
+ - spec/tvos/constraints_helpers/size_constraints_spec.rb
192
+ - spec/tvos/constraints_helpers/view_lookup_constraints_spec.rb
193
+ - spec/tvos/create_layout_spec.rb
194
+ - spec/tvos/custom_layout_spec.rb
195
+ - spec/tvos/custom_root_layout_spec.rb
196
+ - spec/tvos/deferred_spec.rb
197
+ - spec/tvos/device_helpers_spec.rb
198
+ - spec/tvos/frame_helper_spec.rb
199
+ - spec/tvos/layer_layout_spec.rb
200
+ - spec/tvos/layout_extensions_spec.rb
201
+ - spec/tvos/layout_spec.rb
202
+ - spec/tvos/layout_state_spec.rb
203
+ - spec/tvos/memory_leak_spec.rb
204
+ - spec/tvos/motion_kit_id_spec.rb
205
+ - spec/tvos/motionkit_util_spec.rb
206
+ - spec/tvos/nearest_spec.rb
207
+ - spec/tvos/objc_selectors_spec.rb
208
+ - spec/tvos/orientation_helper_specs.rb
209
+ - spec/tvos/parent_layout_spec.rb
210
+ - spec/tvos/parent_spec.rb
211
+ - spec/tvos/prev_next_spec.rb
212
+ - spec/tvos/reapply_frame.rb
213
+ - spec/tvos/relative_layout.spec.rb
214
+ - spec/tvos/remove_layout_spec.rb
215
+ - spec/tvos/root_layout_spec.rb
216
+ - spec/tvos/setters_spec.rb
217
+ - spec/tvos/uibutton_layout_spec.rb
218
+ - spec/tvos/uitextfield_spec.rb
219
+ - spec/tvos/view_attr_spec.rb
156
220
  homepage: https://github.com/rubymotion/motion-kit
157
221
  licenses:
158
- - BSD
222
+ - MIT
159
223
  metadata: {}
160
224
  post_install_message:
161
225
  rdoc_options: []
@@ -163,17 +227,17 @@ require_paths:
163
227
  - lib
164
228
  required_ruby_version: !ruby/object:Gem::Requirement
165
229
  requirements:
166
- - - '>='
230
+ - - ">="
167
231
  - !ruby/object:Gem::Version
168
232
  version: '0'
169
233
  required_rubygems_version: !ruby/object:Gem::Requirement
170
234
  requirements:
171
- - - '>='
235
+ - - ">="
172
236
  - !ruby/object:Gem::Version
173
237
  version: '0'
174
238
  requirements: []
175
239
  rubyforge_project:
176
- rubygems_version: 2.4.5
240
+ rubygems_version: 2.4.5.1
177
241
  signing_key:
178
242
  specification_version: 4
179
243
  summary: The RubyMotion layout and styling gem.
@@ -242,3 +306,49 @@ test_files:
242
306
  - spec/osx/nswindow_frame_helper_spec.rb
243
307
  - spec/osx/root_menu_spec.rb
244
308
  - spec/osx/table_view_spec.rb
309
+ - spec/tvos/apply_styles_spec.rb
310
+ - spec/tvos/autoresizing_helper_spec.rb
311
+ - spec/tvos/calayer_spec.rb
312
+ - spec/tvos/calculate_spec.rb
313
+ - spec/tvos/calculator_spec.rb
314
+ - spec/tvos/child_layouts_spec.rb
315
+ - spec/tvos/constraints_helpers/active_constraints_spec.rb
316
+ - spec/tvos/constraints_helpers/attribute_lookup_spec.rb
317
+ - spec/tvos/constraints_helpers/axis_lookup_spec.rb
318
+ - spec/tvos/constraints_helpers/center_constraints_spec.rb
319
+ - spec/tvos/constraints_helpers/constraint_placeholder_spec.rb
320
+ - spec/tvos/constraints_helpers/priority_lookup_spec.rb
321
+ - spec/tvos/constraints_helpers/relationship_lookup_spec.rb
322
+ - spec/tvos/constraints_helpers/relative_corners_spec.rb
323
+ - spec/tvos/constraints_helpers/relative_location_spec.rb
324
+ - spec/tvos/constraints_helpers/scale_constraints_spec.rb
325
+ - spec/tvos/constraints_helpers/simple_constraints_spec.rb
326
+ - spec/tvos/constraints_helpers/size_constraints_spec.rb
327
+ - spec/tvos/constraints_helpers/view_lookup_constraints_spec.rb
328
+ - spec/tvos/create_layout_spec.rb
329
+ - spec/tvos/custom_layout_spec.rb
330
+ - spec/tvos/custom_root_layout_spec.rb
331
+ - spec/tvos/deferred_spec.rb
332
+ - spec/tvos/device_helpers_spec.rb
333
+ - spec/tvos/frame_helper_spec.rb
334
+ - spec/tvos/layer_layout_spec.rb
335
+ - spec/tvos/layout_extensions_spec.rb
336
+ - spec/tvos/layout_spec.rb
337
+ - spec/tvos/layout_state_spec.rb
338
+ - spec/tvos/memory_leak_spec.rb
339
+ - spec/tvos/motion_kit_id_spec.rb
340
+ - spec/tvos/motionkit_util_spec.rb
341
+ - spec/tvos/nearest_spec.rb
342
+ - spec/tvos/objc_selectors_spec.rb
343
+ - spec/tvos/orientation_helper_specs.rb
344
+ - spec/tvos/parent_layout_spec.rb
345
+ - spec/tvos/parent_spec.rb
346
+ - spec/tvos/prev_next_spec.rb
347
+ - spec/tvos/reapply_frame.rb
348
+ - spec/tvos/relative_layout.spec.rb
349
+ - spec/tvos/remove_layout_spec.rb
350
+ - spec/tvos/root_layout_spec.rb
351
+ - spec/tvos/setters_spec.rb
352
+ - spec/tvos/uibutton_layout_spec.rb
353
+ - spec/tvos/uitextfield_spec.rb
354
+ - spec/tvos/view_attr_spec.rb