validates_phone_format_of 2.0.0 → 3.0.0

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
- SHA1:
3
- metadata.gz: df2f7be38c26923b2e3218c89ec1612a245e3d9e
4
- data.tar.gz: e83d8f93830e08762ab19011037a4c51acefa067
2
+ SHA256:
3
+ metadata.gz: d95a25f704075668e80dad65c4903488996b764b1a85e60e8d9a637e7f98bc78
4
+ data.tar.gz: 6c88e26d10508dfb05de2610d4acf89095f72e47299e02f3f89b1118e98fc98f
5
5
  SHA512:
6
- metadata.gz: 21df763c5a8a2ef7fea78f8c26ae9098b148786b0a1e2267b33e3f7881c6691f35daadd15c0d54edd53cad300a40e7edf28c0295aec697397264361492a47043
7
- data.tar.gz: ee2df071f8b947402d1d5f177eaa42200b961ff6449a1c26a83187780ddfd1f6fc684be18cfb66bb19a897eb4c1c46bc1ef1bac964284a887dd476c589acbf70
6
+ metadata.gz: eba1ad5e95181fbe86f91777d2a0af98d68417ec518bd59051e8763f81c9f1fb9647325893c2e56064d9f94bd5fc9276385b1962097e0b17ca3f65489f2cb011
7
+ data.tar.gz: b0622962cd4bf44e9eff7b20c1ae58cfeda0c659f2373cb343e7e9a446de8a512fa29451f61cc240c0ad466090aa9916b9570e79dc38c72382154e9dacf6fefe
data/.gitignore CHANGED
@@ -2,3 +2,5 @@
2
2
  /.bundle/
3
3
  /pkg/
4
4
  Gemfile.lock
5
+ .ruby-version
6
+ .ruby-gemset
data/.travis.yml CHANGED
@@ -6,6 +6,10 @@ rvm:
6
6
  - 2.4.0
7
7
  - 2.5.0
8
8
  - 2.6.0
9
+ - 2.7.0
10
+ - 3.0.0
11
+ - 3.1.0
12
+ - 3.2.0
9
13
  - jruby
10
14
  gemfile:
11
15
  - gemfiles/Gemfile.active_model_3_1
@@ -16,5 +20,9 @@ gemfile:
16
20
  - gemfiles/Gemfile.active_model_5_0
17
21
  - gemfiles/Gemfile.active_model_5_1
18
22
  - gemfiles/Gemfile.active_model_5_2
23
+ - gemfiles/Gemfile.active_model_6_0
24
+ - gemfiles/Gemfile.active_model_6_1
25
+ - gemfiles/Gemfile.active_model_6_2
26
+ - gemfiles/Gemfile.active_model_7_0
19
27
  install: bundle install
20
28
  script: bundle exec rspec
data/README.md CHANGED
@@ -11,7 +11,7 @@ validates_phone_format_of is distributed as a gem, which is how it should be use
11
11
 
12
12
  Include the gem in your Gemfile:
13
13
 
14
- gem 'validates_phone_format_of', '~> 2.0'
14
+ gem 'validates_phone_format_of', '~> 3.0'
15
15
 
16
16
  ## Usage
17
17
 
@@ -27,7 +27,7 @@ class User < ActiveRecord::Base
27
27
  # Same thing as
28
28
  validates_format_of :phone, with: ValidatesPhoneFormatOf::Regexp
29
29
  # Or
30
- validates_format_of :phone, with: /\A\+?[1-9]\d{1,14}\z/
30
+ validates_format_of :phone, with: /\A\+\d{1,15}\z/
31
31
 
32
32
  end
33
33
  ```
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec :path => "../"
4
+
5
+ gem 'activemodel', '= 6.0.0'
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec :path => "../"
4
+
5
+ gem 'activemodel', '= 6.1.0'
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec :path => "../"
4
+
5
+ gem 'activemodel', '= 6.2.0'
@@ -0,0 +1,5 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec :path => "../"
4
+
5
+ gem 'activemodel', '= 7.0.0'
@@ -1,14 +1,14 @@
1
1
  require 'active_model'
2
2
 
3
3
  module ValidatesPhoneFormatOf
4
- Regexp = /\A\+?[1-9]\d{1,14}\z/
4
+ Regexp = /\A\+\d{1,15}\z/
5
5
  end
6
6
 
7
7
  module ActiveModel
8
8
  module Validations
9
9
  class PhoneFormatValidator < EachValidator
10
10
  def validate_each(record, attribute, value)
11
- record.errors.add(attribute, :invalid_phone, options.merge({:value => value})) if value.to_s !~ ValidatesPhoneFormatOf::Regexp
11
+ record.errors.add(attribute, :invalid_phone, **options.merge({:value => value})) if value.to_s !~ ValidatesPhoneFormatOf::Regexp
12
12
  end
13
13
  end
14
14
 
@@ -28,7 +28,7 @@ describe ValidatesPhoneFormatOf do
28
28
  end
29
29
  end
30
30
 
31
- ['test', '0000', '(312) 555-1212'].each do |phone|
31
+ ['test', '0000', '(312) 555-1212', '3125551212'].each do |phone|
32
32
  it "#{phone} is not valid" do
33
33
  user = @user_class.new(phone)
34
34
  expect(user.valid?).to_not be_truthy
@@ -2,7 +2,7 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'validates_phone_format_of'
5
- spec.version = '2.0.0'
5
+ spec.version = '3.0.0'
6
6
  spec.authors = ['Jonathan VUKOVICH-TRIBOUHARET']
7
7
  spec.email = ['jonathan.tribouharet@gmail.com']
8
8
 
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_development_dependency 'bundler'
23
23
  spec.add_development_dependency 'rake'
24
+ spec.add_development_dependency 'rspec', '~> 3.6'
24
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_phone_format_of
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan VUKOVICH-TRIBOUHARET
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-26 00:00:00.000000000 Z
11
+ date: 2023-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.6'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.6'
41
55
  description: Validate phone numbers against E.164 format with this Ruby on Rails gem
42
56
  email:
43
57
  - jonathan.tribouharet@gmail.com
@@ -61,6 +75,10 @@ files:
61
75
  - gemfiles/Gemfile.active_model_5_0
62
76
  - gemfiles/Gemfile.active_model_5_1
63
77
  - gemfiles/Gemfile.active_model_5_2
78
+ - gemfiles/Gemfile.active_model_6_0
79
+ - gemfiles/Gemfile.active_model_6_1
80
+ - gemfiles/Gemfile.active_model_6_2
81
+ - gemfiles/Gemfile.active_model_7_0
64
82
  - lib/validates_phone_format_of.rb
65
83
  - spec/validates_phone_format_of_spec.rb
66
84
  - validates_phone_format_of.gemspec
@@ -68,7 +86,7 @@ homepage: https://github.com/jonathantribouharet/validates_phone_format_of
68
86
  licenses:
69
87
  - MIT
70
88
  metadata: {}
71
- post_install_message:
89
+ post_install_message:
72
90
  rdoc_options: []
73
91
  require_paths:
74
92
  - lib
@@ -83,9 +101,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
101
  - !ruby/object:Gem::Version
84
102
  version: '0'
85
103
  requirements: []
86
- rubyforge_project:
87
- rubygems_version: 2.4.5
88
- signing_key:
104
+ rubygems_version: 3.4.6
105
+ signing_key:
89
106
  specification_version: 4
90
107
  summary: Validate phone numbers against E.164 format with this Ruby on Rails gem
91
108
  test_files: []