phone_number_validator 0.7.4 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +25 -25
- data/Gemfile +6 -6
- data/LICENSE +21 -21
- data/README.rdoc +59 -59
- data/Rakefile +27 -27
- data/bin/pnv +18 -18
- data/doc/PhoneNumberValidator/Validator.html +230 -230
- data/doc/PhoneNumberValidator.html +160 -160
- data/doc/PhoneNumberValidatorTest.html +235 -235
- data/doc/README_rdoc.html +165 -165
- data/doc/created.rid +6 -6
- data/doc/index.html +159 -159
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +104 -104
- data/lib/phone_number_validator/validator.rb +34 -34
- data/lib/phone_number_validator.rb +18 -18
- data/phone_number_validator.gemspec +32 -32
- data/test/test_phone_number_validator.rb +31 -31
- metadata +2 -2
@@ -1,32 +1,32 @@
|
|
1
|
-
Gem::Specification.new do |spec|
|
2
|
-
spec.name = 'phone_number_validator'
|
3
|
-
spec.version = '0.7.
|
4
|
-
spec.date = Time.now.strftime("%Y-%m-%d")
|
5
|
-
spec.summary = 'Validate any US phone number!'
|
6
|
-
spec.description = <<-EOF
|
7
|
-
This gem is a United States phone number validator.
|
8
|
-
This gem uses a complex regular expression that can validate any United States phone number.
|
9
|
-
EOF
|
10
|
-
spec.author = 'bag33188'
|
11
|
-
spec.email = 'bag33188@outlook.com'
|
12
|
-
spec.files = `git ls-files -z`.split("\x0")
|
13
|
-
# spec.files = ['phone_number_validator.gemspec', 'Gemfile', 'Rakefile', 'LICENSE', 'README.rdoc']
|
14
|
-
# spec.files += Dir['lib/**/*'] + Dir['bin/*'] + Dir['doc/**/*']
|
15
|
-
spec.require_paths = ['lib', 'lib/phone_number_validator', 'doc', 'test', 'bin', '.']
|
16
|
-
spec.test_files = ['test/test_phone_number_validator.rb']
|
17
|
-
spec.executables << 'pnv'
|
18
|
-
spec.homepage = 'https://gitlab.com/bag3318/phone_number_validator'
|
19
|
-
spec.license = 'MIT'
|
20
|
-
spec.bindir = 'bin'
|
21
|
-
spec.extra_rdoc_files = ['README.rdoc']
|
22
|
-
spec.platform = Gem::Platform::RUBY
|
23
|
-
spec.required_ruby_version = '>= 2.0.0'
|
24
|
-
spec.required_rubygems_version = '>= 2.6.0'
|
25
|
-
spec.post_install_message = "Thanks for installing my phone_number_validator gem!\r\nI hope you will enjoy using it! :)"
|
26
|
-
spec.requirements << 'A Windows, Mac, or Linux computer with Ruby and RubyGems Installed.'
|
27
|
-
spec.metadata = {
|
28
|
-
'bug_tracker_uri' => 'https://gitlab.com/bag3318/phone_number_validator/issues',
|
29
|
-
'source_code_uri' => 'https://gitlab.com/bag3318/phone_number_validator'
|
30
|
-
}
|
31
|
-
spec.add_runtime_dependency 'bundler', '~> 1.11', '>= 1.11.2'
|
32
|
-
end
|
1
|
+
Gem::Specification.new do |spec|
|
2
|
+
spec.name = 'phone_number_validator'
|
3
|
+
spec.version = '0.7.5'
|
4
|
+
spec.date = Time.now.strftime("%Y-%m-%d")
|
5
|
+
spec.summary = 'Validate any US phone number!'
|
6
|
+
spec.description = <<-EOF
|
7
|
+
This gem is a United States phone number validator.
|
8
|
+
This gem uses a complex regular expression that can validate any United States phone number.
|
9
|
+
EOF
|
10
|
+
spec.author = 'bag33188'
|
11
|
+
spec.email = 'bag33188@outlook.com'
|
12
|
+
spec.files = `git ls-files -z`.split("\x0")
|
13
|
+
# spec.files = ['phone_number_validator.gemspec', 'Gemfile', 'Rakefile', 'LICENSE', 'README.rdoc']
|
14
|
+
# spec.files += Dir['lib/**/*'] + Dir['bin/*'] + Dir['doc/**/*']
|
15
|
+
spec.require_paths = ['lib', 'lib/phone_number_validator', 'doc', 'test', 'bin', '.']
|
16
|
+
spec.test_files = ['test/test_phone_number_validator.rb']
|
17
|
+
spec.executables << 'pnv'
|
18
|
+
spec.homepage = 'https://gitlab.com/bag3318/phone_number_validator'
|
19
|
+
spec.license = 'MIT'
|
20
|
+
spec.bindir = 'bin'
|
21
|
+
spec.extra_rdoc_files = ['README.rdoc']
|
22
|
+
spec.platform = Gem::Platform::RUBY
|
23
|
+
spec.required_ruby_version = '>= 2.0.0'
|
24
|
+
spec.required_rubygems_version = '>= 2.6.0'
|
25
|
+
spec.post_install_message = "Thanks for installing my phone_number_validator gem!\r\nI hope you will enjoy using it! :)"
|
26
|
+
spec.requirements << 'A Windows, Mac, or Linux computer with Ruby and RubyGems Installed.'
|
27
|
+
spec.metadata = {
|
28
|
+
'bug_tracker_uri' => 'https://gitlab.com/bag3318/phone_number_validator/issues',
|
29
|
+
'source_code_uri' => 'https://gitlab.com/bag3318/phone_number_validator'
|
30
|
+
}
|
31
|
+
spec.add_runtime_dependency 'bundler', '~> 1.11', '>= 1.11.2'
|
32
|
+
end
|
@@ -1,31 +1,31 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require 'phone_number_validator'
|
3
|
-
|
4
|
-
##
|
5
|
-
# This class respresents the testing-unit for this gem app
|
6
|
-
#
|
7
|
-
# <b>Inherits from:</b>
|
8
|
-
# Test::Unit::TestCase
|
9
|
-
class PhoneNumberValidatorTest < Test::Unit::TestCase
|
10
|
-
|
11
|
-
##
|
12
|
-
# This test inputs a valid phone number and expects the output to be <b>true</b>
|
13
|
-
def test_valid_phone_number
|
14
|
-
assert_equal true,
|
15
|
-
PhoneNumberValidator.validate('+1 (949) 355-6244 ext. 198842')
|
16
|
-
end
|
17
|
-
|
18
|
-
##
|
19
|
-
# This test inputs an invalid phone number and expects the output to be <b>false</b>
|
20
|
-
def test_invalid_phone_number
|
21
|
-
assert_equal false,
|
22
|
-
PhoneNumberValidator.validate('94643823637337')
|
23
|
-
end
|
24
|
-
|
25
|
-
##
|
26
|
-
# This test inputs no phone number and expectst the output to be <b>:nil</b>
|
27
|
-
def test_no_phone_number
|
28
|
-
assert_equal :nil,
|
29
|
-
PhoneNumberValidator.validate('')
|
30
|
-
end
|
31
|
-
end
|
1
|
+
require 'test/unit'
|
2
|
+
require 'phone_number_validator'
|
3
|
+
|
4
|
+
##
|
5
|
+
# This class respresents the testing-unit for this gem app
|
6
|
+
#
|
7
|
+
# <b>Inherits from:</b>
|
8
|
+
# Test::Unit::TestCase
|
9
|
+
class PhoneNumberValidatorTest < Test::Unit::TestCase
|
10
|
+
|
11
|
+
##
|
12
|
+
# This test inputs a valid phone number and expects the output to be <b>true</b>
|
13
|
+
def test_valid_phone_number
|
14
|
+
assert_equal true,
|
15
|
+
PhoneNumberValidator.validate('+1 (949) 355-6244 ext. 198842')
|
16
|
+
end
|
17
|
+
|
18
|
+
##
|
19
|
+
# This test inputs an invalid phone number and expects the output to be <b>false</b>
|
20
|
+
def test_invalid_phone_number
|
21
|
+
assert_equal false,
|
22
|
+
PhoneNumberValidator.validate('94643823637337')
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# This test inputs no phone number and expectst the output to be <b>:nil</b>
|
27
|
+
def test_no_phone_number
|
28
|
+
assert_equal :nil,
|
29
|
+
PhoneNumberValidator.validate('')
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phone_number_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bag33188
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
requirements:
|
129
129
|
- A Windows, Mac, or Linux computer with Ruby and RubyGems Installed.
|
130
130
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.7.
|
131
|
+
rubygems_version: 2.7.8
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: Validate any US phone number!
|