phone_number_validator 1.0.2 → 1.0.3
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/bin/pnv +39 -0
- data/doc/PhoneNumberValidator.html +1 -1
- data/doc/PhoneNumberValidator/Validator.html +1 -1
- data/doc/created.rid +1 -2
- data/doc/index.html +0 -2
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/table_of_contents.html +0 -10
- data/phone_number_validator.gemspec +1 -1
- metadata +1 -3
- data/doc/Object.html +0 -200
- data/lib/pnv/pnv.rb +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ffc90de04cc6a5ca37ae0db6677b2b0a6ab2fd59084a5ee17bbb3e207c96c82
|
4
|
+
data.tar.gz: bf26a75515e1ad7e1468a51141652e8cf9f6c51d71b9f3af3259e89186c9ca90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd0c9af02848ad2ae22fcbe2169cdf921c72f7d77d9f83b104823265086f546708f9413acd29c2284cd5548a6b0eecaebe8e1e7dba15c0c0222b7fb50a5ee8a1
|
7
|
+
data.tar.gz: 461d1b659898912248a2d710fd5785048b624a4852e7cb3294d7e6ff803c7a8224ef03157113658e31eafe4cff9174e6f1bf0fd27c5035422a3c2891eca6dcd9
|
data/bin/pnv
CHANGED
@@ -10,6 +10,45 @@
|
|
10
10
|
|
11
11
|
require 'phone_number_validator'
|
12
12
|
|
13
|
+
##
|
14
|
+
# <b>For command line usage:</b>
|
15
|
+
#
|
16
|
+
# Checks to see if the phone number the user entered is valid
|
17
|
+
# by testing regex the pattern with the phone number
|
18
|
+
#
|
19
|
+
# <b>Return Type:</b> boolean or string
|
20
|
+
#
|
21
|
+
# === Examples
|
22
|
+
#
|
23
|
+
# ==== Ex. 1
|
24
|
+
#
|
25
|
+
# $ pnv "+1 (987) 654-3210 ext. 198842"
|
26
|
+
#
|
27
|
+
# ===== Output
|
28
|
+
#
|
29
|
+
# => true
|
30
|
+
#
|
31
|
+
# ==== Ex. 2
|
32
|
+
#
|
33
|
+
# pnv "+1 (987 778873-321a0 ext.ff99"
|
34
|
+
#
|
35
|
+
# ===== Output
|
36
|
+
#
|
37
|
+
# => false
|
38
|
+
#
|
39
|
+
# ==== Ex. 3
|
40
|
+
#
|
41
|
+
# pnv ""
|
42
|
+
#
|
43
|
+
# ===== Output
|
44
|
+
# => "No phone number entered."
|
45
|
+
#
|
46
|
+
# ==== Ex. 4
|
47
|
+
#
|
48
|
+
# pnv
|
49
|
+
#
|
50
|
+
# ===== Output
|
51
|
+
# => "No phone number entered."
|
13
52
|
def pnv
|
14
53
|
if (ARGV[0] == nil || ARGV[0] == '')
|
15
54
|
print "No phone number entered.\r\n"
|
data/doc/created.rid
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
Thu, 08 Aug 2019
|
1
|
+
Thu, 08 Aug 2019 18:59:31 -0700
|
2
2
|
README.rdoc Thu, 08 Aug 2019 14:17:33 -0700
|
3
3
|
lib/phone_number_validator.rb Thu, 08 Aug 2019 14:17:33 -0700
|
4
4
|
lib/phone_number_validator/validator.rb Thu, 08 Aug 2019 15:00:41 -0700
|
5
|
-
lib/pnv/pnv.rb Thu, 08 Aug 2019 15:43:40 -0700
|
6
5
|
test/test_phone_number_validator.rb Thu, 08 Aug 2019 14:17:33 -0700
|
data/doc/index.html
CHANGED
data/doc/js/search_index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var search_data = {"index":{"searchIndex":["
|
1
|
+
var search_data = {"index":{"searchIndex":["phonenumbervalidator","validator","phonenumbervalidatortest","new()","test_invalid_phone_number()","test_no_phone_number()","test_valid_phone_number()","validate()","validate()","readme"],"longSearchIndex":["phonenumbervalidator","phonenumbervalidator::validator","phonenumbervalidatortest","phonenumbervalidator::validator::new()","phonenumbervalidatortest#test_invalid_phone_number()","phonenumbervalidatortest#test_no_phone_number()","phonenumbervalidatortest#test_valid_phone_number()","phonenumbervalidator::validate()","phonenumbervalidator::validator#validate()",""],"info":[["PhoneNumberValidator","","PhoneNumberValidator.html","","<p>This class is the master/parent class to all of the validation functionality\n"],["PhoneNumberValidator::Validator","","PhoneNumberValidator/Validator.html","","<p>This class does all of the matching and checking work for the validation of the phone number.\n"],["PhoneNumberValidatorTest","","PhoneNumberValidatorTest.html","","<p>This class represents the testing-unit for this gem app\n<p><strong>Inherits from:</strong>\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Test</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Unit</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">TestCase</span>\n</pre>\n"],["new","PhoneNumberValidator::Validator","PhoneNumberValidator/Validator.html#method-c-new","(phone_number = '+1 (987) 654-3210 ext. 198842')","<p>Initializes the <strong>@phone_number</strong> instance variable\n"],["test_invalid_phone_number","PhoneNumberValidatorTest","PhoneNumberValidatorTest.html#method-i-test_invalid_phone_number","()","<p>This test inputs an invalid phone number and expects the output to be <strong>false</strong>\n"],["test_no_phone_number","PhoneNumberValidatorTest","PhoneNumberValidatorTest.html#method-i-test_no_phone_number","()","<p>This test inputs no phone number and expects the output to be <strong>nil</strong>\n"],["test_valid_phone_number","PhoneNumberValidatorTest","PhoneNumberValidatorTest.html#method-i-test_valid_phone_number","()","<p>This test inputs a valid phone number and expects the output to be <strong>true</strong>\n"],["validate","PhoneNumberValidator","PhoneNumberValidator.html#method-c-validate","(phone_number)","<p>Validates any United States phone number!\n<p><strong>Arguments:</strong>\n\n<pre>phone_number: (String)</pre>\n"],["validate","PhoneNumberValidator::Validator","PhoneNumberValidator/Validator.html#method-i-validate","()","<p>Checks to see if the phone number the user entered is valid by testing regex the pattern with the phone …\n"],["README","","README_rdoc.html","","<p>Phone Number Validator\n<p>About\n<p>This app is a US phone number-validating RubyGem.\n"]]}}
|
data/doc/js/search_index.js.gz
CHANGED
Binary file
|
data/doc/table_of_contents.html
CHANGED
@@ -74,11 +74,6 @@
|
|
74
74
|
<h2 id="classes">Classes and Modules</h2>
|
75
75
|
<ul>
|
76
76
|
|
77
|
-
<li class="class">
|
78
|
-
<a href="Object.html">Object</a>
|
79
|
-
|
80
|
-
</li>
|
81
|
-
|
82
77
|
<li class="class">
|
83
78
|
<a href="PhoneNumberValidator.html">PhoneNumberValidator</a>
|
84
79
|
|
@@ -109,11 +104,6 @@
|
|
109
104
|
—
|
110
105
|
<span class="container">PhoneNumberValidator</span>
|
111
106
|
|
112
|
-
<li class="method">
|
113
|
-
<a href="Object.html#method-i-pnv">#pnv</a>
|
114
|
-
—
|
115
|
-
<span class="container">Object</span>
|
116
|
-
|
117
107
|
<li class="method">
|
118
108
|
<a href="PhoneNumberValidatorTest.html#method-i-test_invalid_phone_number">#test_invalid_phone_number</a>
|
119
109
|
—
|
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: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bag33188
|
@@ -47,7 +47,6 @@ files:
|
|
47
47
|
- README.rdoc
|
48
48
|
- Rakefile
|
49
49
|
- bin/pnv
|
50
|
-
- doc/Object.html
|
51
50
|
- doc/PhoneNumberValidator.html
|
52
51
|
- doc/PhoneNumberValidator/Validator.html
|
53
52
|
- doc/PhoneNumberValidatorTest.html
|
@@ -99,7 +98,6 @@ files:
|
|
99
98
|
- doc/table_of_contents.html
|
100
99
|
- lib/phone_number_validator.rb
|
101
100
|
- lib/phone_number_validator/validator.rb
|
102
|
-
- lib/pnv/pnv.rb
|
103
101
|
- phone_number_validator.gemspec
|
104
102
|
- test/test_phone_number_validator.rb
|
105
103
|
homepage: https://github.com/bag33188/phone-number-validator
|
data/doc/Object.html
DELETED
@@ -1,200 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class Object - Phone Number Validator</title>
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
var rdoc_rel_prefix = "./";
|
11
|
-
var index_rel_prefix = "./";
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<script src="./js/jquery.js"></script>
|
15
|
-
<script src="./js/darkfish.js"></script>
|
16
|
-
|
17
|
-
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
-
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<body id="top" role="document" class="class">
|
24
|
-
<nav role="navigation">
|
25
|
-
<div id="project-navigation">
|
26
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
-
<h2>
|
28
|
-
<a href="./index.html" rel="home">Home</a>
|
29
|
-
</h2>
|
30
|
-
|
31
|
-
<div id="table-of-contents-navigation">
|
32
|
-
<a href="./table_of_contents.html#pages">Pages</a>
|
33
|
-
<a href="./table_of_contents.html#classes">Classes</a>
|
34
|
-
<a href="./table_of_contents.html#methods">Methods</a>
|
35
|
-
</div>
|
36
|
-
</div>
|
37
|
-
|
38
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
-
<form action="#" method="get" accept-charset="utf-8">
|
40
|
-
<div id="search-field-wrapper">
|
41
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
-
aria-autocomplete="list" aria-controls="search-results"
|
43
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
-
</div>
|
46
|
-
|
47
|
-
<ul id="search-results" aria-label="Search Results"
|
48
|
-
aria-busy="false" aria-expanded="false"
|
49
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
-
</form>
|
51
|
-
</div>
|
52
|
-
|
53
|
-
</div>
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
<div id="class-metadata">
|
58
|
-
|
59
|
-
<div id="parent-class-section" class="nav-section">
|
60
|
-
<h3>Parent</h3>
|
61
|
-
|
62
|
-
|
63
|
-
<p class="link">BasicObject
|
64
|
-
|
65
|
-
</div>
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<!-- Method Quickref -->
|
70
|
-
<div id="method-list-section" class="nav-section">
|
71
|
-
<h3>Methods</h3>
|
72
|
-
|
73
|
-
<ul class="link-list" role="directory">
|
74
|
-
|
75
|
-
<li ><a href="#method-i-pnv">#pnv</a>
|
76
|
-
|
77
|
-
</ul>
|
78
|
-
</div>
|
79
|
-
|
80
|
-
</div>
|
81
|
-
</nav>
|
82
|
-
|
83
|
-
<main role="main" aria-labelledby="class-Object">
|
84
|
-
<h1 id="class-Object" class="class">
|
85
|
-
class Object
|
86
|
-
</h1>
|
87
|
-
|
88
|
-
<section class="description">
|
89
|
-
|
90
|
-
</section>
|
91
|
-
|
92
|
-
|
93
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
104
|
-
<header>
|
105
|
-
<h3>Public Instance Methods</h3>
|
106
|
-
</header>
|
107
|
-
|
108
|
-
|
109
|
-
<div id="method-i-pnv" class="method-detail ">
|
110
|
-
|
111
|
-
<div class="method-heading">
|
112
|
-
<span class="method-name">pnv</span><span
|
113
|
-
class="method-args">()</span>
|
114
|
-
|
115
|
-
<span class="method-click-advice">click to toggle source</span>
|
116
|
-
|
117
|
-
</div>
|
118
|
-
|
119
|
-
|
120
|
-
<div class="method-description">
|
121
|
-
|
122
|
-
<p><strong>For command line usage:</strong></p>
|
123
|
-
|
124
|
-
<p>Checks to see if the phone number the user entered is valid by testing regex the pattern with the phone number</p>
|
125
|
-
|
126
|
-
<p><strong>Return Type:</strong> boolean or string</p>
|
127
|
-
|
128
|
-
<h3 id="method-i-pnv-label-Examples">Examples<span><a href="#method-i-pnv-label-Examples">¶</a> <a href="#top">↑</a></span></h3>
|
129
|
-
|
130
|
-
<h4 id="method-i-pnv-label-Ex.+1">Ex. 1<span><a href="#method-i-pnv-label-Ex.+1">¶</a> <a href="#top">↑</a></span></h4>
|
131
|
-
|
132
|
-
<pre>$ pnv "+1 (987) 654-3210 ext. 198842"</pre>
|
133
|
-
|
134
|
-
<h5 id="method-i-pnv-label-Output">Output<span><a href="#method-i-pnv-label-Output">¶</a> <a href="#top">↑</a></span></h5>
|
135
|
-
|
136
|
-
<pre>=> true</pre>
|
137
|
-
|
138
|
-
<h4 id="method-i-pnv-label-Ex.+2">Ex. 2<span><a href="#method-i-pnv-label-Ex.+2">¶</a> <a href="#top">↑</a></span></h4>
|
139
|
-
|
140
|
-
<pre class="ruby"><span class="ruby-identifier">pnv</span> <span class="ruby-string">"+1 (987 778873-321a0 ext.ff99"</span>
|
141
|
-
</pre>
|
142
|
-
|
143
|
-
<h5 id="method-i-pnv-label-Output">Output<span><a href="#method-i-pnv-label-Output">¶</a> <a href="#top">↑</a></span></h5>
|
144
|
-
|
145
|
-
<pre>=> false</pre>
|
146
|
-
|
147
|
-
<h4 id="method-i-pnv-label-Ex.+3">Ex. 3<span><a href="#method-i-pnv-label-Ex.+3">¶</a> <a href="#top">↑</a></span></h4>
|
148
|
-
|
149
|
-
<pre class="ruby"><span class="ruby-identifier">pnv</span> <span class="ruby-string">""</span>
|
150
|
-
</pre>
|
151
|
-
|
152
|
-
<h5 id="method-i-pnv-label-Output">Output<span><a href="#method-i-pnv-label-Output">¶</a> <a href="#top">↑</a></span></h5>
|
153
|
-
|
154
|
-
<pre>=> "No phone number entered."</pre>
|
155
|
-
|
156
|
-
<h4 id="method-i-pnv-label-Ex.+4">Ex. 4<span><a href="#method-i-pnv-label-Ex.+4">¶</a> <a href="#top">↑</a></span></h4>
|
157
|
-
|
158
|
-
<pre class="ruby"><span class="ruby-identifier">pnv</span>
|
159
|
-
</pre>
|
160
|
-
|
161
|
-
<h5 id="method-i-pnv-label-Output">Output<span><a href="#method-i-pnv-label-Output">¶</a> <a href="#top">↑</a></span></h5>
|
162
|
-
|
163
|
-
<pre>=> "No phone number entered."</pre>
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
<div class="method-source-code" id="pnv-source">
|
169
|
-
<pre><span class="ruby-comment"># File lib/pnv/pnv.rb, line 42</span>
|
170
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pnv</span>
|
171
|
-
<span class="ruby-keyword">if</span> (<span class="ruby-constant">ARGV</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">||</span> <span class="ruby-constant">ARGV</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-string">''</span>)
|
172
|
-
<span class="ruby-identifier">print</span> <span class="ruby-string">"No phone number entered.\r\n"</span>
|
173
|
-
<span class="ruby-keyword">else</span>
|
174
|
-
<span class="ruby-comment"># execute validator</span>
|
175
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-constant">ARGV</span>[<span class="ruby-value">0</span>])
|
176
|
-
<span class="ruby-keyword">end</span>
|
177
|
-
<span class="ruby-keyword">end</span></pre>
|
178
|
-
</div>
|
179
|
-
|
180
|
-
</div>
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
</div>
|
186
|
-
|
187
|
-
|
188
|
-
</section>
|
189
|
-
|
190
|
-
</section>
|
191
|
-
|
192
|
-
</main>
|
193
|
-
|
194
|
-
|
195
|
-
<footer id="validator-badges" role="contentinfo">
|
196
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
197
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
|
198
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
199
|
-
</footer>
|
200
|
-
|
data/lib/pnv/pnv.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'phone_number_validator'
|
2
|
-
|
3
|
-
##
|
4
|
-
# <b>For command line usage:</b>
|
5
|
-
#
|
6
|
-
# Checks to see if the phone number the user entered is valid
|
7
|
-
# by testing regex the pattern with the phone number
|
8
|
-
#
|
9
|
-
# <b>Return Type:</b> boolean or string
|
10
|
-
#
|
11
|
-
# === Examples
|
12
|
-
#
|
13
|
-
# ==== Ex. 1
|
14
|
-
#
|
15
|
-
# $ pnv "+1 (987) 654-3210 ext. 198842"
|
16
|
-
#
|
17
|
-
# ===== Output
|
18
|
-
#
|
19
|
-
# => true
|
20
|
-
#
|
21
|
-
# ==== Ex. 2
|
22
|
-
#
|
23
|
-
# pnv "+1 (987 778873-321a0 ext.ff99"
|
24
|
-
#
|
25
|
-
# ===== Output
|
26
|
-
#
|
27
|
-
# => false
|
28
|
-
#
|
29
|
-
# ==== Ex. 3
|
30
|
-
#
|
31
|
-
# pnv ""
|
32
|
-
#
|
33
|
-
# ===== Output
|
34
|
-
# => "No phone number entered."
|
35
|
-
#
|
36
|
-
# ==== Ex. 4
|
37
|
-
#
|
38
|
-
# pnv
|
39
|
-
#
|
40
|
-
# ===== Output
|
41
|
-
# => "No phone number entered."
|
42
|
-
def pnv
|
43
|
-
if (ARGV[0] == nil || ARGV[0] == '')
|
44
|
-
print "No phone number entered.\r\n"
|
45
|
-
else
|
46
|
-
# execute validator
|
47
|
-
puts PhoneNumberValidator.validate(ARGV[0])
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# call pnv function
|
52
|
-
pnv()
|