dialable 0.1.0 → 0.1.1
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/README.rdoc +40 -0
- data/dialable.gemspec +2 -3
- metadata +4 -5
- data/README +0 -33
data/README.rdoc
CHANGED
@@ -1,3 +1,43 @@
|
|
1
1
|
== dialable
|
2
2
|
|
3
3
|
A gem that provides parsing and output of phone numbers according to NANPA standards.
|
4
|
+
|
5
|
+
|
6
|
+
Phone numbers are not a big deal if you can validate the input at the
|
7
|
+
time you've got a human right there. My enterprise tends not to have
|
8
|
+
that ability, as we receive large files from clients with little or no
|
9
|
+
validation done. Rather than abandon #s which don't validate, I wrote
|
10
|
+
this to parse and normalize a string into a standard NANP phone
|
11
|
+
number, possibly including an extension.
|
12
|
+
|
13
|
+
References: NANPA: North American Numbering Plan Administration http://nanpa.com/
|
14
|
+
|
15
|
+
The YAML file with the valid area codes and easily recognizable codes
|
16
|
+
(like 911) can get out of date. To update your own copy, run:
|
17
|
+
|
18
|
+
support/make_yaml_nanpa.rb > support/nanpa.yaml
|
19
|
+
|
20
|
+
|
21
|
+
require "dialable"
|
22
|
+
|
23
|
+
pn = Dialable::NANP.parse("+1(800)555-1212 ext 1234")
|
24
|
+
|
25
|
+
>> puts pn.to_s // Pretty output
|
26
|
+
|
27
|
+
800-555-1212 x1234
|
28
|
+
|
29
|
+
>> puts pn.to_digits // Address book friendly
|
30
|
+
|
31
|
+
8005551212 x1234
|
32
|
+
|
33
|
+
>> puts pn.to_dialable // PBX friendly
|
34
|
+
|
35
|
+
8005551212
|
36
|
+
|
37
|
+
>> puts pn.extension
|
38
|
+
|
39
|
+
1234
|
40
|
+
|
41
|
+
Also, pn.timezones and pn.relative_timezones should do the right thing.
|
42
|
+
|
43
|
+
-chorn
|
data/dialable.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "dialable"
|
3
|
-
s.version = "0.1.
|
4
|
-
s.date = "2010-06-
|
3
|
+
s.version = "0.1.1"
|
4
|
+
s.date = "2010-06-28"
|
5
5
|
s.summary = "Provides parsing and output of phone numbers according to NANPA standards."
|
6
6
|
s.email = "chorn@chorn.com"
|
7
7
|
s.homepage = "http://github.com/chorn/dialable"
|
@@ -9,7 +9,6 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.has_rdoc = true
|
10
10
|
s.authors = ["Chris Horn"]
|
11
11
|
s.files = [ "LICENSE",
|
12
|
-
"README",
|
13
12
|
"README.rdoc",
|
14
13
|
"Rakefile",
|
15
14
|
"TODO",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dialable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Horn
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-28 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -29,7 +29,6 @@ extra_rdoc_files: []
|
|
29
29
|
|
30
30
|
files:
|
31
31
|
- LICENSE
|
32
|
-
- README
|
33
32
|
- README.rdoc
|
34
33
|
- Rakefile
|
35
34
|
- TODO
|
data/README
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
|
2
|
-
Phone numbers are not a big deal if you can validate the input at the
|
3
|
-
time you've got a human right there. My enterprise tends not to have
|
4
|
-
that ability, as we receive large files from clients with little or no
|
5
|
-
validation done. Rather than abandon #s which don't validate, I wrote
|
6
|
-
this to parse and normalize a string into a standard NANP phone
|
7
|
-
number, possibly including an extension.
|
8
|
-
|
9
|
-
References: NANPA: North American Numbering Plan Administration http://nanpa.com/
|
10
|
-
|
11
|
-
The YAML file with the valid area codes and easily recognizable codes
|
12
|
-
(like 911) can get out of date. To update your own copy, run:
|
13
|
-
|
14
|
-
support/make_yaml_nanpa.rb > support/nanpa.yaml
|
15
|
-
|
16
|
-
|
17
|
-
require "dialable"
|
18
|
-
pn = Dialable::NANP.parse("+1(800)555-1212 ext 1234")
|
19
|
-
|
20
|
-
>> puts pn.to_s // Pretty output
|
21
|
-
800-555-1212 x1234
|
22
|
-
|
23
|
-
>> puts pn.to_digits // Address book friendly
|
24
|
-
8005551212 x1234
|
25
|
-
|
26
|
-
>> puts pn.to_dialable // PBX friendly
|
27
|
-
8005551212
|
28
|
-
|
29
|
-
>> puts pn.extension
|
30
|
-
1234
|
31
|
-
|
32
|
-
|
33
|
-
-chorn
|