has_validated_attributes 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5874637351f773d8336aec76211cb7cc9d697137
|
4
|
+
data.tar.gz: 2570e847f9df8eb943203022a7c5f3d689d56f50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f77d5df75cb8276fa981dad4e8efd2e58b6f25de7f9854679cb8e70ed3cdce45ab4e2d57275a15af08a6e022070907fa0574f648628d90c7a880f9252b990564
|
7
|
+
data.tar.gz: d4f1e43b3b54469c8549ddeb1fe4420c39e296b92de3030bc39283f68f163e39b4b7c066b5056b3d3638319b98eed904bace4ac586bf68656e326b7542bfd09a
|
@@ -25,8 +25,8 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.summary = %q{Ruby on Rails gem for validate data prior to save}
|
26
26
|
# s.rubyforge_project = "has_validated_attributes"
|
27
27
|
|
28
|
-
s.add_development_dependency "rspec"
|
29
|
-
s.add_development_dependency "shoulda-matchers"
|
28
|
+
s.add_development_dependency "rspec", "3.0.0"
|
29
|
+
s.add_development_dependency "shoulda-matchers", "= 2.8.0"
|
30
30
|
s.add_development_dependency "has_normalized_attributes", "~> 0.0", ">= 0.0.8"
|
31
31
|
s.add_development_dependency "activerecord", ">= 3.1.0"
|
32
32
|
s.add_development_dependency "sqlite3", ">= 1.3.10"
|
@@ -36,7 +36,7 @@ module HasValidatedAttributes
|
|
36
36
|
:rails_name => {:format => {:with => /\A[a-zA-Z\_]*?\z/u, :message => "should only include underscores and letters."}},
|
37
37
|
## the regex for emails comes from
|
38
38
|
## http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx/
|
39
|
-
:email => {:length => {:maximum => 63}, :format => {:with => /\A(?!\.)("([^"\r\\]|\\["\r\\])*"|([-a-z0-9!#$%&'’*+\/=?^_`{|}~]|(?<!\.)\.)*)(?<!\.)@[a-z0-9][\w\.-]*[a-z0-9]
|
39
|
+
:email => {:length => {:maximum => 63}, :format => {:with => /\A(?!\.)("([^"\r\\]|\\["\r\\])*"|([-a-z0-9!#$%&'’*+\/=?^_`{|}~]|(?<!\.)\.)*)(?<!\.)@[a-z0-9][\w\.-]*[a-z0-9]*\.[a-z][a-z\.]*[a-z]\z/i, :message => "should look like an email address."}, :has_if? => true},
|
40
40
|
:phone_number => {:numericality => {:greater_than_or_equal_to => 1000000000, :less_than => 10000000000, :message => 'accepts only 10 numbers and (),.- characters and must not be all 0s'}, :has_if? => true},
|
41
41
|
:phone_extension => {:length => {:maximum => 7}, :format => {:with => /\A\d+([\dxX]*\d)?\z/, :message => 'accepts only numbers (0-9) and "x"'}, :has_if? => true},
|
42
42
|
:domain => {:length => {:maximum => 63}, :format => {:with => /\A(?:[A-Z0-9\-]+\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|pro|mobi|name|aero|jobs|museum)\z/i, :message => "should look like a domain name."}, :has_if? => true},
|
@@ -170,7 +170,7 @@ RSpec.shared_examples_for "percent attribute" do |attr|
|
|
170
170
|
it { should allow_value(value).for(attr) }
|
171
171
|
end
|
172
172
|
|
173
|
-
["100.001", "0.22222", "-100.001", "
|
173
|
+
["100.001", "0.22222", "-100.001", "abc", "&"].each do |value|
|
174
174
|
it { should_not allow_value(value).for(attr) }
|
175
175
|
end
|
176
176
|
end
|
@@ -1,3 +1,3 @@
|
|
1
1
|
module HasValidatedAttributes
|
2
|
-
VERSION = "0.0.
|
3
|
-
end
|
2
|
+
VERSION = "0.0.14"
|
3
|
+
end
|
@@ -102,6 +102,7 @@ describe "HasValidatedAttributes" do
|
|
102
102
|
it { subject.email_attr = """Ima.Fool""@example.com"; expect(subject).to be_valid }
|
103
103
|
# it { subject.email_attr = """Ima Fool""@example.com"; expect(subject).to be_valid }
|
104
104
|
it { subject.email_attr = "Ima Fool@example.com"; expect(subject).to be_invalid }
|
105
|
+
it { subject.email_attr = "test@q.com"; expect(subject).to be_valid }
|
105
106
|
end
|
106
107
|
end
|
107
108
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_validated_attributes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Ginavan
|
@@ -14,104 +14,104 @@ dependencies:
|
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - '
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.0.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - '
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: shoulda-matchers
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '
|
31
|
+
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.8.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '
|
38
|
+
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.8.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: has_normalized_attributes
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.0'
|
48
|
-
- -
|
48
|
+
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: 0.0.8
|
51
51
|
type: :development
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
|
-
- - ~>
|
55
|
+
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0.0'
|
58
|
-
- -
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: 0.0.8
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: activerecord
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: 3.1.0
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: 3.1.0
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: sqlite3
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: 1.3.10
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: 1.3.10
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: database_cleaner
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- -
|
93
|
+
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: byebug
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- -
|
114
|
+
- - ">="
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
description: has_validated_attributes is a Ruby on Rails gem that lets you validate
|
@@ -122,9 +122,9 @@ extensions: []
|
|
122
122
|
extra_rdoc_files:
|
123
123
|
- README.rdoc
|
124
124
|
files:
|
125
|
-
- .gitignore
|
126
|
-
- .rspec
|
127
|
-
- .travis.yml
|
125
|
+
- ".gitignore"
|
126
|
+
- ".rspec"
|
127
|
+
- ".travis.yml"
|
128
128
|
- Gemfile
|
129
129
|
- README.rdoc
|
130
130
|
- Rakefile
|
@@ -147,17 +147,17 @@ require_paths:
|
|
147
147
|
- lib
|
148
148
|
required_ruby_version: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
|
-
- -
|
155
|
+
- - ">="
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.
|
160
|
+
rubygems_version: 2.6.4
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Ruby on Rails gem for validate data prior to save
|