zip-codes 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/zip-codes.rb ADDED
@@ -0,0 +1,21 @@
1
+ require 'yaml'
2
+
3
+ module ZipCodes
4
+ class << self
5
+ def identify code
6
+ db[code]
7
+ end
8
+
9
+ def db
10
+ @db ||= begin
11
+ spec = Gem::Specification.find_by_name("zip-codes")
12
+ us = spec.gem_dir + "/lib/data/US.yml"
13
+ YAML.load(File.open(us))
14
+ end
15
+ end
16
+
17
+ def load
18
+ db
19
+ end
20
+ end
21
+ end
data/zip-codes.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'grape/kaminari/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "zip-codes"
8
+ spec.version = "0.1.0"
9
+ spec.authors = ["Michał Duda"]
10
+ spec.email = ["michal.duda@monterail.com"]
11
+ spec.description = %q{Identify city and state for given zip code}
12
+ spec.summary = %q{Gem to identify zip codes inside US}
13
+ spec.homepage = "https://github.com/monterail/zip-codes"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: zip-codes
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Michał Duda
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-12-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Identify city and state for given zip code
42
+ email:
43
+ - michal.duda@monterail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - lib/data/US.yml
55
+ - lib/zip-codes.rb
56
+ - zip-codes.gemspec
57
+ homepage: https://github.com/monterail/zip-codes
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.0.3
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Gem to identify zip codes inside US
81
+ test_files: []
82
+ has_rdoc: