people_places_things 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -1
- data/Rakefile +2 -0
- data/lib/people_places_things/phone_number.rb +1 -0
- data/lib/people_places_things/street_address.rb +1 -0
- data/lib/people_places_things/zip_code.rb +1 -0
- data/lib/people_places_things.rb +1 -1
- data/people_places_things.gemspec +7 -8
- data/spec/location_spec.rb +4 -0
- data/spec/person_name_spec.rb +4 -0
- data/spec/phone_number_spec.rb +4 -0
- data/spec/state_spec.rb +4 -0
- data/spec/street_address_spec.rb +4 -0
- data/spec/zip_code_spec.rb +4 -0
- metadata +3 -4
- data/VERSION +0 -1
data/README.textile
CHANGED
@@ -2,7 +2,7 @@ h1. PeoplePlacesThings
|
|
2
2
|
|
3
3
|
PeoplePlacesThings is a collection of ruby classes for parsing and formatting U.S person names, street addresses, phone numbers, and more.
|
4
4
|
|
5
|
-
<pre><code>gem install -s http://gemcutter.org people_places_things</code
|
5
|
+
<pre><code>gem install -s http://gemcutter.org people_places_things</code></pre>
|
6
6
|
|
7
7
|
h2. Using PeoplePlacesThings
|
8
8
|
|
data/Rakefile
CHANGED
@@ -16,8 +16,10 @@ task :default => [:specs]
|
|
16
16
|
|
17
17
|
begin
|
18
18
|
require 'jeweler'
|
19
|
+
require 'lib/people_places_things'
|
19
20
|
Jeweler::Tasks.new do |gemspec|
|
20
21
|
gemspec.name = "people_places_things"
|
22
|
+
gemspec.version = PeoplePlacesThings::VERSION
|
21
23
|
gemspec.summary = "Parsers and formatters for person names, street addresses, city/state/zip, phone numbers, etc."
|
22
24
|
gemspec.email = "dburkes@netable.com"
|
23
25
|
gemspec.homepage = "http://github.com/dburkes/people_places_things"
|
@@ -3,6 +3,7 @@ module PeoplePlacesThings
|
|
3
3
|
attr_accessor :country_code, :area_code, :number, :exchange, :suffix, :raw
|
4
4
|
|
5
5
|
def initialize(str)
|
6
|
+
self.raw = str
|
6
7
|
extract = str.strip.match(/^([-+()\d ]+)$/)[0].gsub(/[^\d]/, '') rescue nil
|
7
8
|
raise "Unsupported Format" if !extract || extract.length < 10 || extract.length > 11
|
8
9
|
|
@@ -3,6 +3,7 @@ module PeoplePlacesThings
|
|
3
3
|
attr_accessor :number, :pre_direction, :name, :suffix, :post_direction, :unit_type, :unit, :raw
|
4
4
|
|
5
5
|
def initialize(str)
|
6
|
+
self.raw = str
|
6
7
|
tokens = str.split(/[\s,]/).select {|s| !s.empty?}
|
7
8
|
|
8
9
|
# Check the first token for leading numericality. If so, set number to the first token, and delete it
|
data/lib/people_places_things.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{people_places_things}
|
8
|
-
s.version = "2.3.
|
8
|
+
s.version = "2.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Danny Burkes"]
|
12
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-11-30}
|
13
13
|
s.description = %q{Parsers and formatters for person names, street addresses, city/state/zip, phone numbers, etc.}
|
14
14
|
s.email = %q{dburkes@netable.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
|
|
19
19
|
".gitignore",
|
20
20
|
"README.textile",
|
21
21
|
"Rakefile",
|
22
|
-
"VERSION",
|
23
22
|
"lib/people_places_things.rb",
|
24
23
|
"lib/people_places_things/VERSION",
|
25
24
|
"lib/people_places_things/ansi_counties.rb",
|
@@ -42,11 +41,10 @@ Gem::Specification.new do |s|
|
|
42
41
|
"spec/street_address_spec.rb",
|
43
42
|
"spec/zip_code_spec.rb"
|
44
43
|
]
|
45
|
-
s.has_rdoc = true
|
46
44
|
s.homepage = %q{http://github.com/dburkes/people_places_things}
|
47
45
|
s.rdoc_options = ["--charset=UTF-8"]
|
48
46
|
s.require_paths = ["lib"]
|
49
|
-
s.rubygems_version = %q{1.3.
|
47
|
+
s.rubygems_version = %q{1.3.5}
|
50
48
|
s.summary = %q{Parsers and formatters for person names, street addresses, city/state/zip, phone numbers, etc.}
|
51
49
|
s.test_files = [
|
52
50
|
"spec/ansi_counties_spec.rb",
|
@@ -61,7 +59,7 @@ Gem::Specification.new do |s|
|
|
61
59
|
|
62
60
|
if s.respond_to? :specification_version then
|
63
61
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
64
|
-
s.specification_version =
|
62
|
+
s.specification_version = 3
|
65
63
|
|
66
64
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
67
65
|
else
|
@@ -69,3 +67,4 @@ Gem::Specification.new do |s|
|
|
69
67
|
else
|
70
68
|
end
|
71
69
|
end
|
70
|
+
|
data/spec/location_spec.rb
CHANGED
data/spec/person_name_spec.rb
CHANGED
data/spec/phone_number_spec.rb
CHANGED
@@ -56,4 +56,8 @@ describe PhoneNumber do
|
|
56
56
|
it "should throw exception on unsupported to_sformat" do
|
57
57
|
lambda { PhoneNumber.new('14045551212').to_s(:bogus) }.should raise_error
|
58
58
|
end
|
59
|
+
|
60
|
+
it "should save raw" do
|
61
|
+
PhoneNumber.new('14045551212').raw.should == '14045551212'
|
62
|
+
end
|
59
63
|
end
|
data/spec/state_spec.rb
CHANGED
data/spec/street_address_spec.rb
CHANGED
@@ -156,4 +156,8 @@ describe StreetAddress do
|
|
156
156
|
it "should support short form when none exists" do
|
157
157
|
StreetAddress.string_for(:oaks, :short).should == StreetAddress.string_for(:oaks, :long)
|
158
158
|
end
|
159
|
+
|
160
|
+
it "should save raw" do
|
161
|
+
StreetAddress.new('123 Main st.').raw.should == '123 Main st.'
|
162
|
+
end
|
159
163
|
end
|
data/spec/zip_code_spec.rb
CHANGED
@@ -24,4 +24,8 @@ describe ZipCode do
|
|
24
24
|
it "should throw exception on unsupported to_s format" do
|
25
25
|
lambda { ZipCode.new('30306-3522').to_s(:bogus) }.should raise_error
|
26
26
|
end
|
27
|
+
|
28
|
+
it "should save raw format" do
|
29
|
+
ZipCode.new('30306-3522').raw.should == '30306-3522'
|
30
|
+
end
|
27
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: people_places_things
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Burkes
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-11-30 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -25,7 +25,6 @@ files:
|
|
25
25
|
- .gitignore
|
26
26
|
- README.textile
|
27
27
|
- Rakefile
|
28
|
-
- VERSION
|
29
28
|
- lib/people_places_things.rb
|
30
29
|
- lib/people_places_things/VERSION
|
31
30
|
- lib/people_places_things/ansi_counties.rb
|
@@ -73,7 +72,7 @@ requirements: []
|
|
73
72
|
rubyforge_project:
|
74
73
|
rubygems_version: 1.3.5
|
75
74
|
signing_key:
|
76
|
-
specification_version:
|
75
|
+
specification_version: 3
|
77
76
|
summary: Parsers and formatters for person names, street addresses, city/state/zip, phone numbers, etc.
|
78
77
|
test_files:
|
79
78
|
- spec/ansi_counties_spec.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.3.0
|