roda-component 0.1.43 → 0.1.44
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/roda/component/form/validations.rb +4 -4
- data/lib/roda/component/form.rb +9 -1
- data/lib/roda/component/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e50f7bb6290f77be3eb924e2624c619eeb5fbc96
|
4
|
+
data.tar.gz: 2dfb6ca0a16f789ef3419a7ffb59cec7951c63df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6f866b81dd1c53b17d4bb6ad8a3b636bd53db7aab7aa68a5801cd1bd08e6f727efed6f89428ac968bf494dc8a5a8edede6abd2bebf50d67fb7694d404d082ad
|
7
|
+
data.tar.gz: 8524a48e32f6ea44c52d2841b281df3ec51268a6dd7d87f96cec6ba24f9e0e482c0e20e5691c9c27087ef9502fea5cf007afbf7fd08712870b28d4cd5ad947c0
|
@@ -166,9 +166,9 @@ class Roda
|
|
166
166
|
end
|
167
167
|
|
168
168
|
if client?
|
169
|
-
EMAIL = /^[a-
|
169
|
+
EMAIL = /^[a-z0-9!\#$%&'*\/=\?^{|}+_-]+(?:\.[a-z0-9!\#$%&'*\/=\?^{|}+_-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i
|
170
170
|
else
|
171
|
-
EMAIL = /\A[a-
|
171
|
+
EMAIL = /\A[a-z0-9!\#$%&'*\/=\?^{|}+_-]+(?:\.[a-z0-9!\#$%&'*\/=\?^{|}+_-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\z/i
|
172
172
|
end
|
173
173
|
|
174
174
|
def assert_email(att, error = [att, :not_email])
|
@@ -203,9 +203,9 @@ class Roda
|
|
203
203
|
# to make the case equality work, the check inverts the order of
|
204
204
|
# the arguments: `assert_equal :foo, Bar` is translated to the
|
205
205
|
# expression `Bar === send(:foo)`.
|
206
|
-
#
|
206
|
+
#
|
207
207
|
# @example
|
208
|
-
#
|
208
|
+
#
|
209
209
|
# def validate
|
210
210
|
# assert_equal :status, "pending"
|
211
211
|
# assert_equal :quantity, Fixnum
|
data/lib/roda/component/form.rb
CHANGED
@@ -259,7 +259,15 @@ class Roda
|
|
259
259
|
x['selected'] = true if x['value'] == value.to_s
|
260
260
|
end
|
261
261
|
when 'input'
|
262
|
-
element['
|
262
|
+
if element['type']=='radio'
|
263
|
+
if element['value'] == value.to_s
|
264
|
+
element['checked'] = true
|
265
|
+
else
|
266
|
+
element.delete 'checked'
|
267
|
+
end
|
268
|
+
else
|
269
|
+
element['value'] = value.to_s
|
270
|
+
end
|
263
271
|
when 'textarea'
|
264
272
|
element.val value.to_s
|
265
273
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roda-component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.44
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -1063,7 +1063,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1063
1063
|
version: '0'
|
1064
1064
|
requirements: []
|
1065
1065
|
rubyforge_project:
|
1066
|
-
rubygems_version: 2.4.
|
1066
|
+
rubygems_version: 2.4.3
|
1067
1067
|
signing_key:
|
1068
1068
|
specification_version: 4
|
1069
1069
|
summary: ''
|
@@ -1746,3 +1746,4 @@ test_files:
|
|
1746
1746
|
- test/dummy/public/form/js/index.js
|
1747
1747
|
- test/dummy/public/form/license.txt
|
1748
1748
|
- test/helper.rb
|
1749
|
+
has_rdoc:
|