zip-codes 0.2.1 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +146 -0
- data/Gemfile +2 -1
- data/Gemfile.lock +32 -4
- data/README.md +4 -0
- data/Rakefile +6 -6
- data/lib/data/US.yml +1263 -172
- data/lib/zip-codes.rb +6 -5
- data/zip-codes.gemspec +17 -14
- metadata +27 -13
data/lib/zip-codes.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'yaml'
|
2
4
|
|
3
5
|
module ZipCodes
|
4
|
-
VERSION = '0.
|
6
|
+
VERSION = '0.3.1'
|
5
7
|
|
6
8
|
class << self
|
7
|
-
def identify
|
9
|
+
def identify(code)
|
8
10
|
db[code]
|
9
11
|
end
|
10
12
|
|
11
13
|
def db
|
12
14
|
@db ||= begin
|
13
|
-
|
14
|
-
|
15
|
-
YAML.load(File.open(us_data))
|
15
|
+
path = File.join(__dir__, 'data', 'US.yml')
|
16
|
+
::YAML.safe_load_file(path, permitted_classes: [Symbol])
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
data/zip-codes.gemspec
CHANGED
@@ -1,23 +1,26 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'zip-codes'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
8
|
+
spec.name = 'zip-codes'
|
8
9
|
spec.version = ZipCodes::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.description = %
|
12
|
-
spec.summary = %
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
10
|
+
spec.authors = ['Michał Duda']
|
11
|
+
spec.email = ['michal.duda@monterail.com']
|
12
|
+
spec.description = %s(Simple gem to get city, state, and time zone for a given zip code)
|
13
|
+
spec.summary = %s(Gem to identify zip codes inside US)
|
14
|
+
spec.homepage = 'https://github.com/monterail/zip-codes'
|
15
|
+
spec.license = 'MIT'
|
15
16
|
|
16
|
-
spec.files = `git ls-files`.split(
|
17
|
+
spec.files = `git ls-files`.split($RS)
|
17
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.
|
19
|
-
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.required_ruby_version = '>= 3.0.0'
|
20
22
|
|
21
|
-
spec.add_development_dependency
|
22
|
-
spec.add_development_dependency
|
23
|
+
spec.add_development_dependency 'rake', '~> 13.0.0'
|
24
|
+
spec.add_development_dependency 'rubocop', '~> 1.39.0'
|
25
|
+
spec.add_development_dependency 'rubocop-rake', '~> 0.6.0'
|
23
26
|
end
|
metadata
CHANGED
@@ -1,43 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zip-codes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Duda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 13.0.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 13.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rubocop
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.39.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.39.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop-rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- - "
|
45
|
+
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
47
|
+
version: 0.6.0
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- - "
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
54
|
+
version: 0.6.0
|
41
55
|
description: Simple gem to get city, state, and time zone for a given zip code
|
42
56
|
email:
|
43
57
|
- michal.duda@monterail.com
|
@@ -46,6 +60,7 @@ extensions: []
|
|
46
60
|
extra_rdoc_files: []
|
47
61
|
files:
|
48
62
|
- ".gitignore"
|
63
|
+
- ".rubocop.yml"
|
49
64
|
- Gemfile
|
50
65
|
- Gemfile.lock
|
51
66
|
- LICENSE.txt
|
@@ -66,15 +81,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
81
|
requirements:
|
67
82
|
- - ">="
|
68
83
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
84
|
+
version: 3.0.0
|
70
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
86
|
requirements:
|
72
87
|
- - ">="
|
73
88
|
- !ruby/object:Gem::Version
|
74
89
|
version: '0'
|
75
90
|
requirements: []
|
76
|
-
|
77
|
-
rubygems_version: 2.2.2
|
91
|
+
rubygems_version: 3.0.3.1
|
78
92
|
signing_key:
|
79
93
|
specification_version: 4
|
80
94
|
summary: Gem to identify zip codes inside US
|