drexed-validators 0.0.9 → 0.0.10

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: eb401faff617c79f4552eef2e631ba6d30b69424
4
- data.tar.gz: b5a05bf290f7ce19c1ef831ebf8b45563c237ce2
3
+ metadata.gz: ffcffb7782e218868d56bac3ea6b2358f812f2fd
4
+ data.tar.gz: c5a3130f27e7d583acab6cbb9a959b8303113bce
5
5
  SHA512:
6
- metadata.gz: c1fe839071d1bae8808f21aa08eb1480feeb04ee1c30d2464d506266efdd4d99a7c66e8d13d57021f40c7417ba435b197aef508683476e726417bb9cd4107a3a
7
- data.tar.gz: 21ccaa00fa3527c2f80e8f4736998c835f2cbac14a65a7d0655f6781a60b91b40c5f11b27acd5c810562ac1d65eb4050f051950f8550c0f84c5f06aea04508d1
6
+ metadata.gz: 6b88dfc6efc34005d7a0b92d9ee09707927efd5ec712d4be05ae7aaccec696c16564b91fd920196c2702dbc91236fa63dac7323d99e3939e60434b64681207e7
7
+ data.tar.gz: 84fdc4f37188b858ec7fd94178730889d4316fae128b39c7f9cde2080370b2c1acae796c9fa14af7be1bf3fca8ba56295c08152bb6b8a4f049c8bf00933b98a4
@@ -1,4 +1,4 @@
1
- class PhoneFormatValidator < ActiveModel::EachValidator
1
+ class TelephoneValidator < ActiveModel::EachValidator
2
2
  def validate_each(record, attribute, value)
3
3
  formatted_value = value.gsub(/[\s\.\+\(\)-]*/, "")
4
4
  is_number = !(formatted_value =~ /^[-+]?[0-9]+$/).nil?
@@ -16,7 +16,7 @@ class PhoneFormatValidator < ActiveModel::EachValidator
16
16
  def valid_seven_digit?(input)
17
17
  input.length == 7 && input[0] != "0" && input[0] != "1"
18
18
  end
19
-
19
+
20
20
  def valid_ten_digit?(input)
21
21
  input.length == 10 && input[0] != "0" && input[0] != "1" && valid_seven_digit?(input.slice(-7, 7))
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module Drexed
2
2
  module Validators
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drexed-validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-09 00:00:00.000000000 Z
11
+ date: 2014-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
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
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '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
40
  version: '0'
41
41
  description: Validate commonly used attributes easily with drexed-validators
@@ -45,7 +45,7 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
48
+ - ".gitignore"
49
49
  - Gemfile
50
50
  - LICENSE.txt
51
51
  - README.md
@@ -58,9 +58,9 @@ files:
58
58
  - app/validators/ip_validator.rb
59
59
  - app/validators/name_validator.rb
60
60
  - app/validators/password_validator.rb
61
- - app/validators/phone_validator.rb
62
61
  - app/validators/slug_validator.rb
63
62
  - app/validators/ssn_validator.rb
63
+ - app/validators/telephone_validator.rb
64
64
  - app/validators/url_validator.rb
65
65
  - app/validators/username_validator.rb
66
66
  - app/validators/zipcode_validator.rb
@@ -77,17 +77,17 @@ require_paths:
77
77
  - lib
78
78
  required_ruby_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - '>='
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.1.11
90
+ rubygems_version: 2.2.1
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Gem for model validators