ziptz 1.0.14 → 1.0.15

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
  SHA1:
3
- metadata.gz: 6d70eb7eea01881b7f53afcd20085fa54b6c92b5
4
- data.tar.gz: 07c0085550da68b8c8802ca8c8dba65059cd21ac
3
+ metadata.gz: b3fa9b875c15fee2f7f54c3f69af266edd06af60
4
+ data.tar.gz: 76fe3133ed6f88e9c5f66ff5bf5d490beceda56e
5
5
  SHA512:
6
- metadata.gz: 9b295cc9fa48a09222f7a68d84ad5713d2864ecb2bfd8fb5366c84c2d773d88b4806ef9840d37e62626e3dad837bfad0f7e4943ec905d057b69383290f61e619
7
- data.tar.gz: d4a2984d9270574e93326d3db7c156e7c63cd4f1b541b734d2ccf91c88c3063650b490c0aee2695b787611b8f82d02ca5dc11eb51a1e124af80213d44bd64848
6
+ metadata.gz: 7dd1dafd4ab90d8fee928b7018b47a887380ebccbc0a467c46cd11b5d96cb01def9624eda352eb6256f06d54f0cc15e3f2550860bf5241d2e80ec29319a8a8e8
7
+ data.tar.gz: 5cc56ca6ae8d23bf5d4b57de248972c53370c493e742c0567d9f5a3ae87cfcc6dab463a593555f36d9c0dd8dc50fdb771019b63a1c4bfe6243ae50498c90f02b
data/Gemfile CHANGED
@@ -2,6 +2,7 @@ gemspec
2
2
  source 'https://rubygems.org'
3
3
 
4
4
  group :development, :test do
5
+ gem 'rake'
5
6
  gem 'activerecord'
6
7
  gem 'mysql2'
7
8
  gem 'rspec'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ziptz (1.0.13)
4
+ ziptz (1.0.14)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -56,6 +56,7 @@ GEM
56
56
  coderay (~> 1.1.0)
57
57
  method_source (~> 0.8.1)
58
58
  slop (~> 3.4)
59
+ rake (10.4.2)
59
60
  rb-fsevent (0.9.5)
60
61
  rb-inotify (0.9.5)
61
62
  ffi (>= 0.5.0)
@@ -87,8 +88,9 @@ DEPENDENCIES
87
88
  guard
88
89
  guard-rspec
89
90
  mysql2
91
+ rake
90
92
  rspec
91
93
  ziptz!
92
94
 
93
95
  BUNDLED WITH
94
- 1.10.6
96
+ 1.12.5
data/Guardfile ADDED
@@ -0,0 +1,8 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :rspec do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { 'spec' }
8
+ end
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Get the time zone for any US ZIP code.
8
8
 
9
- <i>ZIP codes are up to date as of <b>June 2016</b>.</i>
9
+ <i>ZIP codes are up to date as of <b>July 2016</b>.</i>
10
10
 
11
11
  ## Installation
12
12
 
data/data/ziptz.data CHANGED
@@ -14736,6 +14736,7 @@
14736
14736
  34241=5
14737
14737
  34242=5
14738
14738
  34243=5
14739
+ 34249=5
14739
14740
  34250=5
14740
14741
  34251=5
14741
14742
  34260=5
data/lib/ziptz.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'yaml'
2
2
 
3
3
  class Ziptz
4
+ VERSION = '1.0.15'
5
+
4
6
  TZ_INFO = {
5
7
  '0' => {name: 'APO/FPO (time zone unknown)', offset: 0},
6
8
  '4' => {name: 'Atlantic', offset: -4},
@@ -22,12 +24,12 @@ class Ziptz
22
24
  end
23
25
 
24
26
  def time_zone_name(zip)
25
- hash = time_zone_hash(zip)
27
+ hash = time_zone_info(zip)
26
28
  hash && hash[:name]
27
29
  end
28
30
 
29
31
  def time_zone_offset(zip)
30
- tz = time_zone_hash(zip)
32
+ tz = time_zone_info(zip)
31
33
  tz && tz[:offset]
32
34
  end
33
35
 
@@ -42,15 +44,18 @@ class Ziptz
42
44
  @zips.select { |_, v| v == tz_code.to_s }.keys.sort
43
45
  end
44
46
 
45
- def time_zone_hash(zip)
46
- key = @zips[zip.to_s]
47
- TZ_INFO[key]
47
+ def time_zone_info(zip)
48
+ TZ_INFO[get_time_zone zip]
49
+ end
50
+
51
+ def get_time_zone(zip)
52
+ @zips[zip.to_s]
48
53
  end
49
54
 
50
55
  def tz_name_to_code
51
56
  @tz_name_to_code ||= TZ_INFO.each_with_object({}) do |(code, tz), data|
52
- key = tz[:name].downcase
53
- data[key] = code
57
+ name = tz[:name].downcase
58
+ data[name] = code
54
59
  end
55
60
  end
56
61
 
data/ziptz.gemspec CHANGED
@@ -1,10 +1,8 @@
1
- lib = File.expand_path('../lib/', __FILE__)
2
- $:.unshift lib unless $:.include?(lib)
3
- require 'ziptz/version'
1
+ require File.expand_path('lib/ziptz')
4
2
 
5
3
  Gem::Specification.new do |s|
6
4
  s.name = 'ziptz'
7
- s.version = ZipTZ::VERSION
5
+ s.version = Ziptz::VERSION
8
6
  s.platform = Gem::Platform::RUBY
9
7
  s.authors = ['Keith Morrison']
10
8
  s.email = 'keithm@infused.org'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ziptz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-02 00:00:00.000000000 Z
11
+ date: 2016-07-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Get timezone info for all 5-digit US zip codes
14
14
  email: keithm@infused.org
@@ -21,13 +21,12 @@ files:
21
21
  - Gemfile
22
22
  - Gemfile.lock
23
23
  - Gemfile.travis
24
+ - Guardfile
24
25
  - LICENSE
25
26
  - README.md
26
27
  - Rakefile
27
28
  - data/ziptz.data
28
- - database.yml
29
29
  - lib/ziptz.rb
30
- - lib/ziptz/version.rb
31
30
  - spec/spec_helper.rb
32
31
  - spec/ziptz_spec.rb
33
32
  - ziptz.gemspec
@@ -52,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
51
  version: '0'
53
52
  requirements: []
54
53
  rubyforge_project:
55
- rubygems_version: 2.4.8
54
+ rubygems_version: 2.5.1
56
55
  signing_key:
57
56
  specification_version: 4
58
57
  summary: TimeZone for any 5-digit US zip code
data/database.yml DELETED
@@ -1,3 +0,0 @@
1
- adapter: mysql2
2
- username: root
3
- database: zip_codes
data/lib/ziptz/version.rb DELETED
@@ -1,3 +0,0 @@
1
- module ZipTZ
2
- VERSION = '1.0.14'
3
- end