phone_number_validator 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec0f6682110705b7bbb4a74b76084d79220cc6f3
4
- data.tar.gz: b26d85196e15e9b6abbf4f1491dd817e5630956e
3
+ metadata.gz: 43bb85d97bb85a3d5f945e138068a42685b39950
4
+ data.tar.gz: 57f8fbe00b7139f51b38d87e7f207dbb416e3140
5
5
  SHA512:
6
- metadata.gz: bf727fc8a574b7cfe8a901e7df8b6be37074721da19570a295b509be91701fb1f1f5f59ebc2527b0f29f4da71aa05004f5350e4c83ea8d2dc11c2278eaef4c74
7
- data.tar.gz: 43f8e32543b9bd4a98d15934f54f7163446bcd4e3a490abfc61014149b192097c7b2082c595a9d044684ab01b1a5f977114d5af43718306e8e96773555c74e0d
6
+ metadata.gz: f9e54f3aecff8ca4dcb69103389948f194a3758412d82f9ab568829a757bfea1d1641766b49b8bc877bc37a5379064338cf30e688cb956aa0238f46f3001cc77
7
+ data.tar.gz: e2ebab67b1a7764680eb55b0851ff18b54cee0219477e7729d93a852d34f3187deea6b976f7e0bc3bf81544088684b74dc683e8639320e7723249243ec23bf48
data/README.rdoc CHANGED
@@ -56,11 +56,17 @@ This gem uses the following regular expression:
56
56
 
57
57
  => true
58
58
 
59
- Output can be <b>true</b> (<em>boolean, valid phone number</em>), <b>false</b> (<em>boolean, invalid phone number</em>), or <b>nil</b> (<em>symbol, no phone number entered</em>).
59
+ === Output Types
60
+
61
+ Output can be:
62
+ * <b>true</b> (<em>boolean: valid phone number</em>)
63
+ * <b>false</b> (<em>boolean: invalid phone number</em>)
64
+ * <b>nil</b> (<em>nil: no phone number entered</em>)
65
+ * <b>void</b> (<em>void: no phone number arg provided</em>)
60
66
 
61
67
  == Development
62
68
 
63
- Run the following to make +bin/pnv+ executable (Unix only):
69
+ Run the following in development to make +bin/pnv+ executable (Unix only):
64
70
 
65
71
  chmod ugo+x bin/pnv
66
72
 
@@ -199,7 +199,7 @@ regex the pattern with the phone number</p>
199
199
  <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@phone_number</span>.<span class="ruby-identifier">match</span>(<span class="ruby-constant">PHONE_NUMBER_REGEX</span>))
200
200
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
201
201
  <span class="ruby-keyword">elsif</span> (<span class="ruby-ivar">@phone_number</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;&#39;</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@phone_number</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>)
202
- <span class="ruby-keyword">return</span> <span class="ruby-value">:nil</span>
202
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
203
203
  <span class="ruby-keyword">else</span>
204
204
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span>
205
205
  <span class="ruby-keyword">end</span>
@@ -174,7 +174,7 @@
174
174
  <div class="method-source-code" id="test_no_phone_number-source">
175
175
  <pre><span class="ruby-comment"># File test/test_phone_number_validator.rb, line 27</span>
176
176
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">test_no_phone_number</span>
177
- <span class="ruby-identifier">assert_equal</span> <span class="ruby-value">:nil</span>,
177
+ <span class="ruby-identifier">assert_equal</span> <span class="ruby-keyword">nil</span>,
178
178
  <span class="ruby-constant">PhoneNumberValidator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-string">&#39;&#39;</span>)
179
179
  <span class="ruby-keyword">end</span></pre>
180
180
  </div>
data/doc/README_rdoc.html CHANGED
@@ -150,13 +150,21 @@ number.</p>
150
150
 
151
151
  <pre>=&gt; true</pre>
152
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>
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>
156
163
 
157
164
  <h2 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#top">&uarr;</a></span></h2>
158
165
 
159
- <p>Run the following to make <code>bin/pnv</code> executable (Unix only):</p>
166
+ <p>Run the following in development to make <code>bin/pnv</code> executable
167
+ (Unix only):</p>
160
168
 
161
169
  <pre>chmod ugo+x bin/pnv</pre>
162
170
  </main>
data/doc/created.rid CHANGED
@@ -1,6 +1,6 @@
1
- Wed, 07 Aug 2019 08:34:48 -0700
2
- README.rdoc Wed, 07 Aug 2019 08:29:12 -0700
1
+ Wed, 07 Aug 2019 08:46:20 -0700
2
+ README.rdoc Wed, 07 Aug 2019 08:45:50 -0700
3
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
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
6
  bin/pnv Wed, 07 Aug 2019 08:29:12 -0700
data/doc/index.html CHANGED
@@ -143,13 +143,21 @@ number.</p>
143
143
 
144
144
  <pre>=&gt; true</pre>
145
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>
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>
149
156
 
150
157
  <h2 id="label-Development">Development<span><a href="#label-Development">&para;</a> <a href="#top">&uarr;</a></span></h2>
151
158
 
152
- <p>Run the following to make <code>bin/pnv</code> executable (Unix only):</p>
159
+ <p>Run the following in development to make <code>bin/pnv</code> executable
160
+ (Unix only):</p>
153
161
 
154
162
  <pre>chmod ugo+x bin/pnv</pre>
155
163
  </main>
Binary file
Binary file
Binary file
@@ -25,7 +25,7 @@ class PhoneNumberValidator::Validator
25
25
  if (@phone_number.match(PHONE_NUMBER_REGEX))
26
26
  return true
27
27
  elsif (@phone_number == '' || @phone_number == nil)
28
- return :nil
28
+ return nil
29
29
  else
30
30
  return false
31
31
  end
@@ -1,12 +1,12 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'phone_number_validator'
3
- spec.version = '0.9.3'
3
+ spec.version = '0.9.4'
4
4
  spec.date = Time.now.strftime("%Y-%m-%d")
5
5
  spec.summary = 'Validate any US phone number!'
6
6
  spec.description = <<-EOF
7
7
  This gem is a United States phone number validator.
8
8
  This gem uses a complex regular expression that can validate any United States phone number.
9
- Check out the documentation under the links section.
9
+ Check out the documentation under the links section to see how to use this gem.
10
10
  EOF
11
11
  spec.author = 'bag33188'
12
12
  spec.email = 'shuckle168@gmail.com'
@@ -25,7 +25,7 @@ class PhoneNumberValidatorTest < Test::Unit::TestCase
25
25
  ##
26
26
  # This test inputs no phone number and expects the output to be <b>nil</b>
27
27
  def test_no_phone_number
28
- assert_equal :nil,
28
+ assert_equal nil,
29
29
  PhoneNumberValidator.validate('')
30
30
  end
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phone_number_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - bag33188
@@ -72,7 +72,8 @@ dependencies:
72
72
  version: 6.0.4
73
73
  description: " This gem is a United States phone number validator.\n This gem
74
74
  uses a complex regular expression that can validate any United States phone number.
75
- \n Check out the documentation under the links section.\n"
75
+ \n Check out the documentation under the links section to see how to use this
76
+ gem.\n"
76
77
  email: shuckle168@gmail.com
77
78
  executables:
78
79
  - pnv