phone_number_validator 0.4.8 → 0.5.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
2
  SHA256:
3
- metadata.gz: bdcef295600688885917df15be0ff92650dd026289b0946e505ecf11fc426844
4
- data.tar.gz: 267e68ac819c391e9dcdb88f72ea7288e1ad906aef9215842c1193d738acde8b
3
+ metadata.gz: cc9de6a335c51cfa3cf606ded2d0265396a88c1836575528dd9d41b6ce541180
4
+ data.tar.gz: 05cbfcf561cb1889296af7e4122e807c50fa5de408470cd924dbada79f2592d6
5
5
  SHA512:
6
- metadata.gz: 24f9f70610b703c160eb8ceac4ad9573f46ed79d7ce67325f40be43a1ace42fb77c2510639072be65a38c065418811714206b317dba2c3df0ddd73ea3fe29751
7
- data.tar.gz: 4f7db7d1ecb12ee78168f993c7264554eeecaae8cffbd314174977b1c49b8cb3c8b8f79cac76ef06d5b296a686dc281ad3043646a80a3a6c130fa040cb06cad4
6
+ metadata.gz: ca5de118548f3e0037e2dcc676339aaa79e9b310fff2c87bf1b6d78143a899dc08b69d4e634b8526896fcff43135162c88df04fac3f04374f0a5495eb0e0d47f
7
+ data.tar.gz: 87c60e103c0b64fdb0b9506f444879d33c4b8eee704989f90e406a6c935ca567162e7882a7363167410cdf8a2bab334402b24fc62e34646fc59fc9225ccc9077
data/.gitignore CHANGED
@@ -1,25 +1,25 @@
1
- # System File(s)/Folder(s)
2
- .DS_Store
3
- Thumbs.db
4
- _MACOSX
5
-
6
- # Editor File(s)/Folder(s)
7
- *.code-workspace
8
- *.sublime-project
9
- *.sublime-workspace
10
- .vscode
11
-
12
- # Generated Files
13
- *.gem
14
- *.lock
15
-
16
- # Executables
17
- *.bat
18
- *.sh
19
-
20
- # if gitignore is not working, try this:
21
- #
22
- # git rm -r --cached .
23
- # git add .
24
- # git commit -m "fixed untracked files"
25
- # git push
1
+ # System File(s)/Folder(s)
2
+ .DS_Store
3
+ Thumbs.db
4
+ _MACOSX
5
+
6
+ # Editor File(s)/Folder(s)
7
+ *.code-workspace
8
+ *.sublime-project
9
+ *.sublime-workspace
10
+ .vscode
11
+
12
+ # Generated Files
13
+ *.gem
14
+ *.lock
15
+
16
+ # Executables
17
+ *.bat
18
+ *.sh
19
+
20
+ # if gitignore is not working, try this:
21
+ #
22
+ # git rm -r --cached .
23
+ # git add .
24
+ # git commit -m "fixed untracked files"
25
+ # git push
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- source 'https://rubygems.org'
2
- platform :ruby do
3
- gemspec
4
- gem 'rdoc', '~> 6.0', '>= 6.0.4'
5
- gem 'rake', '~> 11.2', '>= 11.2.2'
6
- end
1
+ source 'https://rubygems.org'
2
+ platform :ruby do
3
+ gemspec
4
+ gem 'rdoc', '~> 6.0', '>= 6.0.4'
5
+ gem 'rake', '~> 11.2', '>= 11.2.2'
6
+ end
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 bag33188
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2018 bag33188
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.rdoc CHANGED
@@ -1,56 +1,56 @@
1
- = Phone Number Validator
2
-
3
- == About
4
-
5
- This app is a US phone number-validating RubyGem.
6
-
7
- It uses a complex regular expression to validate any United States phone number.
8
-
9
- === Regular Expression
10
-
11
- This gem uses the following regular expression:
12
-
13
- # US Phone Numbers
14
- /^(?:(?:[2-9]11)|(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:\x20+|#|x\.?|ext\.?|extension)\s*(\d+))?)$/i
15
- # Regex Flags: i (ignore case)
16
-
17
- == Installing
18
-
19
- $ gem install phone_number_validator
20
-
21
- === Install Required Gems/Dependencies
22
-
23
- $ bundle install
24
-
25
- === Updateing Required Gems/Dependencies
26
-
27
- $ bundle update
28
-
29
- == Uninstalling
30
-
31
- $ gem uninstall phone_number_validator
32
-
33
- == Testing
34
-
35
- $ rake test
36
-
37
- == Usage
38
-
39
- === In command line
40
-
41
- $ pnv "+1 (949) 355-6244 ext. 198842"
42
- => "+1 (949) 355-6244 ext. 198842" is a valid phone number.
43
- => true
44
-
45
- === In Ruby code
46
-
47
- require 'phone_number_validator'
48
-
49
- check_phone_number = PhoneNumberValidator.validate_phone_number('+1 (949) 355-6244 ext. 198842')
50
-
51
- print check_phone_number
52
-
53
- ==== Output
54
-
55
- => "+1 (949) 355-6244 ext. 198842" is a valid phone number.
56
- => true
1
+ = Phone Number Validator
2
+
3
+ == About
4
+
5
+ This app is a US phone number-validating RubyGem.
6
+
7
+ It uses a complex regular expression to validate any United States phone number.
8
+
9
+ === Regular Expression
10
+
11
+ This gem uses the following regular expression:
12
+
13
+ # US Phone Numbers
14
+ /^(?:(?:[2-9]11)|(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:\x20+|#|x\.?|ext\.?|extension)\s*(\d+))?)$/i
15
+ # Regex Flags: i (ignore case)
16
+
17
+ == Installing
18
+
19
+ $ gem install phone_number_validator
20
+
21
+ === Install Required Gems/Dependencies
22
+
23
+ $ bundle install
24
+
25
+ === Updateing Required Gems/Dependencies
26
+
27
+ $ bundle update
28
+
29
+ == Uninstalling
30
+
31
+ $ gem uninstall phone_number_validator
32
+
33
+ == Testing
34
+
35
+ $ rake test
36
+
37
+ == Usage
38
+
39
+ === In command line
40
+
41
+ $ pnv "+1 (949) 355-6244 ext. 198842"
42
+ => "+1 (949) 355-6244 ext. 198842" is a valid phone number.
43
+ => true
44
+
45
+ === In Ruby code
46
+
47
+ require 'phone_number_validator'
48
+
49
+ check_phone_number = PhoneNumberValidator.validate_phone_number('+1 (949) 355-6244 ext. 198842')
50
+
51
+ print check_phone_number
52
+
53
+ ==== Output
54
+
55
+ => "+1 (949) 355-6244 ext. 198842" is a valid phone number.
56
+ => true
data/Rakefile CHANGED
@@ -1,27 +1,27 @@
1
- require 'rake/testtask'
2
-
3
- Rake::TestTask.new do |test|
4
- test.libs << 'test'
5
- end
6
-
7
- desc 'Run tests'
8
- task :default => :test
9
-
10
- require 'rdoc/task'
11
-
12
- RDoc::Task.new do |rdoc|
13
- rdoc.main = 'README.rdoc'
14
- rdoc.title = 'Phone Number Validator'
15
- rdoc.rdoc_dir = 'doc'
16
- rdoc.rdoc_files.include('README.rdoc', 'lib/*.rb', 'lib/**/*.rb', 'test/*.rb', 'bin/*')
17
- end
18
-
19
- # for Windows
20
- task :deldocw do
21
- `RMDIR /S /Q "doc"`
22
- end
23
-
24
- # for Unix
25
- task :deldocx do
26
- `rm -rf doc`
27
- end
1
+ require 'rake/testtask'
2
+
3
+ Rake::TestTask.new do |test|
4
+ test.libs << 'test'
5
+ end
6
+
7
+ desc 'Run tests'
8
+ task :default => :test
9
+
10
+ require 'rdoc/task'
11
+
12
+ RDoc::Task.new do |rdoc|
13
+ rdoc.main = 'README.rdoc'
14
+ rdoc.title = 'Phone Number Validator'
15
+ rdoc.rdoc_dir = 'doc'
16
+ rdoc.rdoc_files.include('README.rdoc', 'lib/*.rb', 'lib/**/*.rb', 'test/*.rb', 'bin/*')
17
+ end
18
+
19
+ # for Windows
20
+ task :deldocw do
21
+ `RMDIR /S /Q "doc"`
22
+ end
23
+
24
+ # for Unix
25
+ task :deldocx do
26
+ `rm -rf doc`
27
+ end
data/bin/pnv CHANGED
@@ -1,23 +1,18 @@
1
- #!/usr/bin/env ruby
2
-
3
- =begin
4
- |======================|
5
- | PhoneNumberValidator |
6
- |----------------------|
7
- | Made by: bag33188 |
8
- |======================|
9
- =end
10
-
11
- require 'phone_number_validator'
12
-
13
- print "\r\n"
14
-
15
- if ARGV[0] == nil || ARGV[0] == "" || ARGV[0] == ''
16
- puts "No phone number entered."
17
- puts :nil
18
- else
19
- # execute validator
20
- puts PhoneNumberValidator.validate_phone_number(ARGV[0])
21
- end
22
-
23
- print "\r\n"
1
+ #!/usr/bin/env ruby
2
+
3
+ =begin
4
+ |======================|
5
+ | PhoneNumberValidator |
6
+ |----------------------|
7
+ | Made by: bag33188 |
8
+ |======================|
9
+ =end
10
+
11
+ require 'phone_number_validator'
12
+
13
+ print "\r\n"
14
+
15
+ # execute validator
16
+ puts PhoneNumberValidator.validate_phone_number(ARGV[0])
17
+
18
+ print "\r\n"