area 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,7 +49,8 @@ class String
49
49
 
50
50
  def to_gmt_offset
51
51
  Area::ZIP_CODES.each do |row|
52
- @offset = row[5] if row[2] != nil and row[2].upcase == self.to_s.upcase
52
+ @offset = row[5] if row[2] != nil and
53
+ (row[2].upcase == self.to_s.upcase or row[0] == self.to_s)
53
54
  end
54
55
  @offset || nil
55
56
  end
@@ -1,3 +1,3 @@
1
1
  module Area
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
@@ -20,10 +20,14 @@ class TestInteger < MiniTest::Unit::TestCase
20
20
  assert_equal "-73.95427", 11211.to_lon
21
21
  end
22
22
 
23
- def test_that_it_converts_zip_code_to_gmt_offset
23
+ def test_that_it_converts_zip_code_int_to_gmt_offset
24
24
  assert_equal "-5", 11211.to_gmt_offset
25
25
  end
26
26
 
27
+ def test_that_it_converts_zip_code_string_to_gmt_offset
28
+ assert_equal "-5", "11211".to_gmt_offset
29
+ end
30
+
27
31
  def test_that_it_handles_bad_area_codes
28
32
  assert_nil(1234.to_region)
29
33
  assert_nil(1234.to_latlon)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: area
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-15 00:00:00.000000000 Z
12
+ date: 2013-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fastercsv
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project: area
120
- rubygems_version: 1.8.24
120
+ rubygems_version: 1.8.23
121
121
  signing_key:
122
122
  specification_version: 3
123
123
  summary: Convert a region to area code and vice versa.