formeze 2.1.1 → 2.2.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.
- data/formeze.gemspec +1 -1
- data/lib/formeze.rb +6 -0
- data/spec/formeze_spec.rb +8 -0
- metadata +3 -2
data/formeze.gemspec
CHANGED
data/lib/formeze.rb
CHANGED
@@ -214,6 +214,8 @@ module Formeze
|
|
214
214
|
end
|
215
215
|
|
216
216
|
def parse(encoded_form_data)
|
217
|
+
Kernel.warn '[formeze] the parse class method is deprecated and will be removed, please use the instance method instead'
|
218
|
+
|
217
219
|
new.tap { |form| form.parse(encoded_form_data) }
|
218
220
|
end
|
219
221
|
end
|
@@ -233,6 +235,8 @@ module Formeze
|
|
233
235
|
send(:"#{field.name}=", object.send(field.name))
|
234
236
|
end
|
235
237
|
end
|
238
|
+
|
239
|
+
return self
|
236
240
|
end
|
237
241
|
|
238
242
|
def parse(encoded_form_data)
|
@@ -271,6 +275,8 @@ module Formeze
|
|
271
275
|
self.class.validations.each do |validation|
|
272
276
|
validation.validate(self)
|
273
277
|
end
|
278
|
+
|
279
|
+
return self
|
274
280
|
end
|
275
281
|
|
276
282
|
def add_error(field, message)
|
data/spec/formeze_spec.rb
CHANGED
@@ -43,6 +43,10 @@ describe 'FormWithField' do
|
|
43
43
|
|
44
44
|
exception.message.must_equal('unexpected form keys: baz, foo')
|
45
45
|
end
|
46
|
+
|
47
|
+
it 'returns self' do
|
48
|
+
@form.parse('title=Untitled').must_equal(@form)
|
49
|
+
end
|
46
50
|
end
|
47
51
|
|
48
52
|
describe 'fill method' do
|
@@ -59,6 +63,10 @@ describe 'FormWithField' do
|
|
59
63
|
@form.fill(object)
|
60
64
|
@form.title.must_equal('Untitled')
|
61
65
|
end
|
66
|
+
|
67
|
+
it 'returns self' do
|
68
|
+
@form.fill({:title => 'Untitled'}).must_equal(@form)
|
69
|
+
end
|
62
70
|
end
|
63
71
|
end
|
64
72
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formeze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -80,3 +80,4 @@ signing_key:
|
|
80
80
|
specification_version: 3
|
81
81
|
summary: See description
|
82
82
|
test_files: []
|
83
|
+
has_rdoc:
|