phone_number_validator 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b13b1206f90e4a52b66955dcc7aa8394ef764872a0c6ca12c048add243819e02
4
- data.tar.gz: 829eb0275403d2d4a53724a5093a2d520ae29ac6026588db9ae0774543c0964c
3
+ metadata.gz: da94fbd21b004350ad5f94b8501eafd22f78492c88bb1b144ea8bdaeb65ac81b
4
+ data.tar.gz: e74586f1da99cb56d833d24971f0a5bcd99fbaf8b77891a6d84c7b9e50b4573e
5
5
  SHA512:
6
- metadata.gz: 2170eeedec669451f2eedb9510d8440e54acacb1ea27da871eed877e001c3439d89223282b26ee9fdf51ca35692e71f81c40fa8acf07495e7027c071edc24789
7
- data.tar.gz: 7c237ad8be5781ea73d65bcbcff9b575ace6a2c0e6c2c5d86551934f1905f62853833cb04c647df75aa320cec4e37a3467d993c649dfb46455ca5b64c62407ab
6
+ metadata.gz: 89be10f7f8d20bcf0c00b61e6fef0c9ae24d194b301ff7df33ecba7930b1f6d8844415a81d6e976bb5e0ce341503825df5a23f68b60bd7aea892ca55251e2a2d
7
+ data.tar.gz: 89840ba9b87609e9ce84718044c18bc0b544e1f1fe5335b814654fa7fcdb76f39b87f88f1f5cd252296b8c84bdc23a98f959c186d20350c75dd45593fd7c854e
@@ -1,4 +1,4 @@
1
- Thu, 08 Aug 2019 15:46:44 -0700
1
+ Thu, 08 Aug 2019 15:51:57 -0700
2
2
  README.rdoc Thu, 08 Aug 2019 14:17:33 -0700
3
3
  lib/phone_number_validator.rb Thu, 08 Aug 2019 14:17:33 -0700
4
4
  lib/phone_number_validator/validator.rb Thu, 08 Aug 2019 15:00:41 -0700
Binary file
@@ -0,0 +1,52 @@
1
+ require 'phone_number_validator'
2
+
3
+ ##
4
+ # <b>For command line usage:</b>
5
+ #
6
+ # Checks to see if the phone number the user entered is valid
7
+ # by testing regex the pattern with the phone number
8
+ #
9
+ # <b>Return Type:</b> boolean or string
10
+ #
11
+ # === Examples
12
+ #
13
+ # ==== Ex. 1
14
+ #
15
+ # $ pnv "+1 (987) 654-3210 ext. 198842"
16
+ #
17
+ # ===== Output
18
+ #
19
+ # => true
20
+ #
21
+ # ==== Ex. 2
22
+ #
23
+ # pnv "+1 (987 778873-321a0 ext.ff99"
24
+ #
25
+ # ===== Output
26
+ #
27
+ # => false
28
+ #
29
+ # ==== Ex. 3
30
+ #
31
+ # pnv ""
32
+ #
33
+ # ===== Output
34
+ # => "No phone number entered."
35
+ #
36
+ # ==== Ex. 4
37
+ #
38
+ # pnv
39
+ #
40
+ # ===== Output
41
+ # => "No phone number entered."
42
+ def pnv
43
+ if (ARGV[0] == nil || ARGV[0] == '')
44
+ print "No phone number entered.\r\n"
45
+ else
46
+ # execute validator
47
+ puts PhoneNumberValidator.validate(ARGV[0])
48
+ end
49
+ end
50
+
51
+ # call pnv function
52
+ pnv()
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'phone_number_validator'
3
- spec.version = '1.0.1'
3
+ spec.version = '1.0.2'
4
4
  spec.date = Time.now.strftime("%Y-%m-%d")
5
5
  spec.summary = 'Validate any US phone number!'
6
6
  spec.description = <<-EOF
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phone_number_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - bag33188
@@ -99,6 +99,7 @@ files:
99
99
  - doc/table_of_contents.html
100
100
  - lib/phone_number_validator.rb
101
101
  - lib/phone_number_validator/validator.rb
102
+ - lib/pnv/pnv.rb
102
103
  - phone_number_validator.gemspec
103
104
  - test/test_phone_number_validator.rb
104
105
  homepage: https://github.com/bag33188/phone-number-validator