phone_number_validator 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
data/doc/README_rdoc.html CHANGED
@@ -1,171 +1,171 @@
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-Development">Development</a>
74
- </ul>
75
- </div>
76
-
77
-
78
- <div id="project-metadata">
79
- <div id="fileindex-section" class="nav-section">
80
- <h3>Pages</h3>
81
-
82
- <ul class="link-list">
83
-
84
- <li><a href="./README_rdoc.html">README</a>
85
-
86
- </ul>
87
- </div>
88
-
89
- </div>
90
- </nav>
91
-
92
- <main role="main" aria-label="Page README.rdoc">
93
-
94
- <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>
95
-
96
- <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
97
-
98
- <p>This app is a US phone number-validating RubyGem.</p>
99
-
100
- <p>It uses a complex regular expression to validate any United States phone number.</p>
101
-
102
- <h3 id="label-Regular+Expression">Regular Expression<span><a href="#label-Regular+Expression">&para;</a> <a href="#top">&uarr;</a></span></h3>
103
-
104
- <p>This gem uses the following regular expression:</p>
105
-
106
- <pre class="ruby"><span class="ruby-comment"># US Phone Numbers</span>
107
- <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>
108
- <span class="ruby-comment"># Regex Flags: i (ignore case)</span>
109
- </pre>
110
-
111
- <h2 id="label-Installing">Installing<span><a href="#label-Installing">&para;</a> <a href="#top">&uarr;</a></span></h2>
112
-
113
- <pre>$ gem install phone_number_validator</pre>
114
-
115
- <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>
116
-
117
- <pre>$ bundle install</pre>
118
-
119
- <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>
120
-
121
- <pre>$ bundle update</pre>
122
-
123
- <h2 id="label-Uninstalling">Uninstalling<span><a href="#label-Uninstalling">&para;</a> <a href="#top">&uarr;</a></span></h2>
124
-
125
- <pre>$ gem uninstall phone_number_validator</pre>
126
-
127
- <h2 id="label-Testing">Testing<span><a href="#label-Testing">&para;</a> <a href="#top">&uarr;</a></span></h2>
128
-
129
- <pre>$ rake test</pre>
130
-
131
- <h2 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>
132
-
133
- <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>
134
-
135
- <pre>$ pnv &quot;+1 (987) 654-3210 ext. 198842&quot;</pre>
136
-
137
- <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
138
-
139
- <pre>=&gt; true</pre>
140
-
141
- <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>
142
-
143
- <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;phone_number_validator&#39;</span>
144
-
145
- <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>)
146
-
147
- <span class="ruby-identifier">print</span> <span class="ruby-identifier">check_phone_number</span>
148
- </pre>
149
-
150
- <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
151
-
152
- <pre>=&gt; true</pre>
153
-
154
- <p>Output can be <strong>true</strong> (<em>boolean, valid phone number</em>), <strong>false</strong> (<em>boolean, invalid phone number</em>), or <strong>nil</strong> (<em>symbol, no phone number entered</em>).</p>
155
-
156
- <h2 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#top">&uarr;</a></span></h2>
157
-
158
- <p>Run the following to make <code>bin/pnv</code> executable (Unix only):</p>
159
-
160
- <pre>chmod ugo+x bin/pnv</pre>
161
-
162
- </main>
163
-
164
-
165
-
166
- <footer id="validator-badges" role="contentinfo">
167
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
168
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
169
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
170
- </footer>
171
-
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 <strong>true</strong> (<em>boolean, valid phone number</em>),
154
+ <strong>false</strong> (<em>boolean, invalid phone number</em>), or
155
+ <strong>nil</strong> (<em>symbol, no phone number entered</em>).</p>
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 to make <code>bin/pnv</code> executable (Unix only):</p>
160
+
161
+ <pre>chmod ugo+x bin/pnv</pre>
162
+ </main>
163
+
164
+
165
+
166
+ <footer id="validator-badges" role="contentinfo">
167
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
168
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
169
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
170
+ </footer>
171
+
data/doc/created.rid CHANGED
@@ -1,6 +1,6 @@
1
- Wed, 07 Aug 2019 08:27:49 -0700
2
- README.rdoc Wed, 07 Aug 2019 08:27:33 -0700
3
- lib/phone_number_validator.rb Sun, 21 Jul 2019 04:57:13 -0700
4
- lib/phone_number_validator/validator.rb Sun, 21 Jul 2019 04:57:13 -0700
5
- test/test_phone_number_validator.rb Sun, 21 Jul 2019 04:57:13 -0700
6
- bin/pnv Sun, 21 Jul 2019 04:57:13 -0700
1
+ Wed, 07 Aug 2019 08:34:48 -0700
2
+ README.rdoc Wed, 07 Aug 2019 08:29:12 -0700
3
+ lib/phone_number_validator.rb Tue, 27 Nov 2018 09:42:11 -0800
4
+ lib/phone_number_validator/validator.rb Thu, 11 Jul 2019 08:46:02 -0700
5
+ test/test_phone_number_validator.rb Thu, 11 Jul 2019 08:46:25 -0700
6
+ bin/pnv Wed, 07 Aug 2019 08:29:12 -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,165 +1,164 @@
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
- <p>Output can be <strong>true</strong> (<em>boolean, valid phone number</em>), <strong>false</strong> (<em>boolean, invalid phone number</em>), or <strong>nil</strong> (<em>symbol, no phone number entered</em>).</p>
148
-
149
- <h2 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#top">&uarr;</a></span></h2>
150
-
151
- <p>Run the following to make <code>bin/pnv</code> executable (Unix only):</p>
152
-
153
- <pre>chmod ugo+x bin/pnv</pre>
154
-
155
-
156
- </main>
157
-
158
-
159
-
160
- <footer id="validator-badges" role="contentinfo">
161
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
162
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.0.
163
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
164
- </footer>
165
-
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 <strong>true</strong> (<em>boolean, valid phone number</em>),
147
+ <strong>false</strong> (<em>boolean, invalid phone number</em>), or
148
+ <strong>nil</strong> (<em>symbol, no phone number entered</em>).</p>
149
+
150
+ <h2 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#top">&uarr;</a></span></h2>
151
+
152
+ <p>Run the following to make <code>bin/pnv</code> executable (Unix only):</p>
153
+
154
+ <pre>chmod ugo+x bin/pnv</pre>
155
+ </main>
156
+
157
+
158
+
159
+ <footer id="validator-badges" role="contentinfo">
160
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
161
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
162
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
163
+ </footer>
164
+