StreetAddress 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/History.txt +4 -0
  2. data/Rakefile +2 -0
  3. data/lib/street_address.rb +5 -5
  4. metadata +52 -45
@@ -1,3 +1,7 @@
1
+ == 1.0.1 / 2008-02-29
2
+
3
+ * BUG FIX: Parse two word states correctly
4
+
1
5
  == 1.0.0 / 2007-06-28
2
6
 
3
7
  * Initial Version
data/Rakefile CHANGED
@@ -15,6 +15,8 @@ For more information see
15
15
  http://search.cpan.org/~sderle/Geo-StreetAddress-US-0.99/"
16
16
  p.url = "http://streetaddress.rubyforge.org"
17
17
  p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
18
+ p.author = "Derrek Long"
19
+ p.email = "derrek.long@gmail.com"
18
20
  end
19
21
 
20
22
  # vim: syntax=Ruby
@@ -63,7 +63,7 @@
63
63
  =end
64
64
 
65
65
  module StreetAddress
66
- VERSION = '1.0.0'
66
+ VERSION = '1.0.1'
67
67
  class US
68
68
  @@directional = {
69
69
  "north" => "N",
@@ -570,7 +570,7 @@ module StreetAddress
570
570
  @@street_type_regexp = @@street_type_list.keys.join("|")
571
571
  @@number_regexp = '\d+-?\d*'
572
572
  @@fraction_regexp = '\d+\/\d+'
573
- @@state_regexp = @@state_code.to_a.join("|")
573
+ @@state_regexp = @@state_code.to_a.join("|").gsub(/ /, "\\s")
574
574
  @@direct_regexp = @@directional.keys.join("|") + "|" + @@directional.values.sort{|a,b| b.length <=> a.length }.map{|x| f = x.gsub(/(\w)/, '\1.'); [Regexp::quote(f), Regexp::quote(x)] }.join("|")
575
575
  @@zip_regexp = '(\d{5})(?:-(\d{4}))?'
576
576
  @@corner_regexp = '(?:\band\b|\bat\b|&|\@)'
@@ -761,7 +761,7 @@ module StreetAddress
761
761
  args.keys.each { |attrib| self.send("#{attrib}=", args[attrib]) }
762
762
  end
763
763
 
764
- def fip
764
+ def state_fips
765
765
  StreetAddress::US::fips_state[@state]
766
766
  end
767
767
 
@@ -791,13 +791,13 @@ module StreetAddress
791
791
  s += " " + postal_code unless postal_code.nil?
792
792
  else
793
793
  s += number
794
- s += " " + prefix unless prefex.nil?
794
+ s += " " + prefix unless prefix.nil?
795
795
  s += " " + street unless street.nil?
796
796
  s += " " + street_type unless street_type.nil?
797
797
  if( !unit_prefix.nil? && !unit.nil? )
798
798
  s += " " + unit_prefix
799
799
  s += " " + unit
800
- elsif( unit_prefix.nil? && !unil.nil? )
800
+ elsif( unit_prefix.nil? && !unit.nil? )
801
801
  s += " #" + unit
802
802
  end
803
803
  s += " " + suffix unless suffix.nil?
metadata CHANGED
@@ -1,33 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
3
- specification_version: 1
4
2
  name: StreetAddress
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
7
- date: 2007-07-02 00:00:00 -04:00
8
- summary: Ruby port of the perl module Geo::StreetAddress::US to parse one line street addresses
9
- require_paths:
10
- - lib
11
- email: ryand-ruby@zenspider.com
12
- homepage: http://streetaddress.rubyforge.org
13
- rubyforge_project: streetaddress
14
- description: Parses one line addresses and returns a normalized address object. This is a near direct port of the of the perl module Geo::StreetAddress::US originally written by Schuyler D. Erle. For more information see http://search.cpan.org/~sderle/Geo-StreetAddress-US-0.99/
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 1.0.1
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
- - Ryan Davis
7
+ - Derrek Long
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-02-29 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hoe
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.5.0
23
+ version:
24
+ description: Parses one line addresses and returns a normalized address object. This is a near direct port of the of the perl module Geo::StreetAddress::US originally written by Schuyler D. Erle. For more information see http://search.cpan.org/~sderle/Geo-StreetAddress-US-0.99/
25
+ email: derrek.long@gmail.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - History.txt
32
+ - Manifest.txt
33
+ - README.txt
31
34
  files:
32
35
  - History.txt
33
36
  - Manifest.txt
@@ -35,28 +38,32 @@ files:
35
38
  - Rakefile
36
39
  - lib/street_address.rb
37
40
  - test/test_street_address.rb
38
- test_files:
39
- - test/test_street_address.rb
41
+ has_rdoc: true
42
+ homepage: http://streetaddress.rubyforge.org
43
+ post_install_message:
40
44
  rdoc_options:
41
45
  - --main
42
46
  - README.txt
43
- extra_rdoc_files:
44
- - History.txt
45
- - Manifest.txt
46
- - README.txt
47
- executables: []
48
-
49
- extensions: []
50
-
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "0"
60
+ version:
51
61
  requirements: []
52
62
 
53
- dependencies:
54
- - !ruby/object:Gem::Dependency
55
- name: hoe
56
- version_requirement:
57
- version_requirements: !ruby/object:Gem::Version::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: 1.2.1
62
- version:
63
+ rubyforge_project: streetaddress
64
+ rubygems_version: 1.0.1
65
+ signing_key:
66
+ specification_version: 2
67
+ summary: Ruby port of the perl module Geo::StreetAddress::US to parse one line street addresses
68
+ test_files:
69
+ - test/test_street_address.rb