roshi 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/roshi.rb +1 -1
- data/lib/roshi/active_model/validations/zip_code_validator.rb +11 -0
- data/lib/roshi/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89c1e7b7039c5e2ed89afcdc0f77456810045450
|
4
|
+
data.tar.gz: 3c35070c49f8282a08f142ceb43bd7b03d833f44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a147b67ee8260f0e806fb3ea096ccc6b077625136cc6f7b7a84618dd198456c5b1b480ba9cac6a75af82ffa10776b426150ad00db46bcc7efdd8bb7d5b7eaba6
|
7
|
+
data.tar.gz: e88ad951639b8eb8062720614d8069eb25ab7977e4b44699be352b3606509a6dec898328da73bfe0c97a8f929bc3cf3bd5725b75d80d00760e87f4447e928cd1
|
data/README.md
CHANGED
data/lib/roshi.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
module ActiveModel
|
2
|
+
module Validations
|
3
|
+
class ZipCodeValidator < EachValidator
|
4
|
+
def validate_each(record, attribute, value)
|
5
|
+
unless value =~ /\A\d{3}\-?\d{4}\z/i
|
6
|
+
record.errors.add(attribute, options[:message] || I18n.t('errors.messages.invalid'))
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/roshi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roshi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kawahiro311
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/roshi.rb
|
97
97
|
- lib/roshi/active_model/validations/email_validator.rb
|
98
98
|
- lib/roshi/active_model/validations/version_number_validator.rb
|
99
|
+
- lib/roshi/active_model/validations/zip_code_validator.rb
|
99
100
|
- lib/roshi/version.rb
|
100
101
|
- roshi.gemspec
|
101
102
|
homepage: https://github.com/fusic/roshi
|