formotion 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.travis.yml +1 -0
- data/Formotion.gemspec +1 -1
- data/LIST_OF_ROW_TYPES.md +115 -3
- data/README.md +1 -0
- data/examples/KitchenSink/app/app_delegate.rb +16 -2
- data/lib/formotion.rb +9 -1
- data/lib/formotion/form/form.rb +7 -0
- data/lib/formotion/form/form_delegate.rb +2 -2
- data/lib/formotion/patch/ui_image.rb +45 -0
- data/lib/formotion/patch/ui_text_view_placeholder.rb +4 -1
- data/lib/formotion/row/row.rb +13 -1
- data/lib/formotion/row_type/base.rb +13 -4
- data/lib/formotion/row_type/button.rb +1 -0
- data/lib/formotion/row_type/check_row.rb +2 -1
- data/lib/formotion/row_type/date_row.rb +3 -0
- data/lib/formotion/row_type/image_row.rb +6 -1
- data/lib/formotion/row_type/map_row.rb +79 -0
- data/lib/formotion/row_type/multi_choice_row.rb +25 -0
- data/lib/formotion/row_type/object_row.rb +30 -0
- data/lib/formotion/row_type/options_row.rb +2 -2
- data/lib/formotion/row_type/paged_image_row.rb +257 -0
- data/lib/formotion/row_type/picker_row.rb +2 -0
- data/lib/formotion/row_type/slider_row.rb +2 -2
- data/lib/formotion/row_type/static_row.rb +1 -1
- data/lib/formotion/row_type/string_row.rb +3 -7
- data/lib/formotion/row_type/subform_row.rb +3 -1
- data/lib/formotion/row_type/switch_row.rb +2 -2
- data/lib/formotion/row_type/tags_row.rb +172 -0
- data/lib/formotion/row_type/template_row.rb +3 -3
- data/lib/formotion/row_type/text_row.rb +5 -1
- data/lib/formotion/row_type/web_view_row.rb +44 -0
- data/lib/formotion/version.rb +1 -1
- data/resources/tags_row-selected.png +0 -0
- data/resources/tags_row-selected@2x.png +0 -0
- data/resources/tags_row.png +0 -0
- data/resources/tags_row@2x.png +0 -0
- data/spec/form_spec.rb +26 -0
- data/spec/functional/date_row_spec.rb +6 -0
- data/spec/functional/picker_row_spec.rb +5 -0
- data/spec/row_type/back_spec.rb +1 -1
- data/spec/row_type/base_spec.rb +3 -3
- data/spec/row_type/string_spec.rb +14 -3
- data/spec/row_type/subform_spec.rb +1 -1
- data/spec/row_type/submit_spec.rb +1 -1
- data/spec/row_type/text_spec.rb +7 -0
- metadata +17 -6
@@ -36,6 +36,13 @@ describe "String Row Type" do
|
|
36
36
|
@row.value.should == "other value"
|
37
37
|
end
|
38
38
|
|
39
|
+
it "should use custom font" do
|
40
|
+
huge_non_default_font = UIFont.boldSystemFontOfSize(20)
|
41
|
+
@row.font = huge_non_default_font
|
42
|
+
cell = @row.make_cell
|
43
|
+
@row.text_field.font.should == huge_non_default_font
|
44
|
+
end
|
45
|
+
|
39
46
|
# Placeholder
|
40
47
|
it "should have no placeholder by default" do
|
41
48
|
cell = @row.make_cell
|
@@ -59,22 +66,26 @@ describe "String Row Type" do
|
|
59
66
|
it "should call _on_select" do
|
60
67
|
@row.object.instance_variable_set("@called_on_select", false)
|
61
68
|
def (@row.object)._on_select(a, b); @called_on_select = true end
|
62
|
-
@row.object.
|
69
|
+
@row.object._on_select(nil, nil)
|
63
70
|
@row.object.instance_variable_get("@called_on_select").should == true
|
64
71
|
end
|
65
72
|
|
66
73
|
describe "when on_tap callback is set" do
|
67
74
|
tests_row :string do |row|
|
68
75
|
@on_tap_called = false
|
76
|
+
row.instance_variable_set("@text_field", Object.new.tap { |o|
|
77
|
+
def o.becomeFirstResponder
|
78
|
+
end
|
79
|
+
})
|
69
80
|
row.on_tap { |row| @on_tap_called = true }
|
70
81
|
end
|
71
82
|
|
72
83
|
it "should return true" do
|
73
|
-
@row.object.
|
84
|
+
@row.object._on_select(nil, nil).should == true
|
74
85
|
end
|
75
86
|
|
76
87
|
it "should call the callback" do
|
77
|
-
@row.object.
|
88
|
+
@row.object._on_select(nil, nil)
|
78
89
|
@on_tap_called.should == true
|
79
90
|
end
|
80
91
|
|
data/spec/row_type/text_spec.rb
CHANGED
@@ -26,6 +26,13 @@ describe "Text Row" do
|
|
26
26
|
@row.text_field.text.should == 'new value'
|
27
27
|
end
|
28
28
|
|
29
|
+
it "should use custom font" do
|
30
|
+
huge_non_default_font = UIFont.boldSystemFontOfSize(20)
|
31
|
+
@row.font = huge_non_default_font
|
32
|
+
cell = @row.make_cell
|
33
|
+
@row.text_field.font.should == huge_non_default_font
|
34
|
+
end
|
35
|
+
|
29
36
|
# Placeholder
|
30
37
|
it "should have no placeholder by default" do
|
31
38
|
cell = @row.make_cell
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clay Allsopp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bubble-wrap
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.3.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: motion-require
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,6 +127,7 @@ files:
|
|
127
127
|
- lib/formotion/model/formable.rb
|
128
128
|
- lib/formotion/patch/object.rb
|
129
129
|
- lib/formotion/patch/ui_action_sheet.rb
|
130
|
+
- lib/formotion/patch/ui_image.rb
|
130
131
|
- lib/formotion/patch/ui_text_field.rb
|
131
132
|
- lib/formotion/patch/ui_text_view.rb
|
132
133
|
- lib/formotion/patch/ui_text_view_placeholder.rb
|
@@ -142,8 +143,12 @@ files:
|
|
142
143
|
- lib/formotion/row_type/email_row.rb
|
143
144
|
- lib/formotion/row_type/image_row.rb
|
144
145
|
- lib/formotion/row_type/items_mapper.rb
|
146
|
+
- lib/formotion/row_type/map_row.rb
|
147
|
+
- lib/formotion/row_type/multi_choice_row.rb
|
145
148
|
- lib/formotion/row_type/number_row.rb
|
149
|
+
- lib/formotion/row_type/object_row.rb
|
146
150
|
- lib/formotion/row_type/options_row.rb
|
151
|
+
- lib/formotion/row_type/paged_image_row.rb
|
147
152
|
- lib/formotion/row_type/phone_row.rb
|
148
153
|
- lib/formotion/row_type/picker_row.rb
|
149
154
|
- lib/formotion/row_type/row_type.rb
|
@@ -153,10 +158,16 @@ files:
|
|
153
158
|
- lib/formotion/row_type/subform_row.rb
|
154
159
|
- lib/formotion/row_type/submit_row.rb
|
155
160
|
- lib/formotion/row_type/switch_row.rb
|
161
|
+
- lib/formotion/row_type/tags_row.rb
|
156
162
|
- lib/formotion/row_type/template_row.rb
|
157
163
|
- lib/formotion/row_type/text_row.rb
|
164
|
+
- lib/formotion/row_type/web_view_row.rb
|
158
165
|
- lib/formotion/section/section.rb
|
159
166
|
- lib/formotion/version.rb
|
167
|
+
- resources/tags_row-selected.png
|
168
|
+
- resources/tags_row-selected@2x.png
|
169
|
+
- resources/tags_row.png
|
170
|
+
- resources/tags_row@2x.png
|
160
171
|
- spec/form/persist_spec.rb
|
161
172
|
- spec/form_spec.rb
|
162
173
|
- spec/formable/kvo_spec.rb
|