phone_number_validator 0.9.4 → 0.9.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.
data/doc/README_rdoc.html CHANGED
@@ -1,179 +1,183 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta charset="UTF-8">
6
-
7
- <title>README - Phone Number Validator</title>
8
-
9
- <script type="text/javascript">
10
- var rdoc_rel_prefix = "./";
11
- </script>
12
-
13
- <script src="./js/jquery.js"></script>
14
- <script src="./js/darkfish.js"></script>
15
-
16
- <link href="./css/fonts.css" rel="stylesheet">
17
- <link href="./css/rdoc.css" rel="stylesheet">
18
-
19
-
20
-
21
- <body id="top" role="document" class="file">
22
- <nav role="navigation">
23
- <div id="project-navigation">
24
- <div id="home-section" role="region" title="Quick navigation" class="nav-section">
25
- <h2>
26
- <a href="./index.html" rel="home">Home</a>
27
- </h2>
28
-
29
- <div id="table-of-contents-navigation">
30
- <a href="./table_of_contents.html#pages">Pages</a>
31
- <a href="./table_of_contents.html#classes">Classes</a>
32
- <a href="./table_of_contents.html#methods">Methods</a>
33
- </div>
34
- </div>
35
-
36
- <div id="search-section" role="search" class="project-section initially-hidden">
37
- <form action="#" method="get" accept-charset="utf-8">
38
- <div id="search-field-wrapper">
39
- <input id="search-field" role="combobox" aria-label="Search"
40
- aria-autocomplete="list" aria-controls="search-results"
41
- type="text" name="search" placeholder="Search" spellcheck="false"
42
- title="Type to search, Up and Down to navigate, Enter to load">
43
- </div>
44
-
45
- <ul id="search-results" aria-label="Search Results"
46
- aria-busy="false" aria-expanded="false"
47
- aria-atomic="false" class="initially-hidden"></ul>
48
- </form>
49
- </div>
50
-
51
- </div>
52
-
53
-
54
- <div class="nav-section">
55
- <h3>Table of Contents</h3>
56
-
57
- <ul class="link-list" role="directory">
58
- <li><a href="#label-Phone+Number+Validator">Phone Number Validator</a>
59
- <li><a href="#label-About">About</a>
60
- <li><a href="#label-Regular+Expression">Regular Expression</a>
61
- <li><a href="#label-Installing">Installing</a>
62
- <li><a href="#label-Install+Required+Gems-2FDependencies">Install Required Gems/Dependencies</a>
63
- <li><a href="#label-Updating+Required+Gems-2FDependencies">Updating Required Gems/Dependencies</a>
64
- <li><a href="#label-Uninstalling">Uninstalling</a>
65
- <li><a href="#label-Testing">Testing</a>
66
- <li><a href="#label-Usage">Usage</a>
67
- <li><a href="#label-In+command+line">In command line</a>
68
- <li><a href="#label-Output">Output</a>
69
- <li><a href="#label-In+Ruby+code">In Ruby code</a>
70
- <li><a href="#label-Output">Output</a>
71
- <li><a href="#label-Development">Development</a>
72
- </ul>
73
- </div>
74
-
75
-
76
- <div id="project-metadata">
77
- <div id="fileindex-section" class="nav-section">
78
- <h3>Pages</h3>
79
-
80
- <ul class="link-list">
81
-
82
- <li><a href="./README_rdoc.html">README</a>
83
-
84
- </ul>
85
- </div>
86
-
87
- </div>
88
- </nav>
89
-
90
- <main role="main" aria-label="Page README.rdoc">
91
-
92
- <h1 id="label-Phone+Number+Validator">Phone Number Validator<span><a href="#label-Phone+Number+Validator">&para;</a> <a href="#top">&uarr;</a></span></h1>
93
-
94
- <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
95
-
96
- <p>This app is a US phone number-validating RubyGem.</p>
97
-
98
- <p>It uses a complex regular expression to validate any United States phone
99
- number.</p>
100
-
101
- <h3 id="label-Regular+Expression">Regular Expression<span><a href="#label-Regular+Expression">&para;</a> <a href="#top">&uarr;</a></span></h3>
102
-
103
- <p>This gem uses the following regular expression:</p>
104
-
105
- <pre class="ruby"><span class="ruby-comment"># US Phone Numbers</span>
106
- <span class="ruby-node">/^(?:(?:[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</span>
107
- <span class="ruby-comment"># Regex Flags: i (ignore case)</span>
108
- </pre>
109
-
110
- <h2 id="label-Installing">Installing<span><a href="#label-Installing">&para;</a> <a href="#top">&uarr;</a></span></h2>
111
-
112
- <pre>$ gem install phone_number_validator</pre>
113
-
114
- <h3 id="label-Install+Required+Gems-2FDependencies">Install Required Gems/Dependencies<span><a href="#label-Install+Required+Gems-2FDependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
115
-
116
- <pre>$ bundle install</pre>
117
-
118
- <h3 id="label-Updating+Required+Gems-2FDependencies">Updating Required Gems/Dependencies<span><a href="#label-Updating+Required+Gems-2FDependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
119
-
120
- <pre>$ bundle update</pre>
121
-
122
- <h2 id="label-Uninstalling">Uninstalling<span><a href="#label-Uninstalling">&para;</a> <a href="#top">&uarr;</a></span></h2>
123
-
124
- <pre>$ gem uninstall phone_number_validator</pre>
125
-
126
- <h2 id="label-Testing">Testing<span><a href="#label-Testing">&para;</a> <a href="#top">&uarr;</a></span></h2>
127
-
128
- <pre>$ rake test</pre>
129
-
130
- <h2 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>
131
-
132
- <h3 id="label-In+command+line">In command line<span><a href="#label-In+command+line">&para;</a> <a href="#top">&uarr;</a></span></h3>
133
-
134
- <pre>$ pnv &quot;+1 (987) 654-3210 ext. 198842&quot;</pre>
135
-
136
- <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
137
-
138
- <pre>=&gt; true</pre>
139
-
140
- <h3 id="label-In+Ruby+code">In Ruby code<span><a href="#label-In+Ruby+code">&para;</a> <a href="#top">&uarr;</a></span></h3>
141
-
142
- <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;phone_number_validator&#39;</span>
143
-
144
- <span class="ruby-identifier">check_phone_number</span> = <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate_phone_number</span>(<span class="ruby-string">&#39;+1 (987) 654-3210 ext. 198842&#39;</span>)
145
-
146
- <span class="ruby-identifier">print</span> <span class="ruby-identifier">check_phone_number</span>
147
- </pre>
148
-
149
- <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
150
-
151
- <pre>=&gt; true</pre>
152
-
153
- <p>Output can be:</p>
154
- <ul><li>
155
- <p><strong>true</strong> (<em>boolean: valid phone number</em>)</p>
156
- </li><li>
157
- <p><strong>false</strong> (<em>boolean: invalid phone number</em>)</p>
158
- </li><li>
159
- <p><strong>nil</strong> (<em>nil: no phone number entered</em>)</p>
160
- </li><li>
161
- <p><strong>void</strong> (<em>void: no phone number arg provided</em>)</p>
162
- </li></ul>
163
-
164
- <h2 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#top">&uarr;</a></span></h2>
165
-
166
- <p>Run the following in development to make <code>bin/pnv</code> executable
167
- (Unix only):</p>
168
-
169
- <pre>chmod ugo+x bin/pnv</pre>
170
- </main>
171
-
172
-
173
-
174
- <footer id="validator-badges" role="contentinfo">
175
- <p><a href="http://validator.w3.org/check/referer">Validate</a>
176
- <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
177
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
178
- </footer>
179
-
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>README - 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="file">
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
+ <div class="nav-section">
57
+ <h3>Table of Contents</h3>
58
+
59
+ <ul class="link-list" role="directory">
60
+ <li><a href="#label-Phone+Number+Validator">Phone Number Validator</a>
61
+ <li><a href="#label-About">About</a>
62
+ <li><a href="#label-Regular+Expression">Regular Expression</a>
63
+ <li><a href="#label-Installing">Installing</a>
64
+ <li><a href="#label-Install+Required+Gems-2FDependencies">Install Required Gems/Dependencies</a>
65
+ <li><a href="#label-Updating+Required+Gems-2FDependencies">Updating Required Gems/Dependencies</a>
66
+ <li><a href="#label-Uninstalling">Uninstalling</a>
67
+ <li><a href="#label-Testing">Testing</a>
68
+ <li><a href="#label-Usage">Usage</a>
69
+ <li><a href="#label-In+command+line">In command line</a>
70
+ <li><a href="#label-Output">Output</a>
71
+ <li><a href="#label-In+Ruby+code">In Ruby code</a>
72
+ <li><a href="#label-Output">Output</a>
73
+ <li><a href="#label-Output+Types">Output Types</a>
74
+ <li><a href="#label-Development">Development</a>
75
+ </ul>
76
+ </div>
77
+
78
+
79
+ <div id="project-metadata">
80
+ <div id="fileindex-section" class="nav-section">
81
+ <h3>Pages</h3>
82
+
83
+ <ul class="link-list">
84
+
85
+ <li><a href="./README_rdoc.html">README</a>
86
+
87
+ </ul>
88
+ </div>
89
+
90
+ </div>
91
+ </nav>
92
+
93
+ <main role="main" aria-label="Page README.rdoc">
94
+
95
+ <h1 id="label-Phone+Number+Validator">Phone Number Validator<span><a href="#label-Phone+Number+Validator">&para;</a> <a href="#top">&uarr;</a></span></h1>
96
+
97
+ <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
98
+
99
+ <p>This app is a US phone number-validating RubyGem.</p>
100
+
101
+ <p>It uses a complex regular expression to validate any United States phone number.</p>
102
+
103
+ <h3 id="label-Regular+Expression">Regular Expression<span><a href="#label-Regular+Expression">&para;</a> <a href="#top">&uarr;</a></span></h3>
104
+
105
+ <p>This gem uses the following regular expression:</p>
106
+
107
+ <pre class="ruby"><span class="ruby-comment"># US Phone Numbers</span>
108
+ <span class="ruby-regexp">/^(?:(?:[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</span>
109
+ <span class="ruby-comment"># Regex Flags: i (ignore case)</span>
110
+ </pre>
111
+
112
+ <h2 id="label-Installing">Installing<span><a href="#label-Installing">&para;</a> <a href="#top">&uarr;</a></span></h2>
113
+
114
+ <pre>$ gem install phone_number_validator</pre>
115
+
116
+ <h3 id="label-Install+Required+Gems-2FDependencies">Install Required Gems/Dependencies<span><a href="#label-Install+Required+Gems-2FDependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
117
+
118
+ <pre>$ bundle install</pre>
119
+
120
+ <h3 id="label-Updating+Required+Gems-2FDependencies">Updating Required Gems/Dependencies<span><a href="#label-Updating+Required+Gems-2FDependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
121
+
122
+ <pre>$ bundle update</pre>
123
+
124
+ <h2 id="label-Uninstalling">Uninstalling<span><a href="#label-Uninstalling">&para;</a> <a href="#top">&uarr;</a></span></h2>
125
+
126
+ <pre>$ gem uninstall phone_number_validator</pre>
127
+
128
+ <h2 id="label-Testing">Testing<span><a href="#label-Testing">&para;</a> <a href="#top">&uarr;</a></span></h2>
129
+
130
+ <pre>$ rake test</pre>
131
+
132
+ <h2 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>
133
+
134
+ <h3 id="label-In+command+line">In command line<span><a href="#label-In+command+line">&para;</a> <a href="#top">&uarr;</a></span></h3>
135
+
136
+ <pre>$ pnv &quot;+1 (987) 654-3210 ext. 198842&quot;</pre>
137
+
138
+ <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
139
+
140
+ <pre>=&gt; true</pre>
141
+
142
+ <h3 id="label-In+Ruby+code">In Ruby code<span><a href="#label-In+Ruby+code">&para;</a> <a href="#top">&uarr;</a></span></h3>
143
+
144
+ <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;phone_number_validator&#39;</span>
145
+
146
+ <span class="ruby-identifier">check_phone_number</span> = <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate_phone_number</span>(<span class="ruby-string">&#39;+1 (987) 654-3210 ext. 198842&#39;</span>)
147
+
148
+ <span class="ruby-identifier">print</span> <span class="ruby-identifier">check_phone_number</span>
149
+ </pre>
150
+
151
+ <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
152
+
153
+ <pre>=&gt; true</pre>
154
+
155
+ <h3 id="label-Output+Types">Output Types<span><a href="#label-Output+Types">&para;</a> <a href="#top">&uarr;</a></span></h3>
156
+
157
+ <p>Output can be:</p>
158
+ <ul><li>
159
+ <p><strong>true</strong> (<em>boolean: valid phone number</em>)</p>
160
+ </li><li>
161
+ <p><strong>false</strong> (<em>boolean: invalid phone number</em>)</p>
162
+ </li><li>
163
+ <p><strong>nil</strong> (<em>nil: no phone number entered</em>)</p>
164
+ </li><li>
165
+ <p><strong>void</strong> (<em>void: no phone number arg provided</em>)</p>
166
+ </li></ul>
167
+
168
+ <h2 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#top">&uarr;</a></span></h2>
169
+
170
+ <p>Run the following in development to make <code>bin/pnv</code> executable (Unix only):</p>
171
+
172
+ <pre>chmod ugo+x bin/pnv</pre>
173
+
174
+ </main>
175
+
176
+
177
+
178
+ <footer id="validator-badges" role="contentinfo">
179
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
180
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
181
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
182
+ </footer>
183
+
data/doc/created.rid CHANGED
@@ -1,6 +1,6 @@
1
- Wed, 07 Aug 2019 08:46:20 -0700
2
- README.rdoc Wed, 07 Aug 2019 08:45:50 -0700
3
- lib/phone_number_validator.rb Tue, 27 Nov 2018 09:42:11 -0800
4
- lib/phone_number_validator/validator.rb Wed, 07 Aug 2019 08:40:24 -0700
5
- test/test_phone_number_validator.rb Wed, 07 Aug 2019 08:41:52 -0700
6
- bin/pnv Wed, 07 Aug 2019 08:29:12 -0700
1
+ Thu, 08 Aug 2019 14:34:33 -0700
2
+ README.rdoc Thu, 08 Aug 2019 14:17:33 -0700
3
+ lib/phone_number_validator.rb Thu, 08 Aug 2019 14:17:33 -0700
4
+ lib/phone_number_validator/validator.rb Thu, 08 Aug 2019 14:17:33 -0700
5
+ test/test_phone_number_validator.rb Thu, 08 Aug 2019 14:17:33 -0700
6
+ bin/pnv Thu, 08 Aug 2019 14:17:33 -0700
data/doc/css/fonts.css CHANGED
@@ -17,7 +17,7 @@
17
17
  font-weight: 400;
18
18
  src: local("Source Code Pro"),
19
19
  local("SourceCodePro-Regular"),
20
- url("fonts/SourceCodePro-Regular.ttf") format("truetype");
20
+ url("../fonts/SourceCodePro-Regular.ttf") format("truetype");
21
21
  }
22
22
 
23
23
  @font-face {
@@ -26,7 +26,7 @@
26
26
  font-weight: 700;
27
27
  src: local("Source Code Pro Bold"),
28
28
  local("SourceCodePro-Bold"),
29
- url("fonts/SourceCodePro-Bold.ttf") format("truetype");
29
+ url("../fonts/SourceCodePro-Bold.ttf") format("truetype");
30
30
  }
31
31
 
32
32
  /*
@@ -46,7 +46,7 @@
46
46
  font-weight: 300;
47
47
  src: local("Lato Light"),
48
48
  local("Lato-Light"),
49
- url("fonts/Lato-Light.ttf") format("truetype");
49
+ url("../fonts/Lato-Light.ttf") format("truetype");
50
50
  }
51
51
 
52
52
  @font-face {
@@ -55,7 +55,7 @@
55
55
  font-weight: 300;
56
56
  src: local("Lato Light Italic"),
57
57
  local("Lato-LightItalic"),
58
- url("fonts/Lato-LightItalic.ttf") format("truetype");
58
+ url("../fonts/Lato-LightItalic.ttf") format("truetype");
59
59
  }
60
60
 
61
61
  @font-face {
@@ -64,7 +64,7 @@
64
64
  font-weight: 700;
65
65
  src: local("Lato Regular"),
66
66
  local("Lato-Regular"),
67
- url("fonts/Lato-Regular.ttf") format("truetype");
67
+ url("../fonts/Lato-Regular.ttf") format("truetype");
68
68
  }
69
69
 
70
70
  @font-face {
@@ -73,7 +73,7 @@
73
73
  font-weight: 700;
74
74
  src: local("Lato Italic"),
75
75
  local("Lato-Italic"),
76
- url("fonts/Lato-RegularItalic.ttf") format("truetype");
76
+ url("../fonts/Lato-RegularItalic.ttf") format("truetype");
77
77
  }
78
78
 
79
79
  /*
data/doc/index.html CHANGED
@@ -1,172 +1,176 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta charset="UTF-8">
6
-
7
- <title>Phone Number Validator</title>
8
-
9
- <script type="text/javascript">
10
- var rdoc_rel_prefix = "./";
11
- </script>
12
-
13
- <script src="./js/jquery.js"></script>
14
- <script src="./js/darkfish.js"></script>
15
-
16
- <link href="./css/fonts.css" rel="stylesheet">
17
- <link href="./css/rdoc.css" rel="stylesheet">
18
-
19
-
20
-
21
- <body id="top" role="document" class="file">
22
- <nav role="navigation">
23
- <div id="project-navigation">
24
- <div id="home-section" role="region" title="Quick navigation" class="nav-section">
25
- <h2>
26
- <a href="./index.html" rel="home">Home</a>
27
- </h2>
28
-
29
- <div id="table-of-contents-navigation">
30
- <a href="./table_of_contents.html#pages">Pages</a>
31
- <a href="./table_of_contents.html#classes">Classes</a>
32
- <a href="./table_of_contents.html#methods">Methods</a>
33
- </div>
34
- </div>
35
-
36
-
37
- <div id="search-section" role="search" class="project-section initially-hidden">
38
- <form action="#" method="get" accept-charset="utf-8">
39
- <div id="search-field-wrapper">
40
- <input id="search-field" role="combobox" aria-label="Search"
41
- aria-autocomplete="list" aria-controls="search-results"
42
- type="text" name="search" placeholder="Search" spellcheck="false"
43
- title="Type to search, Up and Down to navigate, Enter to load">
44
- </div>
45
-
46
- <ul id="search-results" aria-label="Search Results"
47
- aria-busy="false" aria-expanded="false"
48
- aria-atomic="false" class="initially-hidden"></ul>
49
- </form>
50
- </div>
51
-
52
- </div>
53
-
54
- <div id="project-metadata">
55
- <div id="fileindex-section" class="nav-section">
56
- <h3>Pages</h3>
57
-
58
- <ul class="link-list">
59
-
60
- <li><a href="./README_rdoc.html">README</a>
61
-
62
- </ul>
63
- </div>
64
-
65
- <div id="classindex-section" class="nav-section">
66
- <h3>Class and Module Index</h3>
67
-
68
- <ul class="link-list">
69
-
70
- <li><a href="./PhoneNumberValidator.html">PhoneNumberValidator</a>
71
-
72
- <li><a href="./PhoneNumberValidator/Validator.html">PhoneNumberValidator::Validator</a>
73
-
74
- <li><a href="./PhoneNumberValidatorTest.html">PhoneNumberValidatorTest</a>
75
-
76
- </ul>
77
- </div>
78
-
79
- </div>
80
- </nav>
81
-
82
- <main role="main">
83
-
84
-
85
- <h1 id="label-Phone+Number+Validator">Phone Number Validator<span><a href="#label-Phone+Number+Validator">&para;</a> <a href="#top">&uarr;</a></span></h1>
86
-
87
- <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
88
-
89
- <p>This app is a US phone number-validating RubyGem.</p>
90
-
91
- <p>It uses a complex regular expression to validate any United States phone
92
- number.</p>
93
-
94
- <h3 id="label-Regular+Expression">Regular Expression<span><a href="#label-Regular+Expression">&para;</a> <a href="#top">&uarr;</a></span></h3>
95
-
96
- <p>This gem uses the following regular expression:</p>
97
-
98
- <pre class="ruby"><span class="ruby-comment"># US Phone Numbers</span>
99
- <span class="ruby-node">/^(?:(?:[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</span>
100
- <span class="ruby-comment"># Regex Flags: i (ignore case)</span>
101
- </pre>
102
-
103
- <h2 id="label-Installing">Installing<span><a href="#label-Installing">&para;</a> <a href="#top">&uarr;</a></span></h2>
104
-
105
- <pre>$ gem install phone_number_validator</pre>
106
-
107
- <h3 id="label-Install+Required+Gems-2FDependencies">Install Required Gems/Dependencies<span><a href="#label-Install+Required+Gems-2FDependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
108
-
109
- <pre>$ bundle install</pre>
110
-
111
- <h3 id="label-Updating+Required+Gems-2FDependencies">Updating Required Gems/Dependencies<span><a href="#label-Updating+Required+Gems-2FDependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
112
-
113
- <pre>$ bundle update</pre>
114
-
115
- <h2 id="label-Uninstalling">Uninstalling<span><a href="#label-Uninstalling">&para;</a> <a href="#top">&uarr;</a></span></h2>
116
-
117
- <pre>$ gem uninstall phone_number_validator</pre>
118
-
119
- <h2 id="label-Testing">Testing<span><a href="#label-Testing">&para;</a> <a href="#top">&uarr;</a></span></h2>
120
-
121
- <pre>$ rake test</pre>
122
-
123
- <h2 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>
124
-
125
- <h3 id="label-In+command+line">In command line<span><a href="#label-In+command+line">&para;</a> <a href="#top">&uarr;</a></span></h3>
126
-
127
- <pre>$ pnv &quot;+1 (987) 654-3210 ext. 198842&quot;</pre>
128
-
129
- <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
130
-
131
- <pre>=&gt; true</pre>
132
-
133
- <h3 id="label-In+Ruby+code">In Ruby code<span><a href="#label-In+Ruby+code">&para;</a> <a href="#top">&uarr;</a></span></h3>
134
-
135
- <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;phone_number_validator&#39;</span>
136
-
137
- <span class="ruby-identifier">check_phone_number</span> = <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate_phone_number</span>(<span class="ruby-string">&#39;+1 (987) 654-3210 ext. 198842&#39;</span>)
138
-
139
- <span class="ruby-identifier">print</span> <span class="ruby-identifier">check_phone_number</span>
140
- </pre>
141
-
142
- <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
143
-
144
- <pre>=&gt; true</pre>
145
-
146
- <p>Output can be:</p>
147
- <ul><li>
148
- <p><strong>true</strong> (<em>boolean: valid phone number</em>)</p>
149
- </li><li>
150
- <p><strong>false</strong> (<em>boolean: invalid phone number</em>)</p>
151
- </li><li>
152
- <p><strong>nil</strong> (<em>nil: no phone number entered</em>)</p>
153
- </li><li>
154
- <p><strong>void</strong> (<em>void: no phone number arg provided</em>)</p>
155
- </li></ul>
156
-
157
- <h2 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#top">&uarr;</a></span></h2>
158
-
159
- <p>Run the following in development to make <code>bin/pnv</code> executable
160
- (Unix only):</p>
161
-
162
- <pre>chmod ugo+x bin/pnv</pre>
163
- </main>
164
-
165
-
166
-
167
- <footer id="validator-badges" role="contentinfo">
168
- <p><a href="http://validator.w3.org/check/referer">Validate</a>
169
- <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
170
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
171
- </footer>
172
-
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>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="file">
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
+
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
40
+ <form action="#" method="get" accept-charset="utf-8">
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
45
+ title="Type to search, Up and Down to navigate, Enter to load">
46
+ </div>
47
+
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
53
+
54
+ </div>
55
+
56
+ <div id="project-metadata">
57
+ <div id="fileindex-section" class="nav-section">
58
+ <h3>Pages</h3>
59
+
60
+ <ul class="link-list">
61
+
62
+ <li><a href="./README_rdoc.html">README</a>
63
+
64
+ </ul>
65
+ </div>
66
+
67
+ <div id="classindex-section" class="nav-section">
68
+ <h3>Class and Module Index</h3>
69
+
70
+ <ul class="link-list">
71
+
72
+ <li><a href="./PhoneNumberValidator.html">PhoneNumberValidator</a>
73
+
74
+ <li><a href="./PhoneNumberValidator/Validator.html">PhoneNumberValidator::Validator</a>
75
+
76
+ <li><a href="./PhoneNumberValidatorTest.html">PhoneNumberValidatorTest</a>
77
+
78
+ </ul>
79
+ </div>
80
+
81
+ </div>
82
+ </nav>
83
+
84
+ <main role="main">
85
+
86
+
87
+ <h1 id="label-Phone+Number+Validator">Phone Number Validator<span><a href="#label-Phone+Number+Validator">&para;</a> <a href="#top">&uarr;</a></span></h1>
88
+
89
+ <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
90
+
91
+ <p>This app is a US phone number-validating RubyGem.</p>
92
+
93
+ <p>It uses a complex regular expression to validate any United States phone number.</p>
94
+
95
+ <h3 id="label-Regular+Expression">Regular Expression<span><a href="#label-Regular+Expression">&para;</a> <a href="#top">&uarr;</a></span></h3>
96
+
97
+ <p>This gem uses the following regular expression:</p>
98
+
99
+ <pre class="ruby"><span class="ruby-comment"># US Phone Numbers</span>
100
+ <span class="ruby-regexp">/^(?:(?:[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</span>
101
+ <span class="ruby-comment"># Regex Flags: i (ignore case)</span>
102
+ </pre>
103
+
104
+ <h2 id="label-Installing">Installing<span><a href="#label-Installing">&para;</a> <a href="#top">&uarr;</a></span></h2>
105
+
106
+ <pre>$ gem install phone_number_validator</pre>
107
+
108
+ <h3 id="label-Install+Required+Gems-2FDependencies">Install Required Gems/Dependencies<span><a href="#label-Install+Required+Gems-2FDependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
109
+
110
+ <pre>$ bundle install</pre>
111
+
112
+ <h3 id="label-Updating+Required+Gems-2FDependencies">Updating Required Gems/Dependencies<span><a href="#label-Updating+Required+Gems-2FDependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
113
+
114
+ <pre>$ bundle update</pre>
115
+
116
+ <h2 id="label-Uninstalling">Uninstalling<span><a href="#label-Uninstalling">&para;</a> <a href="#top">&uarr;</a></span></h2>
117
+
118
+ <pre>$ gem uninstall phone_number_validator</pre>
119
+
120
+ <h2 id="label-Testing">Testing<span><a href="#label-Testing">&para;</a> <a href="#top">&uarr;</a></span></h2>
121
+
122
+ <pre>$ rake test</pre>
123
+
124
+ <h2 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>
125
+
126
+ <h3 id="label-In+command+line">In command line<span><a href="#label-In+command+line">&para;</a> <a href="#top">&uarr;</a></span></h3>
127
+
128
+ <pre>$ pnv &quot;+1 (987) 654-3210 ext. 198842&quot;</pre>
129
+
130
+ <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
131
+
132
+ <pre>=&gt; true</pre>
133
+
134
+ <h3 id="label-In+Ruby+code">In Ruby code<span><a href="#label-In+Ruby+code">&para;</a> <a href="#top">&uarr;</a></span></h3>
135
+
136
+ <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;phone_number_validator&#39;</span>
137
+
138
+ <span class="ruby-identifier">check_phone_number</span> = <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate_phone_number</span>(<span class="ruby-string">&#39;+1 (987) 654-3210 ext. 198842&#39;</span>)
139
+
140
+ <span class="ruby-identifier">print</span> <span class="ruby-identifier">check_phone_number</span>
141
+ </pre>
142
+
143
+ <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
144
+
145
+ <pre>=&gt; true</pre>
146
+
147
+ <h3 id="label-Output+Types">Output Types<span><a href="#label-Output+Types">&para;</a> <a href="#top">&uarr;</a></span></h3>
148
+
149
+ <p>Output can be:</p>
150
+ <ul><li>
151
+ <p><strong>true</strong> (<em>boolean: valid phone number</em>)</p>
152
+ </li><li>
153
+ <p><strong>false</strong> (<em>boolean: invalid phone number</em>)</p>
154
+ </li><li>
155
+ <p><strong>nil</strong> (<em>nil: no phone number entered</em>)</p>
156
+ </li><li>
157
+ <p><strong>void</strong> (<em>void: no phone number arg provided</em>)</p>
158
+ </li></ul>
159
+
160
+ <h2 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#top">&uarr;</a></span></h2>
161
+
162
+ <p>Run the following in development to make <code>bin/pnv</code> executable (Unix only):</p>
163
+
164
+ <pre>chmod ugo+x bin/pnv</pre>
165
+
166
+
167
+ </main>
168
+
169
+
170
+
171
+ <footer id="validator-badges" role="contentinfo">
172
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
173
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
174
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
175
+ </footer>
176
+