formulary 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +65 -34
- data/formulary.gemspec +0 -1
- data/lib/formulary.rb +1 -5
- data/lib/formulary/html_form.rb +31 -13
- data/lib/formulary/html_form/fields.rb +16 -0
- data/lib/formulary/html_form/fields/checkbox_group.rb +1 -1
- data/lib/formulary/html_form/fields/color_input.rb +24 -0
- data/lib/formulary/html_form/fields/date_input.rb +59 -0
- data/lib/formulary/html_form/fields/email_input.rb +11 -2
- data/lib/formulary/html_form/fields/field.rb +15 -3
- data/lib/formulary/html_form/fields/field_group.rb +3 -3
- data/lib/formulary/html_form/fields/input.rb +1 -1
- data/lib/formulary/html_form/fields/month_input.rb +15 -0
- data/lib/formulary/html_form/fields/number_input.rb +63 -0
- data/lib/formulary/html_form/fields/password_input.rb +7 -0
- data/lib/formulary/html_form/fields/range_input.rb +7 -0
- data/lib/formulary/html_form/fields/search_input.rb +7 -0
- data/lib/formulary/html_form/fields/select.rb +1 -1
- data/lib/formulary/html_form/fields/week_input.rb +15 -0
- data/lib/formulary/html_form/labels.rb +39 -0
- data/lib/formulary/version.rb +1 -1
- data/spec/html_form/fields/checkbox_group_spec.rb +23 -10
- data/spec/html_form/fields/color_input_spec.rb +58 -0
- data/spec/html_form/fields/date_input_spec.rb +60 -0
- data/spec/html_form/fields/email_input_spec.rb +16 -6
- data/spec/html_form/fields/field_spec.rb +40 -1
- data/spec/html_form/fields/hidden_input_spec.rb +3 -1
- data/spec/html_form/fields/month_input_spec.rb +60 -0
- data/spec/html_form/fields/number_input_spec.rb +67 -0
- data/spec/html_form/fields/password_input_spec.rb +29 -0
- data/spec/html_form/fields/radio_button_group_spec.rb +27 -8
- data/spec/html_form/fields/range_input_spec.rb +20 -0
- data/spec/html_form/fields/search_input_spec.rb +18 -0
- data/spec/html_form/fields/select_spec.rb +10 -7
- data/spec/html_form/fields/tel_input_spec.rb +3 -3
- data/spec/html_form/fields/text_input_spec.rb +3 -3
- data/spec/html_form/fields/textarea_spec.rb +2 -2
- data/spec/html_form/fields/week_input_spec.rb +60 -0
- data/spec/html_form_spec.rb +234 -100
- data/spec/support/element_helper.rb +1 -1
- data/spec/support/shared_examples_for_pattern.rb +4 -2
- data/spec/support/shared_examples_for_required.rb +4 -2
- metadata +114 -106
data/spec/html_form_spec.rb
CHANGED
@@ -1,130 +1,264 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Formulary::HtmlForm do
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
context "with a form with complex validations" do
|
5
|
+
let(:markup) do
|
6
|
+
<<-EOS
|
7
|
+
<div class="lead widget">
|
7
8
|
|
8
|
-
|
9
|
+
<p class="heading">Apply</p>
|
9
10
|
|
10
|
-
|
11
|
+
<form id="lead_form" action="{{ widget.lead_form.submission_url.value }}" method="POST">
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
</
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
13
|
+
<div class="field">
|
14
|
+
<label for="first_name">First Name</label>
|
15
|
+
<input type="text" id="first_name" name="first_name" required />
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="field">
|
19
|
+
<input type="text" name="last_name" required />
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="field">
|
23
|
+
<label for="email">Email</label>
|
24
|
+
<input type="email" id="email" name="email" required />
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div class="field">
|
28
|
+
<label for="company_email">G5 Email</label>
|
29
|
+
<input type="email" id="company_email" name="g5_email" pattern="@getg5\.com$" />
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="field">
|
33
|
+
<label for="phone">Phone</label>
|
34
|
+
<input type="tel" name="phone" />
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div class="field">
|
38
|
+
<label for="message">Message</label>
|
39
|
+
<textarea name="message"></textarea>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<div class="field">
|
43
|
+
<label for="unit">Unit</label>
|
44
|
+
<select name="unit">
|
45
|
+
<option>5x5</option>
|
46
|
+
<option value="5x10">Five By Ten</option>
|
47
|
+
</select>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<fieldset>
|
51
|
+
<legend>What is your favorite grease?</legend>
|
52
|
+
<label><input type="radio" name="foods" value="bacon">Bacon</label>
|
53
|
+
<label><input type="radio" name="foods" value="butter" checked>Butter</label>
|
54
|
+
</fieldset>
|
55
|
+
|
56
|
+
<input type="radio" name="beverages" value="water">Water<br>
|
57
|
+
|
58
|
+
<label for="date">Date</label>
|
59
|
+
<input type="date" id="date" name="date" />
|
60
|
+
|
61
|
+
<input type="hidden" name="syndication_url" value="example.com" />
|
62
|
+
|
63
|
+
<label>
|
64
|
+
<input type="checkbox" name="terms">I accept your terms
|
65
|
+
</label>
|
66
|
+
|
67
|
+
<div class="field">
|
68
|
+
<label for="labeless_field"></label>
|
69
|
+
<input type="email" id="labeless_field" name="labeless_field" />
|
70
|
+
</div>
|
71
|
+
|
72
|
+
<div class="field">
|
73
|
+
<label for="number">Number</label>
|
74
|
+
<input type="number" name="number" id="number" min="5" />
|
75
|
+
</div>
|
64
76
|
|
65
|
-
|
77
|
+
<div class="field">
|
78
|
+
<label for="range">Range</label>
|
79
|
+
<input type="range" name="range" id="range" step="5" />
|
80
|
+
</div>
|
66
81
|
|
67
|
-
|
68
|
-
|
82
|
+
<div class="field">
|
83
|
+
<label for="search">Search</label>
|
84
|
+
<input type="search" name="search" id="search" />
|
85
|
+
</div>
|
69
86
|
|
70
|
-
|
71
|
-
|
87
|
+
<div class="field">
|
88
|
+
<label for="password">Password</label>
|
89
|
+
<input type="password" name="password" id="password" />
|
90
|
+
</div>
|
91
|
+
|
92
|
+
<div class="field">
|
93
|
+
<label for="color">Color</label>
|
94
|
+
<input type="color" name="color" id="color" />
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<input type="submit" value="Submit" />
|
98
|
+
<input type="button" value="Button" />
|
99
|
+
<input type="image" value="Image" />
|
100
|
+
<input type="reset" value="Reset" />
|
101
|
+
</form>
|
102
|
+
</div>
|
103
|
+
EOS
|
72
104
|
end
|
73
|
-
end
|
74
105
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
}
|
106
|
+
let(:html_form) { Formulary::HtmlForm.new(markup) }
|
107
|
+
|
108
|
+
context "unsupported field type" do
|
109
|
+
let(:markup) { %{<input type="bacon" name="delicious" />} }
|
110
|
+
|
111
|
+
it "explodes" do
|
112
|
+
expect { html_form }.to raise_error(Formulary::UnsupportedFieldType, /bacon/)
|
113
|
+
end
|
84
114
|
end
|
85
115
|
|
86
|
-
|
87
|
-
|
116
|
+
context "with a mismatch of field types for a group" do
|
117
|
+
let(:markup) do
|
118
|
+
%{
|
119
|
+
<input type="radio" name="bacon" />
|
120
|
+
<input type="checkbox" name="bacon" />
|
121
|
+
}
|
122
|
+
end
|
88
123
|
|
89
|
-
|
90
|
-
|
91
|
-
it { should be_true }
|
124
|
+
it "explodes" do
|
125
|
+
expect { html_form }.to raise_error(Formulary::UnsupportedFieldType, /bacon/)
|
92
126
|
end
|
127
|
+
end
|
93
128
|
|
94
|
-
|
95
|
-
|
96
|
-
|
129
|
+
describe "validations" do
|
130
|
+
let(:valid_params) do
|
131
|
+
{
|
132
|
+
first_name: "First",
|
133
|
+
last_name: "Last",
|
134
|
+
email: "test@test.com",
|
135
|
+
g5_email: "test@getg5.com",
|
136
|
+
unit: "5x5"
|
137
|
+
}
|
97
138
|
end
|
98
139
|
|
99
|
-
|
100
|
-
|
140
|
+
describe "#valid?" do
|
141
|
+
subject(:valid) { html_form.valid?(params) }
|
101
142
|
|
102
|
-
|
103
|
-
|
143
|
+
context "with a valid submission" do
|
144
|
+
let(:params) { valid_params }
|
145
|
+
it { should be_true }
|
146
|
+
end
|
147
|
+
|
148
|
+
context "with an invalid submission" do
|
149
|
+
let(:params) { {} }
|
150
|
+
it { should be_false }
|
151
|
+
end
|
152
|
+
|
153
|
+
context "due to unexpected parameters" do
|
154
|
+
let(:params) { valid_params.merge(extra: "test") }
|
155
|
+
|
156
|
+
it "raises a Formulary::UnexpectedParameter exception" do
|
157
|
+
expect { valid }.to raise_error(Formulary::UnexpectedParameter, /extra/)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
describe "#errors" do
|
163
|
+
before { html_form.valid?(params) }
|
164
|
+
subject { html_form.errors }
|
165
|
+
|
166
|
+
context "with a valid submission" do
|
167
|
+
let(:params) { valid_params }
|
168
|
+
it { should be_empty }
|
169
|
+
end
|
170
|
+
|
171
|
+
context "with an invalid submission" do
|
172
|
+
let(:params) do
|
173
|
+
{
|
174
|
+
email: "invalid",
|
175
|
+
g5_email: "test@example.com",
|
176
|
+
foods: "water",
|
177
|
+
date: "4 score and 7 years ago",
|
178
|
+
number: "1",
|
179
|
+
range: "8"
|
180
|
+
}
|
181
|
+
end
|
182
|
+
|
183
|
+
its(["first_name"]) { should eql("'First Name' is required") }
|
184
|
+
its(["email"]) { should include("'Email' is not a valid email address") }
|
185
|
+
its(["g5_email"]) { should include("'G5 Email' does not match the expected format") }
|
186
|
+
its(["foods"]) { should include("'What is your favorite grease?' must be chosen from the available options") }
|
187
|
+
its(["date"]) { should include("'Date' is not a properly formatted date") }
|
188
|
+
its(["number"]) { should include("'Number' must be greater than or equal to 5") }
|
189
|
+
its(["range"]) { should include("'Range' must be a step of 5, the nearest valid values are 5 and 10") }
|
104
190
|
end
|
105
191
|
end
|
106
192
|
end
|
107
193
|
|
108
|
-
describe "#
|
109
|
-
|
110
|
-
subject { html_form.errors }
|
194
|
+
describe "#label_for_field" do
|
195
|
+
subject { html_form.label_for_field(field_name) }
|
111
196
|
|
112
|
-
context "with a
|
113
|
-
let(:
|
114
|
-
it { should
|
197
|
+
context "with a label with a for attribute" do
|
198
|
+
let(:field_name) { "first_name" }
|
199
|
+
it { should eq("First Name") }
|
115
200
|
end
|
116
201
|
|
117
|
-
context "with
|
118
|
-
let(:
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
202
|
+
context "with no matching label" do
|
203
|
+
let(:field_name) { "last_name" }
|
204
|
+
it { should be_nil }
|
205
|
+
end
|
206
|
+
|
207
|
+
context "with a label with no text" do
|
208
|
+
let(:field_name) { "labeless_field" }
|
209
|
+
it { should eq("") }
|
210
|
+
end
|
211
|
+
|
212
|
+
context "with a parent label" do
|
213
|
+
let(:field_name) { "terms" }
|
214
|
+
it { should eq("I accept your terms") }
|
215
|
+
end
|
216
|
+
|
217
|
+
context "with a name and id mismatch on the field" do
|
218
|
+
let(:field_name) { "g5_email" }
|
219
|
+
it { should eq("G5 Email") }
|
220
|
+
end
|
221
|
+
|
222
|
+
context "with a fieldset" do
|
223
|
+
let(:field_name) { "foods" }
|
224
|
+
its(["fieldset"]) { should eq("What is your favorite grease?") }
|
225
|
+
its(["bacon"]) { should eq("Bacon") }
|
226
|
+
its(["butter"]) { should eq("Butter") }
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
context "with a form with nested fields" do
|
232
|
+
let(:markup) do
|
233
|
+
<<-EOS
|
234
|
+
<form id="lead_form" action="{{ widget.lead_form.submission_url.value }}" method="POST">
|
235
|
+
|
236
|
+
<label for="first_name">First Name</label>
|
237
|
+
<input type="text" name="first_name" required />
|
238
|
+
|
239
|
+
<label for="parent[child]">Nested Field</label>
|
240
|
+
<input type="text" name="parent[child]" required />
|
241
|
+
|
242
|
+
<input type="submit" value="Apply" />
|
243
|
+
</form>
|
244
|
+
EOS
|
245
|
+
end
|
246
|
+
|
247
|
+
subject(:valid) { Formulary::HtmlForm.new(markup).valid?(params) }
|
248
|
+
|
249
|
+
context "with valid nested parameters" do
|
250
|
+
let(:params) do
|
251
|
+
{ "first_name" => "Test", "parent" => { "child" => "nested value" } }
|
252
|
+
end
|
253
|
+
|
254
|
+
it { should be_true }
|
255
|
+
end
|
256
|
+
|
257
|
+
context "with invalid nested parameters" do
|
258
|
+
let(:params) { { "parent" => { "invalid" => "bad" } } }
|
123
259
|
|
124
|
-
|
125
|
-
|
126
|
-
its(["g5_email"]) { should include("format") }
|
127
|
-
its(["foods"]) { should include("choose") }
|
260
|
+
it " explodes violently" do
|
261
|
+
expect { valid }.to raise_error(Formulary::UnexpectedParameter, /invalid/)
|
128
262
|
end
|
129
263
|
end
|
130
264
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
shared_examples_for "a field that allows the pattern attribute" do
|
2
|
-
|
2
|
+
let(:markup_with_label) { "<label for='field'>Field</label>#{markup}" }
|
3
|
+
let(:html_form) { Formulary::HtmlForm.new(markup_with_label) }
|
4
|
+
subject(:input) { described_class.new(html_form, element) }
|
3
5
|
|
4
6
|
context "with a matching value" do
|
5
7
|
before { input.set_value(valid_value) }
|
@@ -10,6 +12,6 @@ shared_examples_for "a field that allows the pattern attribute" do
|
|
10
12
|
context "without a matching value" do
|
11
13
|
before { input.set_value("z") }
|
12
14
|
it { should_not be_valid }
|
13
|
-
its(:error) { should include("format") }
|
15
|
+
its(:error) { should include("'Field' does not match the expected format") }
|
14
16
|
end
|
15
17
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
shared_examples_for "a field that allows the required attribute" do
|
2
|
-
|
2
|
+
let(:markup_with_label) { "<label for='field'>Field</label>#{markup}" }
|
3
|
+
let(:html_form) { Formulary::HtmlForm.new(markup_with_label) }
|
4
|
+
subject(:input) { described_class.new(html_form, element) }
|
3
5
|
|
4
6
|
context "required" do
|
5
7
|
let(:markup) { markup_with_required }
|
@@ -19,7 +21,7 @@ shared_examples_for "a field that allows the required attribute" do
|
|
19
21
|
context "submitted a nil value" do
|
20
22
|
before { input.set_value(nil) }
|
21
23
|
it { should_not be_valid }
|
22
|
-
its(:error) { should
|
24
|
+
its(:error) { should eql("'Field' is required") }
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
metadata
CHANGED
@@ -1,121 +1,110 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: formulary
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: 0.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Matt Bohme
|
13
8
|
- Don Petersen
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: nokogiri
|
23
|
-
|
24
|
-
|
25
|
-
requirements:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
26
18
|
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 0
|
30
|
-
version: "0"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
31
21
|
type: :runtime
|
32
|
-
version_requirements: *id001
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: activesupport
|
35
22
|
prerelease: false
|
36
|
-
|
37
|
-
requirements:
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: activesupport
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
38
32
|
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
|
41
|
-
- 0
|
42
|
-
version: "0"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
43
35
|
type: :runtime
|
44
|
-
version_requirements: *id002
|
45
|
-
- !ruby/object:Gem::Dependency
|
46
|
-
name: email_veracity
|
47
36
|
prerelease: false
|
48
|
-
|
49
|
-
requirements:
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
50
39
|
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
|
53
|
-
|
54
|
-
version: "0"
|
55
|
-
type: :runtime
|
56
|
-
version_requirements: *id003
|
57
|
-
- !ruby/object:Gem::Dependency
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
58
43
|
name: bundler
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
segments:
|
65
|
-
- 1
|
66
|
-
- 3
|
67
|
-
version: "1.3"
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '1.3'
|
68
49
|
type: :development
|
69
|
-
version_requirements: *id004
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: rake
|
72
50
|
prerelease: false
|
73
|
-
|
74
|
-
requirements:
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '1.3'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
75
60
|
- - ">="
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
- 0
|
79
|
-
version: "0"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
80
63
|
type: :development
|
81
|
-
version_requirements: *id005
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name: rspec
|
84
64
|
prerelease: false
|
85
|
-
|
86
|
-
requirements:
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
87
74
|
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
|
90
|
-
- 0
|
91
|
-
version: "0"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
92
77
|
type: :development
|
93
|
-
version_requirements: *id006
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: pry
|
96
78
|
prerelease: false
|
97
|
-
|
98
|
-
requirements:
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
99
81
|
- - ">="
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
|
102
|
-
|
103
|
-
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: pry
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
104
91
|
type: :development
|
105
|
-
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
106
98
|
description: Valid form submission based on the HTML5 validation on the form itself
|
107
|
-
email:
|
99
|
+
email:
|
108
100
|
- matt.bohme@g5searchmarketing.com
|
109
101
|
- don.petersen@g5searchmarketing.com
|
110
102
|
executables: []
|
111
|
-
|
112
103
|
extensions: []
|
113
|
-
|
114
104
|
extra_rdoc_files: []
|
115
|
-
|
116
|
-
|
117
|
-
- .
|
118
|
-
- .rspec
|
105
|
+
files:
|
106
|
+
- ".gitignore"
|
107
|
+
- ".rspec"
|
119
108
|
- Gemfile
|
120
109
|
- LICENSE.txt
|
121
110
|
- README.md
|
@@ -125,73 +114,92 @@ files:
|
|
125
114
|
- lib/formulary/html_form.rb
|
126
115
|
- lib/formulary/html_form/fields.rb
|
127
116
|
- lib/formulary/html_form/fields/checkbox_group.rb
|
117
|
+
- lib/formulary/html_form/fields/color_input.rb
|
118
|
+
- lib/formulary/html_form/fields/date_input.rb
|
128
119
|
- lib/formulary/html_form/fields/email_input.rb
|
129
120
|
- lib/formulary/html_form/fields/field.rb
|
130
121
|
- lib/formulary/html_form/fields/field_group.rb
|
131
122
|
- lib/formulary/html_form/fields/hidden_input.rb
|
132
123
|
- lib/formulary/html_form/fields/input.rb
|
124
|
+
- lib/formulary/html_form/fields/month_input.rb
|
125
|
+
- lib/formulary/html_form/fields/number_input.rb
|
126
|
+
- lib/formulary/html_form/fields/password_input.rb
|
133
127
|
- lib/formulary/html_form/fields/radio_button_group.rb
|
128
|
+
- lib/formulary/html_form/fields/range_input.rb
|
129
|
+
- lib/formulary/html_form/fields/search_input.rb
|
134
130
|
- lib/formulary/html_form/fields/select.rb
|
135
131
|
- lib/formulary/html_form/fields/tel_input.rb
|
136
132
|
- lib/formulary/html_form/fields/text_input.rb
|
137
133
|
- lib/formulary/html_form/fields/textarea.rb
|
134
|
+
- lib/formulary/html_form/fields/week_input.rb
|
135
|
+
- lib/formulary/html_form/labels.rb
|
138
136
|
- lib/formulary/version.rb
|
139
137
|
- spec/html_form/fields/checkbox_group_spec.rb
|
138
|
+
- spec/html_form/fields/color_input_spec.rb
|
139
|
+
- spec/html_form/fields/date_input_spec.rb
|
140
140
|
- spec/html_form/fields/email_input_spec.rb
|
141
141
|
- spec/html_form/fields/field_spec.rb
|
142
142
|
- spec/html_form/fields/hidden_input_spec.rb
|
143
143
|
- spec/html_form/fields/input_spec.rb
|
144
|
+
- spec/html_form/fields/month_input_spec.rb
|
145
|
+
- spec/html_form/fields/number_input_spec.rb
|
146
|
+
- spec/html_form/fields/password_input_spec.rb
|
144
147
|
- spec/html_form/fields/radio_button_group_spec.rb
|
148
|
+
- spec/html_form/fields/range_input_spec.rb
|
149
|
+
- spec/html_form/fields/search_input_spec.rb
|
145
150
|
- spec/html_form/fields/select_spec.rb
|
146
151
|
- spec/html_form/fields/tel_input_spec.rb
|
147
152
|
- spec/html_form/fields/text_input_spec.rb
|
148
153
|
- spec/html_form/fields/textarea_spec.rb
|
154
|
+
- spec/html_form/fields/week_input_spec.rb
|
149
155
|
- spec/html_form_spec.rb
|
150
156
|
- spec/spec_helper.rb
|
151
157
|
- spec/support/element_helper.rb
|
152
158
|
- spec/support/shared_examples_for_pattern.rb
|
153
159
|
- spec/support/shared_examples_for_required.rb
|
154
|
-
has_rdoc: true
|
155
160
|
homepage: http://github.com/g5/formulary
|
156
|
-
licenses:
|
161
|
+
licenses:
|
157
162
|
- MIT
|
163
|
+
metadata: {}
|
158
164
|
post_install_message:
|
159
165
|
rdoc_options: []
|
160
|
-
|
161
|
-
require_paths:
|
166
|
+
require_paths:
|
162
167
|
- lib
|
163
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
164
|
-
requirements:
|
168
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
165
170
|
- - ">="
|
166
|
-
- !ruby/object:Gem::Version
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
|
-
requirements:
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
172
175
|
- - ">="
|
173
|
-
- !ruby/object:Gem::Version
|
174
|
-
|
175
|
-
- 0
|
176
|
-
version: "0"
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '0'
|
177
178
|
requirements: []
|
178
|
-
|
179
179
|
rubyforge_project:
|
180
|
-
rubygems_version:
|
180
|
+
rubygems_version: 2.2.0
|
181
181
|
signing_key:
|
182
|
-
specification_version:
|
182
|
+
specification_version: 4
|
183
183
|
summary: Valid form submission based on the HTML5 validation on the form itself
|
184
|
-
test_files:
|
184
|
+
test_files:
|
185
185
|
- spec/html_form/fields/checkbox_group_spec.rb
|
186
|
+
- spec/html_form/fields/color_input_spec.rb
|
187
|
+
- spec/html_form/fields/date_input_spec.rb
|
186
188
|
- spec/html_form/fields/email_input_spec.rb
|
187
189
|
- spec/html_form/fields/field_spec.rb
|
188
190
|
- spec/html_form/fields/hidden_input_spec.rb
|
189
191
|
- spec/html_form/fields/input_spec.rb
|
192
|
+
- spec/html_form/fields/month_input_spec.rb
|
193
|
+
- spec/html_form/fields/number_input_spec.rb
|
194
|
+
- spec/html_form/fields/password_input_spec.rb
|
190
195
|
- spec/html_form/fields/radio_button_group_spec.rb
|
196
|
+
- spec/html_form/fields/range_input_spec.rb
|
197
|
+
- spec/html_form/fields/search_input_spec.rb
|
191
198
|
- spec/html_form/fields/select_spec.rb
|
192
199
|
- spec/html_form/fields/tel_input_spec.rb
|
193
200
|
- spec/html_form/fields/text_input_spec.rb
|
194
201
|
- spec/html_form/fields/textarea_spec.rb
|
202
|
+
- spec/html_form/fields/week_input_spec.rb
|
195
203
|
- spec/html_form_spec.rb
|
196
204
|
- spec/spec_helper.rb
|
197
205
|
- spec/support/element_helper.rb
|