phone_number_validator 0.4.2 → 0.4.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.
data/doc/README_rdoc.html CHANGED
@@ -1,158 +1,159 @@
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-Updateing+Required+Gems-2FDependencies">Updateing 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-In+Ruby+code">In Ruby code</a>
69
- <li><a href="#label-Output">Output</a>
70
- </ul>
71
- </div>
72
-
73
-
74
- <div id="project-metadata">
75
- <div id="fileindex-section" class="nav-section">
76
- <h3>Pages</h3>
77
-
78
- <ul class="link-list">
79
-
80
- <li><a href="./README_rdoc.html">README</a>
81
-
82
- </ul>
83
- </div>
84
-
85
- </div>
86
- </nav>
87
-
88
- <main role="main" aria-label="Page README.rdoc">
89
-
90
- <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>
91
-
92
- <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
93
-
94
- <p>This app is a US phone number-validating RubyGem.</p>
95
-
96
- <p>It uses a complex regular expression to validate any United States phone
97
- number.</p>
98
-
99
- <h3 id="label-Regular+Expression">Regular Expression<span><a href="#label-Regular+Expression">&para;</a> <a href="#top">&uarr;</a></span></h3>
100
-
101
- <p>This gem uses the following regular expression:</p>
102
-
103
- <pre class="ruby"><span class="ruby-comment"># US Phone Numbers</span>
104
- <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>
105
- <span class="ruby-comment"># Regex Flags: i (ignore case)</span>
106
- </pre>
107
-
108
- <h2 id="label-Installing">Installing<span><a href="#label-Installing">&para;</a> <a href="#top">&uarr;</a></span></h2>
109
-
110
- <pre>$ gem install phone_number_validator</pre>
111
-
112
- <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>
113
-
114
- <pre>$ bundle install</pre>
115
-
116
- <h3 id="label-Updateing+Required+Gems-2FDependencies">Updateing Required Gems/Dependencies<span><a href="#label-Updateing+Required+Gems-2FDependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
117
-
118
- <pre>$ bundle update</pre>
119
-
120
- <h2 id="label-Uninstalling">Uninstalling<span><a href="#label-Uninstalling">&para;</a> <a href="#top">&uarr;</a></span></h2>
121
-
122
- <pre>$ gem uninstall phone_number_validator</pre>
123
-
124
- <h2 id="label-Testing">Testing<span><a href="#label-Testing">&para;</a> <a href="#top">&uarr;</a></span></h2>
125
-
126
- <pre>$ rake test</pre>
127
-
128
- <h2 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>
129
-
130
- <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>
131
-
132
- <pre>$ pnv &quot;+1 (949) 355-6244 ext. 198842&quot;
133
- =&gt; &quot;+1 (949) 355-6244 ext. 198842&quot; is a valid phone number.
134
- =&gt; true</pre>
135
-
136
- <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>
137
-
138
- <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;phone_number_validator&#39;</span>
139
-
140
- <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 (949) 355-6244 ext. 198842&#39;</span>)
141
-
142
- <span class="ruby-identifier">print</span> <span class="ruby-identifier">check_phone_number</span>
143
- </pre>
144
-
145
- <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
146
-
147
- <pre>=&gt; &quot;+1 (949) 355-6244 ext. 198842&quot; is a valid phone number.
148
- =&gt; true</pre>
149
- </main>
150
-
151
-
152
-
153
- <footer id="validator-badges" role="contentinfo">
154
- <p><a href="http://validator.w3.org/check/referer">Validate</a>
155
- <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
156
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
157
- </footer>
158
-
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
+ <body id="top" role="document" class="file">
23
+ <nav role="navigation">
24
+ <div id="project-navigation">
25
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
26
+ <h2>
27
+ <a href="./index.html" rel="home">Home</a>
28
+ </h2>
29
+
30
+ <div id="table-of-contents-navigation">
31
+ <a href="./table_of_contents.html#pages">Pages</a>
32
+ <a href="./table_of_contents.html#classes">Classes</a>
33
+ <a href="./table_of_contents.html#methods">Methods</a>
34
+ </div>
35
+ </div>
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
+
55
+ <div class="nav-section">
56
+ <h3>Table of Contents</h3>
57
+
58
+ <ul class="link-list" role="directory">
59
+ <li><a href="#label-Phone+Number+Validator">Phone Number Validator</a>
60
+ <li><a href="#label-About">About</a>
61
+ <li><a href="#label-Regular+Expression">Regular Expression</a>
62
+ <li><a href="#label-Installing">Installing</a>
63
+ <li><a href="#label-Install+Required+Gems-2FDependencies">Install Required Gems/Dependencies</a>
64
+ <li><a href="#label-Updateing+Required+Gems-2FDependencies">Updateing Required Gems/Dependencies</a>
65
+ <li><a href="#label-Uninstalling">Uninstalling</a>
66
+ <li><a href="#label-Testing">Testing</a>
67
+ <li><a href="#label-Usage">Usage</a>
68
+ <li><a href="#label-In+command+line">In command line</a>
69
+ <li><a href="#label-In+Ruby+code">In Ruby code</a>
70
+ <li><a href="#label-Output">Output</a>
71
+ </ul>
72
+ </div>
73
+
74
+
75
+ <div id="project-metadata">
76
+ <div id="fileindex-section" class="nav-section">
77
+ <h3>Pages</h3>
78
+
79
+ <ul class="link-list">
80
+
81
+ <li><a href="./README_rdoc.html">README</a>
82
+
83
+ </ul>
84
+ </div>
85
+
86
+ </div>
87
+ </nav>
88
+
89
+ <main role="main" aria-label="Page README.rdoc">
90
+
91
+ <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>
92
+
93
+ <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
94
+
95
+ <p>This app is a US phone number-validating RubyGem.</p>
96
+
97
+ <p>It uses a complex regular expression to validate any United States phone
98
+ number.</p>
99
+
100
+ <h3 id="label-Regular+Expression">Regular Expression<span><a href="#label-Regular+Expression">&para;</a> <a href="#top">&uarr;</a></span></h3>
101
+
102
+ <p>This gem uses the following regular expression:</p>
103
+
104
+ <pre class="ruby"><span class="ruby-comment"># US Phone Numbers</span>
105
+ <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>
106
+ <span class="ruby-comment"># Regex Flags: i (ignore case)</span>
107
+ </pre>
108
+
109
+ <h2 id="label-Installing">Installing<span><a href="#label-Installing">&para;</a> <a href="#top">&uarr;</a></span></h2>
110
+
111
+ <pre>$ gem install phone_number_validator</pre>
112
+
113
+ <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>
114
+
115
+ <pre>$ bundle install</pre>
116
+
117
+ <h3 id="label-Updateing+Required+Gems-2FDependencies">Updateing Required Gems/Dependencies<span><a href="#label-Updateing+Required+Gems-2FDependencies">&para;</a> <a href="#top">&uarr;</a></span></h3>
118
+
119
+ <pre>$ bundle update</pre>
120
+
121
+ <h2 id="label-Uninstalling">Uninstalling<span><a href="#label-Uninstalling">&para;</a> <a href="#top">&uarr;</a></span></h2>
122
+
123
+ <pre>$ gem uninstall phone_number_validator</pre>
124
+
125
+ <h2 id="label-Testing">Testing<span><a href="#label-Testing">&para;</a> <a href="#top">&uarr;</a></span></h2>
126
+
127
+ <pre>$ rake test</pre>
128
+
129
+ <h2 id="label-Usage">Usage<span><a href="#label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>
130
+
131
+ <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>
132
+
133
+ <pre>$ pnv &quot;+1 (949) 355-6244 ext. 198842&quot;
134
+ =&gt; &quot;+1 (949) 355-6244 ext. 198842&quot; is a valid phone number.
135
+ =&gt; true</pre>
136
+
137
+ <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>
138
+
139
+ <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;phone_number_validator&#39;</span>
140
+
141
+ <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 (949) 355-6244 ext. 198842&#39;</span>)
142
+
143
+ <span class="ruby-identifier">print</span> <span class="ruby-identifier">check_phone_number</span>
144
+ </pre>
145
+
146
+ <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
147
+
148
+ <pre>=&gt; &quot;+1 (949) 355-6244 ext. 198842&quot; is a valid phone number.
149
+ =&gt; true</pre>
150
+ </main>
151
+
152
+
153
+
154
+ <footer id="validator-badges" role="contentinfo">
155
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
156
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.4.
157
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
158
+ </footer>
159
+
data/doc/created.rid CHANGED
@@ -1,6 +1,6 @@
1
- Mon, 19 Nov 2018 16:02:02 -0800
2
- README.rdoc Mon, 19 Nov 2018 15:05:00 -0800
3
- lib/phone_number_validator.rb Sun, 11 Nov 2018 18:51:34 -0800
4
- lib/phone_number_validator/validator.rb Mon, 19 Nov 2018 14:42:50 -0800
5
- test/test_phone_number_validator.rb Mon, 19 Nov 2018 15:05:39 -0800
6
- bin/pnv Mon, 19 Nov 2018 15:05:12 -0800
1
+ Thu, 22 Nov 2018 15:52:52 -0800
2
+ README.rdoc Thu, 22 Nov 2018 15:39:38 -0800
3
+ lib/phone_number_validator.rb Thu, 22 Nov 2018 15:39:38 -0800
4
+ lib/phone_number_validator/validator.rb Thu, 22 Nov 2018 15:39:38 -0800
5
+ test/test_phone_number_validator.rb Thu, 22 Nov 2018 15:39:38 -0800
6
+ bin/pnv Thu, 22 Nov 2018 15:52:23 -0800
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,153 +1,154 @@
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-Updateing+Required+Gems-2FDependencies">Updateing Required Gems/Dependencies<span><a href="#label-Updateing+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 (949) 355-6244 ext. 198842&quot;
128
- =&gt; &quot;+1 (949) 355-6244 ext. 198842&quot; is a valid phone number.
129
- =&gt; true</pre>
130
-
131
- <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>
132
-
133
- <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;phone_number_validator&#39;</span>
134
-
135
- <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 (949) 355-6244 ext. 198842&#39;</span>)
136
-
137
- <span class="ruby-identifier">print</span> <span class="ruby-identifier">check_phone_number</span>
138
- </pre>
139
-
140
- <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
141
-
142
- <pre>=&gt; &quot;+1 (949) 355-6244 ext. 198842&quot; is a valid phone number.
143
- =&gt; true</pre>
144
- </main>
145
-
146
-
147
-
148
- <footer id="validator-badges" role="contentinfo">
149
- <p><a href="http://validator.w3.org/check/referer">Validate</a>
150
- <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
151
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
152
- </footer>
153
-
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
+ <body id="top" role="document" class="file">
23
+ <nav role="navigation">
24
+ <div id="project-navigation">
25
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
26
+ <h2>
27
+ <a href="./index.html" rel="home">Home</a>
28
+ </h2>
29
+
30
+ <div id="table-of-contents-navigation">
31
+ <a href="./table_of_contents.html#pages">Pages</a>
32
+ <a href="./table_of_contents.html#classes">Classes</a>
33
+ <a href="./table_of_contents.html#methods">Methods</a>
34
+ </div>
35
+ </div>
36
+
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
+ <div id="project-metadata">
56
+ <div id="fileindex-section" class="nav-section">
57
+ <h3>Pages</h3>
58
+
59
+ <ul class="link-list">
60
+
61
+ <li><a href="./README_rdoc.html">README</a>
62
+
63
+ </ul>
64
+ </div>
65
+
66
+ <div id="classindex-section" class="nav-section">
67
+ <h3>Class and Module Index</h3>
68
+
69
+ <ul class="link-list">
70
+
71
+ <li><a href="./PhoneNumberValidator.html">PhoneNumberValidator</a>
72
+
73
+ <li><a href="./PhoneNumberValidator/Validator.html">PhoneNumberValidator::Validator</a>
74
+
75
+ <li><a href="./PhoneNumberValidatorTest.html">PhoneNumberValidatorTest</a>
76
+
77
+ </ul>
78
+ </div>
79
+
80
+ </div>
81
+ </nav>
82
+
83
+ <main role="main">
84
+
85
+
86
+ <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>
87
+
88
+ <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
89
+
90
+ <p>This app is a US phone number-validating RubyGem.</p>
91
+
92
+ <p>It uses a complex regular expression to validate any United States phone
93
+ 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-Updateing+Required+Gems-2FDependencies">Updateing Required Gems/Dependencies<span><a href="#label-Updateing+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 (949) 355-6244 ext. 198842&quot;
129
+ =&gt; &quot;+1 (949) 355-6244 ext. 198842&quot; is a valid phone number.
130
+ =&gt; true</pre>
131
+
132
+ <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>
133
+
134
+ <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;phone_number_validator&#39;</span>
135
+
136
+ <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 (949) 355-6244 ext. 198842&#39;</span>)
137
+
138
+ <span class="ruby-identifier">print</span> <span class="ruby-identifier">check_phone_number</span>
139
+ </pre>
140
+
141
+ <h4 id="label-Output">Output<span><a href="#label-Output">&para;</a> <a href="#top">&uarr;</a></span></h4>
142
+
143
+ <pre>=&gt; &quot;+1 (949) 355-6244 ext. 198842&quot; is a valid phone number.
144
+ =&gt; true</pre>
145
+ </main>
146
+
147
+
148
+
149
+ <footer id="validator-badges" role="contentinfo">
150
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
151
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.4.
152
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
153
+ </footer>
154
+