ama_validators 0.0.8 → 0.0.9

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: 2355ce08a811c4003fd16f8ba5b9a4bddaf711e5
4
- data.tar.gz: 37d390251756bf02e4c1ce30e1aa4b0e03639903
3
+ metadata.gz: ad8fb513f430d6a1c10ee41a1ee3ab24a180f780
4
+ data.tar.gz: fb31d9650b2a2d427d788fe7b3425237ab445ed4
5
5
  SHA512:
6
- metadata.gz: 5644363e483e03a398e955a84f926a5ee06a2f65751c61ca82ab64deb4b0c96d43b963279bab1c6227bff6c42181d64e985e5ac3b9d9c102fc20480bded78f74
7
- data.tar.gz: b291cdb75f8b098fecb2999d1af7fc15d16b736b1e7d7b1296e64ef597b63567b89baca68a5949b136df9d6f62647ee66dd145da3717c437257ad33f0893f367
6
+ metadata.gz: 7f246809b7c7809a372525a2e9ff08881123ca4f038df2c4bf37b1eca6719552943b6436b99e8726a30e4418e8d53654a229d745c3594298d25dfc50fb415f25
7
+ data.tar.gz: 8779da836d0a48051284ec22f8f6d981d75ba7a0a5cb10c36d3730971779a2ffbcca46de4e16eed2a87268ce8d337e1a4b43d0c8ddb88073ce68c75b3235e9b5
@@ -1,6 +1,6 @@
1
1
  class PostalCodeFormatValidator < ActiveModel::EachValidator
2
2
  def validate_each(object, attribute, value)
3
- unless value =~ /\A(\d{5}((-|\s)\d{4})?)|([txTX]\d[abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ])\ {0,1}(\d[abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ]\d)\z/
3
+ unless value =~ /\A(\d{5}((-|\s)\d{4})?|[txTX]\d[abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ]\s{0,1}\d[abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ]\d)\z/
4
4
  object.errors[attribute] << (options[:message] || "enter a valid AB or NT postal code (e.g. T4C 1A5)")
5
5
  end
6
6
  end
@@ -1,3 +1,3 @@
1
1
  module AmaValidators
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -7,8 +7,8 @@ describe PostalCodeFormatValidator do
7
7
  let( :attribute ) { :postal_code }
8
8
  let (:object) { Profile.new }
9
9
 
10
- invalid_postal_codes = %w[2w2e3e b4hk6j t556v7 x2ceee t3x6sv T5j5M/]
11
- valid_postal_codes = %w[T5w4g5 T5W4G5 X4H3J9 t6J4M5 x3B5X8]
10
+ invalid_postal_codes = %w[2w2e3e b4hk6j t556v7 x2ceee t3x6sv T5j5M/ 123456]
11
+ valid_postal_codes = %w[T5w4g5 T5W4G5 X4H3J9 t6J4M5 x3B5X8 12345 12345-6789]
12
12
 
13
13
  context 'Wrong postal code format' do
14
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ama_validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van den Beuken
@@ -13,104 +13,104 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2015-10-26 00:00:00.000000000 Z
16
+ date: 2015-11-26 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler
20
20
  requirement: !ruby/object:Gem::Requirement
21
21
  requirements:
22
- - - ~>
22
+ - - "~>"
23
23
  - !ruby/object:Gem::Version
24
24
  version: '1.3'
25
25
  type: :development
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
28
28
  requirements:
29
- - - ~>
29
+ - - "~>"
30
30
  - !ruby/object:Gem::Version
31
31
  version: '1.3'
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: rake
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - '>='
36
+ - - ">="
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  type: :development
40
40
  prerelease: false
41
41
  version_requirements: !ruby/object:Gem::Requirement
42
42
  requirements:
43
- - - '>='
43
+ - - ">="
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: rspec
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - '>='
50
+ - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  type: :development
54
54
  prerelease: false
55
55
  version_requirements: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - '>='
57
+ - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: rspec-instafail
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - '>='
64
+ - - ">="
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
69
  version_requirements: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - '>='
71
+ - - ">="
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: simplecov
76
76
  requirement: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  type: :development
82
82
  prerelease: false
83
83
  version_requirements: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - '>='
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  - !ruby/object:Gem::Dependency
89
89
  name: coveralls
90
90
  requirement: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - '>='
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  type: :development
96
96
  prerelease: false
97
97
  version_requirements: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - '>='
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rails
104
104
  requirement: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: 3.0.0
109
109
  type: :runtime
110
110
  prerelease: false
111
111
  version_requirements: !ruby/object:Gem::Requirement
112
112
  requirements:
113
- - - '>='
113
+ - - ">="
114
114
  - !ruby/object:Gem::Version
115
115
  version: 3.0.0
116
116
  description: 'Compile the following validators: - Credit card - Email - Membership
@@ -126,10 +126,10 @@ executables: []
126
126
  extensions: []
127
127
  extra_rdoc_files: []
128
128
  files:
129
- - .gitignore
130
- - .rspec
131
- - .simplecov
132
- - .travis.yml
129
+ - ".gitignore"
130
+ - ".rspec"
131
+ - ".simplecov"
132
+ - ".travis.yml"
133
133
  - Gemfile
134
134
  - LICENSE.txt
135
135
  - README.md
@@ -163,17 +163,17 @@ require_paths:
163
163
  - lib
164
164
  required_ruby_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - '>='
166
+ - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 2.0.14
176
+ rubygems_version: 2.2.0
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: This gem will compile the following validators - Credit card - Email - Membership