valid8ors 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +78 -65
- data/Rakefile +6 -0
- data/lib/valid8ors/absence.rb +23 -0
- data/lib/valid8ors.rb +1 -0
- data/test/absence_test.rb +39 -0
- data/test/blacklist_test.rb +11 -11
- data/test/email_format_test.rb +26 -26
- data/test/password_strength_test.rb +18 -18
- data/test/reserved_test.rb +13 -13
- data/test/test_helper.rb +0 -5
- data/test/url_format_test.rb +18 -18
- data/valid8ors.gemspec +1 -1
- metadata +15 -7
data/README.md
CHANGED
@@ -14,79 +14,75 @@ Then run:
|
|
14
14
|
|
15
15
|
## Blacklist Validator
|
16
16
|
|
17
|
-
|
17
|
+
Check that an attribute doesn't contain blacklisted values.
|
18
18
|
|
19
|
-
|
19
|
+
### Usage
|
20
20
|
|
21
|
-
|
21
|
+
```ruby
|
22
|
+
class User < ActiveRecord::Base
|
23
|
+
validates :name, blacklist: true
|
24
|
+
end
|
25
|
+
```
|
22
26
|
|
23
27
|
### Blacklist file
|
24
28
|
|
25
29
|
You can create a blacklist.yml file in the config directory of your Rails application if you need to overload the one used by this gem.
|
26
30
|
|
27
|
-
### I18n
|
28
|
-
|
29
|
-
If you use I18n, the default key to translate is :blacklisted. So if you add to your User model:
|
31
|
+
### I18n error message
|
30
32
|
|
31
|
-
|
33
|
+
Key to translate: **:blacklisted**.
|
34
|
+
Hence, considering the example above, the translation path would be:
|
32
35
|
|
33
|
-
|
34
|
-
|
35
|
-
### Tests
|
36
|
-
|
37
|
-
cd test
|
38
|
-
ruby blacklist_test.rb
|
36
|
+
en.activerecord.errors.models.user.attributes.name.blacklisted
|
39
37
|
|
40
38
|
## Reserved Validator
|
41
39
|
|
42
|
-
|
40
|
+
Validate an attribute against a reserved list of values.
|
43
41
|
|
44
|
-
|
42
|
+
### Usage
|
45
43
|
|
46
|
-
|
44
|
+
```ruby
|
45
|
+
class User < ActiveRecord::Base
|
46
|
+
validates :name, reserved: true
|
47
|
+
end
|
48
|
+
```
|
47
49
|
|
48
50
|
### Reserved file
|
49
51
|
|
50
52
|
You can create a reserved.yml file in the config directory of your Rails application if you need to overload the one used by this gem.
|
51
53
|
|
52
|
-
### I18n
|
53
|
-
|
54
|
-
If you use I18n, the default key to translate is :reserved. So if you add to your User model:
|
55
|
-
|
56
|
-
validates :name, reserved: true
|
54
|
+
### I18n error message
|
57
55
|
|
58
|
-
|
56
|
+
Key to translate: **:reserved**.
|
57
|
+
Hence, considering the example above, the translation path would be:
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
cd test
|
63
|
-
ruby reserved_test.rb
|
59
|
+
en.activerecord.errors.models.user.attributes.name.reserved
|
64
60
|
|
65
61
|
## Email Format Validator
|
66
62
|
|
67
63
|
### Usage
|
68
64
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
65
|
+
```ruby
|
66
|
+
class User < ActiveRecord::Base
|
67
|
+
validates :email, email_format: true
|
68
|
+
end
|
69
|
+
```
|
74
70
|
|
75
|
-
|
71
|
+
Restrict your validation to specific domains:
|
76
72
|
|
77
|
-
|
73
|
+
```ruby
|
74
|
+
class User < ActiveRecord::Base
|
75
|
+
validates :email, email_format: { domains: ['gmail.com', 'live.com'] }
|
76
|
+
end
|
77
|
+
```
|
78
78
|
|
79
|
-
|
80
|
-
So if you add to your User model:
|
79
|
+
### I18n error messages
|
81
80
|
|
82
|
-
|
81
|
+
Keys to translate: **:improperly_formatted** (when not an email format) and **:invalid_domain** (when email domain not listed in "domains" option).
|
82
|
+
Hence, considering the two examples above, translation paths would be:
|
83
83
|
|
84
|
-
|
85
|
-
|
86
|
-
### Tests
|
87
|
-
|
88
|
-
cd test
|
89
|
-
ruby email_format_test.rb
|
84
|
+
en.activerecord.errors.models.user.attributes.email.improperly_formatted
|
85
|
+
en.activerecord.errors.models.user.attributes.email.invalid_domain
|
90
86
|
|
91
87
|
### Credits
|
92
88
|
|
@@ -96,22 +92,18 @@ Regular Expression tests based on [Comparing E-mail Address Validating Regular E
|
|
96
92
|
|
97
93
|
### Usage
|
98
94
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
If you use I18n, the default key to translate is :improperly_formatted. So if you add to your User model:
|
106
|
-
|
107
|
-
validates :url, url_format: true
|
95
|
+
```ruby
|
96
|
+
class User < ActiveRecord::Base
|
97
|
+
validates :url, url_format: true
|
98
|
+
end
|
99
|
+
```
|
108
100
|
|
109
|
-
|
101
|
+
### I18n error message
|
110
102
|
|
111
|
-
|
103
|
+
Key to translate: **:improperly_formatted**.
|
104
|
+
Hence, considering the example above, the translation path would be:
|
112
105
|
|
113
|
-
|
114
|
-
ruby url_format_test.rb
|
106
|
+
en.activerecord.errors.models.user.attributes.url.improperly_formatted
|
115
107
|
|
116
108
|
## Password Strength Validator
|
117
109
|
|
@@ -120,23 +112,44 @@ Password length validation is not included here as you can use Rails' builtin "L
|
|
120
112
|
|
121
113
|
### Usage
|
122
114
|
|
123
|
-
|
115
|
+
```ruby
|
116
|
+
class User < ActiveRecord::Base
|
117
|
+
validates :password, password_strength: true
|
118
|
+
end
|
119
|
+
```
|
124
120
|
|
125
|
-
|
121
|
+
### I18n error message
|
122
|
+
|
123
|
+
Key to translate: **:insecure**.
|
124
|
+
Hence, considering the example above, the translation path would be:
|
125
|
+
|
126
|
+
en.activerecord.errors.models.user.attributes.password.insecure
|
127
|
+
|
128
|
+
## Absence Validator
|
129
|
+
|
130
|
+
By default, checks if an attribute is nil. Use allow_blank option to accept empty objects.
|
131
|
+
|
132
|
+
### Usage
|
126
133
|
|
127
|
-
|
134
|
+
```ruby
|
135
|
+
class User < ActiveRecord::Base
|
136
|
+
validates :name, absence: true # Validate name is nil
|
137
|
+
validates :email, absence: { allow_blank: true } # Validate email is blank
|
138
|
+
end
|
139
|
+
```
|
128
140
|
|
129
|
-
|
141
|
+
### I18n error message
|
130
142
|
|
131
|
-
|
143
|
+
Key to translate: **:not_absent**.
|
144
|
+
Hence, considering the example above, translation paths would be:
|
132
145
|
|
133
|
-
|
146
|
+
en.activerecord.errors.models.user.attributes.name.not_absent
|
147
|
+
en.activerecord.errors.models.user.attributes.email.not_absent
|
134
148
|
|
135
|
-
|
149
|
+
## Tests
|
136
150
|
|
137
|
-
|
138
|
-
ruby password_strength_test.rb
|
151
|
+
rake test
|
139
152
|
|
140
153
|
## Compatibility
|
141
154
|
|
142
|
-
Ruby
|
155
|
+
Ruby version >= 1.9.x
|
data/Rakefile
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
class AbsenceValidator < ActiveModel::EachValidator
|
4
|
+
|
5
|
+
def validate_each(record, attribute, value)
|
6
|
+
condition = options[:allow_blank?] ? :blank? : :nil?
|
7
|
+
record.errors.add(attribute, invalid_message(record, attribute)) unless value.send(condition)
|
8
|
+
end
|
9
|
+
|
10
|
+
#######################
|
11
|
+
### Private methods ###
|
12
|
+
#######################
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def invalid_message(record, attribute)
|
17
|
+
I18n.t :not_absent,
|
18
|
+
scope: "#{record.class.i18n_scope}.errors.models.#{record.class.model_name.i18n_key}.attributes.#{attribute}",
|
19
|
+
default: "is present when it should be absent"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
data/lib/valid8ors.rb
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require_relative 'test_helper'
|
4
|
+
|
5
|
+
class TestAbsenceValidator < MiniTest::Unit::TestCase
|
6
|
+
|
7
|
+
class User < TestModel
|
8
|
+
validates :name, absence: true
|
9
|
+
end
|
10
|
+
|
11
|
+
class OtherUser < TestModel
|
12
|
+
validates :name, absence: { allow_blank: true }
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_when_name_absent
|
16
|
+
user = User.new
|
17
|
+
assert user.valid?
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_when_name_present_or_blank
|
21
|
+
["", "James"].each do |name|
|
22
|
+
user = User.new(name: name)
|
23
|
+
refute user.valid?
|
24
|
+
assert user.errors[:name]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_when_allow_blank
|
29
|
+
other_user = OtherUser.new(name: "")
|
30
|
+
assert other_user.valid?
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_default_message_on_error
|
34
|
+
user = User.new(name: "James")
|
35
|
+
refute user.valid?
|
36
|
+
assert user.errors[:name].include?("is present when it should be absent")
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
data/test/blacklist_test.rb
CHANGED
@@ -2,28 +2,28 @@
|
|
2
2
|
|
3
3
|
require_relative 'test_helper'
|
4
4
|
|
5
|
-
class TestUser < TestModel
|
6
|
-
validates :name, blacklist: true
|
7
|
-
end
|
8
|
-
|
9
5
|
class TestBlacklistValidator < MiniTest::Unit::TestCase
|
10
6
|
|
7
|
+
class User < TestModel
|
8
|
+
validates :name, blacklist: true
|
9
|
+
end
|
10
|
+
|
11
11
|
def test_some_blacklisted_words
|
12
12
|
names_that_should_be_blacklisted.each do |name|
|
13
|
-
|
14
|
-
refute
|
15
|
-
assert
|
13
|
+
user = User.new(name: name)
|
14
|
+
refute user.valid?
|
15
|
+
assert user.errors[:name]
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_some_whitelisted_words
|
20
|
-
names_that_should_be_whitelisted.each { |name| assert
|
20
|
+
names_that_should_be_whitelisted.each { |name| assert User.new(name: name).valid? }
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_default_message_on_error
|
24
|
-
|
25
|
-
refute
|
26
|
-
assert
|
24
|
+
user = User.new(name: "Get up, fuck up")
|
25
|
+
refute user.valid?
|
26
|
+
assert user.errors[:name].include?("is blacklisted")
|
27
27
|
end
|
28
28
|
|
29
29
|
#######################
|
data/test/email_format_test.rb
CHANGED
@@ -2,30 +2,30 @@
|
|
2
2
|
|
3
3
|
require_relative 'test_helper'
|
4
4
|
|
5
|
-
class
|
6
|
-
validates :email, email_format: true
|
7
|
-
end
|
5
|
+
class TestEmailFormatValidator < MiniTest::Unit::TestCase
|
8
6
|
|
9
|
-
class
|
10
|
-
|
11
|
-
end
|
7
|
+
class User < TestModel
|
8
|
+
validates :email, email_format: true
|
9
|
+
end
|
12
10
|
|
13
|
-
class
|
14
|
-
|
15
|
-
end
|
11
|
+
class UserWithEmailDomains < TestModel
|
12
|
+
validates :email, email_format: { domains: ['mail.com', 'subdomain.mail.com'] }
|
13
|
+
end
|
16
14
|
|
17
|
-
class
|
18
|
-
|
19
|
-
end
|
15
|
+
class UserAllowsNilEmailToTrue < TestModel
|
16
|
+
validates :email, email_format: { allow_nil: true }
|
17
|
+
end
|
20
18
|
|
21
|
-
class
|
19
|
+
class UserAllowsNilEmailToFalse < TestModel
|
20
|
+
validates :email, email_format: { allow_nil: false }
|
21
|
+
end
|
22
22
|
|
23
23
|
def test_valid_emails
|
24
|
-
valid_emails.each { |email| assert
|
24
|
+
valid_emails.each { |email| assert User.new(email: email).valid? }
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_invalid_emails
|
28
|
-
invalid_emails.each { |email| refute
|
28
|
+
invalid_emails.each { |email| refute User.new(email: email).valid? }
|
29
29
|
end
|
30
30
|
|
31
31
|
def test_email_when_domains_option
|
@@ -33,36 +33,36 @@ class TestEmailFormatValidator < MiniTest::Unit::TestCase
|
|
33
33
|
valid_emails_with_incorrect_domains = ['user@gmail.com', 'user@subdomain.gmail.com']
|
34
34
|
|
35
35
|
valid_emails_with_correct_domains.each do |email|
|
36
|
-
assert
|
36
|
+
assert UserWithEmailDomains.new(email: email).valid?
|
37
37
|
end
|
38
38
|
|
39
39
|
valid_emails_with_incorrect_domains.each do |email|
|
40
|
-
refute
|
40
|
+
refute UserWithEmailDomains.new(email: email).valid?
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
def test_default_invalid_domain_message_on_error
|
45
|
-
|
46
|
-
refute
|
47
|
-
assert
|
45
|
+
user = UserWithEmailDomains.new(email: "user@gmail.com")
|
46
|
+
refute user.valid?
|
47
|
+
assert user.errors[:email].include?("can't be from this domain")
|
48
48
|
end
|
49
49
|
|
50
50
|
def test_default_message_on_error
|
51
|
-
|
52
|
-
refute
|
53
|
-
assert
|
51
|
+
user = User.new(email: "invalid_email@")
|
52
|
+
refute user.valid?
|
53
|
+
assert user.errors[:email].include?("is improperly formatted")
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_nil_email_when_allow_nil_option_is_not_set
|
57
|
-
refute
|
57
|
+
refute User.new(email: nil).valid?
|
58
58
|
end
|
59
59
|
|
60
60
|
def test_nil_email_when_allow_nil_option_is_set_to_true
|
61
|
-
assert
|
61
|
+
assert UserAllowsNilEmailToTrue.new(email: nil).valid?
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_nil_email_when_allow_nil_option_is_set_to_false
|
65
|
-
refute
|
65
|
+
refute UserAllowsNilEmailToFalse.new(email: nil).valid?
|
66
66
|
end
|
67
67
|
|
68
68
|
#######################
|
@@ -2,44 +2,44 @@
|
|
2
2
|
|
3
3
|
require_relative 'test_helper'
|
4
4
|
|
5
|
-
class
|
6
|
-
validates :password, password_strength: true
|
7
|
-
end
|
5
|
+
class TestPasswordFormatValidator < MiniTest::Unit::TestCase
|
8
6
|
|
9
|
-
class
|
10
|
-
|
11
|
-
end
|
7
|
+
class User < TestModel
|
8
|
+
validates :password, password_strength: true
|
9
|
+
end
|
12
10
|
|
13
|
-
class
|
14
|
-
|
15
|
-
end
|
11
|
+
class UserAllowsNilPasswordToTrue < TestModel
|
12
|
+
validates :password, password_strength: { allow_nil: true }
|
13
|
+
end
|
16
14
|
|
17
|
-
class
|
15
|
+
class UserAllowsNilPasswordToFalse < TestModel
|
16
|
+
validates :password, password_strength: { allow_nil: false }
|
17
|
+
end
|
18
18
|
|
19
19
|
def test_valid_passwords
|
20
|
-
valid_passwords.each { |password| assert
|
20
|
+
valid_passwords.each { |password| assert User.new(password: password).valid? }
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_invalid_passwords
|
24
|
-
invalid_passwords.each { |password| refute
|
24
|
+
invalid_passwords.each { |password| refute User.new(password: password).valid? }
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_default_message_on_error
|
28
|
-
|
29
|
-
refute
|
30
|
-
assert
|
28
|
+
user = User.new(password: "invalid_password")
|
29
|
+
refute user.valid?
|
30
|
+
assert user.errors[:password].include?("is not strong enough. It should contain at least a digit, lowercase and uppercase letter.")
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_nil_password_when_allow_nil_option_is_not_set
|
34
|
-
refute
|
34
|
+
refute User.new(password: nil).valid?
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_nil_password_when_allow_nil_option_is_set_to_true
|
38
|
-
assert
|
38
|
+
assert UserAllowsNilPasswordToTrue.new(password: nil).valid?
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_nil_password_when_allow_nil_option_is_set_to_false
|
42
|
-
refute
|
42
|
+
refute UserAllowsNilPasswordToFalse.new(password: nil).valid?
|
43
43
|
end
|
44
44
|
|
45
45
|
#######################
|
data/test/reserved_test.rb
CHANGED
@@ -2,33 +2,33 @@
|
|
2
2
|
|
3
3
|
require_relative 'test_helper'
|
4
4
|
|
5
|
-
class TestUser < TestModel
|
6
|
-
validates :name, reserved: true
|
7
|
-
end
|
8
|
-
|
9
5
|
class TestReservedValidator < MiniTest::Unit::TestCase
|
10
6
|
|
7
|
+
class User < TestModel
|
8
|
+
validates :name, reserved: true
|
9
|
+
end
|
10
|
+
|
11
11
|
def test_some_reserved_words
|
12
12
|
names_that_should_be_reserved.each do |name|
|
13
|
-
|
14
|
-
refute
|
15
|
-
assert
|
13
|
+
user = User.new(name: name)
|
14
|
+
refute user.valid?
|
15
|
+
assert user.errors[:name]
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_some_not_reserved_words
|
20
|
-
names_that_should_be_not_reserved.each { |name| assert
|
20
|
+
names_that_should_be_not_reserved.each { |name| assert User.new(name: name).valid? }
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_with_nil_attribute
|
24
|
-
|
25
|
-
assert
|
24
|
+
user = User.new(name: nil)
|
25
|
+
assert user.valid?
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_default_message_on_error
|
29
|
-
|
30
|
-
refute
|
31
|
-
assert
|
29
|
+
user = User.new(name: "abOUt")
|
30
|
+
refute user.valid?
|
31
|
+
assert user.errors[:name].include?("is reserved")
|
32
32
|
end
|
33
33
|
|
34
34
|
#######################
|
data/test/test_helper.rb
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
|
-
require 'rubygems'
|
4
3
|
require 'active_model'
|
5
4
|
require 'minitest/autorun'
|
6
|
-
|
7
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
8
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
9
|
-
|
10
5
|
require 'valid8ors'
|
11
6
|
|
12
7
|
class TestModel
|
data/test/url_format_test.rb
CHANGED
@@ -2,44 +2,44 @@
|
|
2
2
|
|
3
3
|
require_relative 'test_helper'
|
4
4
|
|
5
|
-
class
|
6
|
-
validates :url, url_format: true
|
7
|
-
end
|
5
|
+
class TestUrlFormatValidator < MiniTest::Unit::TestCase
|
8
6
|
|
9
|
-
class
|
10
|
-
|
11
|
-
end
|
7
|
+
class Site < TestModel
|
8
|
+
validates :url, url_format: true
|
9
|
+
end
|
12
10
|
|
13
|
-
class
|
14
|
-
|
15
|
-
end
|
11
|
+
class SiteAllowsNilToTrue < TestModel
|
12
|
+
validates :url, url_format: { allow_nil: true }
|
13
|
+
end
|
16
14
|
|
17
|
-
class
|
15
|
+
class SiteAllowsNilToFalse < TestModel
|
16
|
+
validates :url, url_format: { allow_nil: false }
|
17
|
+
end
|
18
18
|
|
19
19
|
def test_valid_url
|
20
|
-
valid_urls.each { |url| assert
|
20
|
+
valid_urls.each { |url| assert Site.new(url: url).valid? }
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_invalid_url
|
24
|
-
invalid_urls.each { |url| refute
|
24
|
+
invalid_urls.each { |url| refute Site.new(url: url).valid? }
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_default_message_on_error
|
28
|
-
|
29
|
-
refute
|
30
|
-
assert
|
28
|
+
site = Site.new(url: "invalid_url")
|
29
|
+
refute site.valid?
|
30
|
+
assert site.errors[:url].include?("is improperly formatted")
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_nil_url_when_allow_nil_option_is_not_set
|
34
|
-
refute
|
34
|
+
refute Site.new(url: nil).valid?
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_nil_url_when_allow_nil_option_is_set_to_true
|
38
|
-
assert
|
38
|
+
assert SiteAllowsNilToTrue.new(url: nil).valid?
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_nil_url_when_allow_nil_option_is_set_to_false
|
42
|
-
refute
|
42
|
+
refute SiteAllowsNilToFalse.new(url: nil).valid?
|
43
43
|
end
|
44
44
|
|
45
45
|
#######################
|
data/valid8ors.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "valid8ors"
|
6
|
-
s.version = "0.0
|
6
|
+
s.version = "0.1.0"
|
7
7
|
s.authors = ["Axel Vergult", "Vincent Pochet", "Ben Colon"]
|
8
8
|
s.email = ["axel@official.fm", "vincent@official.fm", "ben@official.fm"]
|
9
9
|
s.homepage = ""
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valid8ors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-
|
14
|
+
date: 2012-10-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activemodel
|
18
|
-
requirement:
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,7 +23,12 @@ dependencies:
|
|
23
23
|
version: '0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements:
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ! '>='
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: '0'
|
27
32
|
description: Rails 3 awesome custom validators
|
28
33
|
email:
|
29
34
|
- axel@official.fm
|
@@ -41,11 +46,13 @@ files:
|
|
41
46
|
- config/blacklist.yml
|
42
47
|
- config/reserved.yml
|
43
48
|
- lib/valid8ors.rb
|
49
|
+
- lib/valid8ors/absence.rb
|
44
50
|
- lib/valid8ors/blacklist.rb
|
45
51
|
- lib/valid8ors/email_format.rb
|
46
52
|
- lib/valid8ors/password_strength.rb
|
47
53
|
- lib/valid8ors/reserved.rb
|
48
54
|
- lib/valid8ors/url_format.rb
|
55
|
+
- test/absence_test.rb
|
49
56
|
- test/blacklist_test.rb
|
50
57
|
- test/email_format_test.rb
|
51
58
|
- test/password_strength_test.rb
|
@@ -67,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
74
|
version: '0'
|
68
75
|
segments:
|
69
76
|
- 0
|
70
|
-
hash: -
|
77
|
+
hash: -557487691873541277
|
71
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
79
|
none: false
|
73
80
|
requirements:
|
@@ -76,14 +83,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
83
|
version: '0'
|
77
84
|
segments:
|
78
85
|
- 0
|
79
|
-
hash: -
|
86
|
+
hash: -557487691873541277
|
80
87
|
requirements: []
|
81
88
|
rubyforge_project:
|
82
|
-
rubygems_version: 1.8.
|
89
|
+
rubygems_version: 1.8.24
|
83
90
|
signing_key:
|
84
91
|
specification_version: 3
|
85
92
|
summary: Rails 3 awesome custom validators
|
86
93
|
test_files:
|
94
|
+
- test/absence_test.rb
|
87
95
|
- test/blacklist_test.rb
|
88
96
|
- test/email_format_test.rb
|
89
97
|
- test/password_strength_test.rb
|