zip-codes 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
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.2.1'
6
+ VERSION = '0.3.0'
5
7
 
6
8
  class << self
7
- def identify code
9
+ def identify(code)
8
10
  db[code]
9
11
  end
10
12
 
11
13
  def db
12
14
  @db ||= begin
13
- this_file = File.expand_path(File.dirname(__FILE__))
14
- us_data = File.join(this_file, "data", "US.yml")
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
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
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 = "zip-codes"
8
+ spec.name = 'zip-codes'
8
9
  spec.version = ZipCodes::VERSION
9
- spec.authors = ["Michał Duda"]
10
- spec.email = ["michal.duda@monterail.com"]
11
- spec.description = %q{Simple gem to get city, state, and time zone for a 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"
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.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.required_ruby_version = '>= 3.0.0'
20
22
 
21
- spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
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.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Duda
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-25 00:00:00.000000000 Z
11
+ date: 2023-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
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: '1.3'
26
+ version: 13.0.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
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: '0'
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: '0'
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
@@ -58,7 +73,7 @@ homepage: https://github.com/monterail/zip-codes
58
73
  licenses:
59
74
  - MIT
60
75
  metadata: {}
61
- post_install_message:
76
+ post_install_message:
62
77
  rdoc_options: []
63
78
  require_paths:
64
79
  - lib
@@ -66,16 +81,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
66
81
  requirements:
67
82
  - - ">="
68
83
  - !ruby/object:Gem::Version
69
- version: '0'
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
- rubyforge_project:
77
- rubygems_version: 2.2.2
78
- signing_key:
91
+ rubygems_version: 3.2.22
92
+ signing_key:
79
93
  specification_version: 4
80
94
  summary: Gem to identify zip codes inside US
81
95
  test_files: []