free_zipcode_data 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +26 -22
- data/.ruby-version +1 -0
- data/CHANGELOG +4 -0
- data/Gemfile.lock +53 -48
- data/bin/free_zipcode_data +1 -0
- data/free_zipcode_data.gemspec +6 -9
- data/lib/free_zipcode_data/county_table.rb +1 -0
- data/lib/free_zipcode_data/data_source.rb +5 -5
- data/lib/free_zipcode_data/version.rb +1 -1
- data/lib/free_zipcode_data.rb +2 -0
- data/lib/tasks/version.rake +8 -3
- data/spec/spec_helper.rb +1 -1
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 689bda27853626d8130fd3d8bc525d481b3965b2b15f788d315a73569361d0f2
|
4
|
+
data.tar.gz: a84dce617a5db3ae60a0980edf8fec801bab405ce16dca6d28b22bd25c8e8722
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd80e10fb64b872e1deeb21b6419727ccb7f0553d4da4d4fa81430635e788c308c1f3f3baf780d142f39c41ee749bdd25e5e3165c50fc59fa7fbc96c96f93362
|
7
|
+
data.tar.gz: a20ec9167f0267fc52268e6bcd3a0679de2b00745ad5efc0670774493a05de8358def3e8318037d7ac711da8e62e290dd0defee24caf457e00d8abcb7ff18bbb
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.7
|
3
3
|
|
4
4
|
# Include gemspec and Rakefile
|
5
5
|
Include:
|
@@ -19,8 +19,13 @@ AllCops:
|
|
19
19
|
- 'stubs/**/*'
|
20
20
|
- 'spec/support/shared_contexts/*'
|
21
21
|
|
22
|
+
NewCops: enable
|
23
|
+
|
24
|
+
########################################
|
25
|
+
# Style Cops
|
26
|
+
|
22
27
|
# Checks formatting of special comments
|
23
|
-
CommentAnnotation:
|
28
|
+
Style/CommentAnnotation:
|
24
29
|
Keywords:
|
25
30
|
- TODO
|
26
31
|
- FIXME
|
@@ -28,27 +33,15 @@ CommentAnnotation:
|
|
28
33
|
- HACK
|
29
34
|
- REVIEW
|
30
35
|
|
31
|
-
########################################
|
32
|
-
# Style Cops
|
33
|
-
|
34
36
|
Style/ClassVars:
|
35
37
|
Enabled: false
|
36
38
|
|
37
39
|
Style/Documentation:
|
38
40
|
Enabled: false
|
39
41
|
|
40
|
-
Style/FileName:
|
41
|
-
Enabled: false
|
42
|
-
|
43
|
-
Style/AlignParameters:
|
44
|
-
EnforcedStyle: with_fixed_indentation
|
45
|
-
|
46
42
|
Style/RegexpLiteral:
|
47
43
|
Enabled: false
|
48
44
|
|
49
|
-
Style/EmptyLinesAroundBlockBody:
|
50
|
-
Enabled: false
|
51
|
-
|
52
45
|
Style/RaiseArgs:
|
53
46
|
Enabled: false
|
54
47
|
|
@@ -61,18 +54,18 @@ Style/PerlBackrefs:
|
|
61
54
|
########################################
|
62
55
|
# Lint Cops
|
63
56
|
|
64
|
-
Lint/
|
57
|
+
Lint/SuppressedException:
|
65
58
|
Enabled: false
|
66
59
|
|
67
|
-
|
60
|
+
########################################
|
61
|
+
# Security Cops
|
62
|
+
|
63
|
+
Security/Eval:
|
68
64
|
Enabled: false
|
69
65
|
|
70
66
|
########################################
|
71
67
|
# Metrics Cops
|
72
68
|
|
73
|
-
Metrics/LineLength:
|
74
|
-
Max: 110
|
75
|
-
|
76
69
|
Metrics/MethodLength:
|
77
70
|
CountComments: false # count full line comments?
|
78
71
|
Max: 30
|
@@ -83,6 +76,17 @@ Metrics/ClassLength:
|
|
83
76
|
Metrics/AbcSize:
|
84
77
|
Enabled: false
|
85
78
|
|
86
|
-
|
87
|
-
#
|
88
|
-
|
79
|
+
########################################
|
80
|
+
# Metrics Cops
|
81
|
+
|
82
|
+
Naming/FileName:
|
83
|
+
Enabled: false
|
84
|
+
|
85
|
+
########################################
|
86
|
+
# Layout Cops
|
87
|
+
|
88
|
+
Layout/EmptyLinesAroundBlockBody:
|
89
|
+
Enabled: false
|
90
|
+
|
91
|
+
Layout/LineLength:
|
92
|
+
Max: 110
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.3
|
data/CHANGELOG
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
free_zipcode_data (1.0.
|
4
|
+
free_zipcode_data (1.0.3)
|
5
5
|
colored (~> 1.2)
|
6
6
|
kiba (~> 2.0)
|
7
7
|
optimist (~> 3.0)
|
@@ -12,71 +12,76 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
ast (2.4.
|
16
|
-
coderay (1.1.
|
15
|
+
ast (2.4.2)
|
16
|
+
coderay (1.1.3)
|
17
17
|
colored (1.2)
|
18
|
-
diff-lcs (1.
|
19
|
-
docile (1.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
powerpack (0.1.1)
|
28
|
-
pry (0.10.4)
|
18
|
+
diff-lcs (1.4.4)
|
19
|
+
docile (1.4.0)
|
20
|
+
kiba (2.5.0)
|
21
|
+
method_source (0.9.2)
|
22
|
+
optimist (3.0.1)
|
23
|
+
parallel (1.21.0)
|
24
|
+
parser (3.0.2.0)
|
25
|
+
ast (~> 2.4.1)
|
26
|
+
pry (0.12.2)
|
29
27
|
coderay (~> 1.1.0)
|
30
|
-
method_source (~> 0.
|
31
|
-
|
32
|
-
|
33
|
-
pry (>= 0.9.10, < 0.11.0)
|
28
|
+
method_source (~> 0.9.0)
|
29
|
+
pry-nav (0.3.0)
|
30
|
+
pry (>= 0.9.10, < 0.13.0)
|
34
31
|
rainbow (3.0.0)
|
35
|
-
rake (
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
rspec-
|
42
|
-
|
32
|
+
rake (13.0.6)
|
33
|
+
regexp_parser (2.1.1)
|
34
|
+
rexml (3.3.6)
|
35
|
+
strscan
|
36
|
+
rspec (3.10.0)
|
37
|
+
rspec-core (~> 3.10.0)
|
38
|
+
rspec-expectations (~> 3.10.0)
|
39
|
+
rspec-mocks (~> 3.10.0)
|
40
|
+
rspec-core (3.10.1)
|
41
|
+
rspec-support (~> 3.10.0)
|
42
|
+
rspec-expectations (3.10.1)
|
43
43
|
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
-
rspec-support (~> 3.
|
45
|
-
rspec-mocks (3.
|
44
|
+
rspec-support (~> 3.10.0)
|
45
|
+
rspec-mocks (3.10.2)
|
46
46
|
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
-
rspec-support (~> 3.
|
48
|
-
rspec-support (3.
|
49
|
-
rubocop (
|
47
|
+
rspec-support (~> 3.10.0)
|
48
|
+
rspec-support (3.10.3)
|
49
|
+
rubocop (1.22.3)
|
50
50
|
parallel (~> 1.10)
|
51
|
-
parser (>=
|
52
|
-
powerpack (~> 0.1)
|
51
|
+
parser (>= 3.0.0.0)
|
53
52
|
rainbow (>= 2.2.2, < 4.0)
|
53
|
+
regexp_parser (>= 1.8, < 3.0)
|
54
|
+
rexml
|
55
|
+
rubocop-ast (>= 1.12.0, < 2.0)
|
54
56
|
ruby-progressbar (~> 1.7)
|
55
|
-
unicode-display_width (
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
58
|
+
rubocop-ast (1.12.0)
|
59
|
+
parser (>= 3.0.1.1)
|
60
|
+
ruby-prof (0.18.0)
|
61
|
+
ruby-progressbar (1.11.0)
|
62
|
+
rubyzip (2.3.2)
|
63
|
+
simplecov (0.21.2)
|
60
64
|
docile (~> 1.1)
|
61
|
-
|
62
|
-
|
63
|
-
simplecov-html (0.
|
64
|
-
|
65
|
-
sqlite3 (1.
|
66
|
-
|
65
|
+
simplecov-html (~> 0.11)
|
66
|
+
simplecov_json_formatter (~> 0.1)
|
67
|
+
simplecov-html (0.12.3)
|
68
|
+
simplecov_json_formatter (0.1.3)
|
69
|
+
sqlite3 (1.4.2)
|
70
|
+
strscan (3.1.0)
|
71
|
+
unicode-display_width (2.1.0)
|
67
72
|
|
68
73
|
PLATFORMS
|
69
74
|
ruby
|
70
75
|
|
71
76
|
DEPENDENCIES
|
72
|
-
bundler
|
77
|
+
bundler
|
73
78
|
free_zipcode_data!
|
74
79
|
pry-nav (~> 0.2)
|
75
|
-
rake (~>
|
80
|
+
rake (~> 13.0)
|
76
81
|
rspec (~> 3.7)
|
77
|
-
rubocop
|
82
|
+
rubocop
|
78
83
|
ruby-prof (~> 0.17)
|
79
84
|
simplecov (~> 0.16)
|
80
85
|
|
81
86
|
BUNDLED WITH
|
82
|
-
1.
|
87
|
+
2.1.4
|
data/bin/free_zipcode_data
CHANGED
data/free_zipcode_data.gemspec
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# coding: utf-8
|
3
2
|
|
4
|
-
lib = File.expand_path('
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
5
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
5
|
require 'free_zipcode_data/version'
|
7
6
|
|
8
|
-
# rubocop:disable Metrics/BlockLength
|
9
7
|
Gem::Specification.new do |spec|
|
8
|
+
spec.metadata = { 'rubygems_mfa_required' => 'true' }
|
10
9
|
spec.name = 'free_zipcode_data'
|
11
10
|
spec.version = FreeZipcodeData::VERSION
|
12
11
|
spec.authors = ['Chris Blackburn', 'Chris McKnight']
|
@@ -19,17 +18,16 @@ Gem::Specification.new do |spec|
|
|
19
18
|
spec.homepage = 'https://github.com/midwire/free_zipcode_data'
|
20
19
|
spec.license = 'MIT'
|
21
20
|
|
22
|
-
spec.required_ruby_version =
|
21
|
+
spec.required_ruby_version = Gem::Requirement.new(">= #{Bundler.root.join('.ruby-version').read.strip}")
|
23
22
|
spec.files = `git ls-files -z`.split("\x0")
|
24
23
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
25
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
26
24
|
spec.require_paths = ['lib']
|
27
25
|
|
28
|
-
spec.add_development_dependency 'bundler'
|
26
|
+
spec.add_development_dependency 'bundler'
|
29
27
|
spec.add_development_dependency 'pry-nav', '~> 0.2'
|
30
|
-
spec.add_development_dependency 'rake', '~>
|
28
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
31
29
|
spec.add_development_dependency 'rspec', '~> 3.7'
|
32
|
-
spec.add_development_dependency 'rubocop'
|
30
|
+
spec.add_development_dependency 'rubocop'
|
33
31
|
spec.add_development_dependency 'ruby-prof', '~> 0.17'
|
34
32
|
spec.add_development_dependency 'simplecov', '~> 0.16'
|
35
33
|
|
@@ -40,4 +38,3 @@ Gem::Specification.new do |spec|
|
|
40
38
|
spec.add_runtime_dependency 'rubyzip', '>= 1.2.2'
|
41
39
|
spec.add_runtime_dependency 'sqlite3', '~> 1.3'
|
42
40
|
end
|
43
|
-
# rubocop:enable Metrics/BlockLength
|
@@ -18,17 +18,16 @@ module FreeZipcodeData
|
|
18
18
|
|
19
19
|
def download
|
20
20
|
return nil if !options.clobber && File.exist?(zipfile_path)
|
21
|
+
|
21
22
|
FileUtils.mkdir_p(options.work_dir)
|
22
23
|
@logger.info("Downloading: #{zipfile} from GeoNames...")
|
23
|
-
open(zipfile_path, 'wb') do |file|
|
24
|
-
file <<
|
24
|
+
File.open(zipfile_path, 'wb') do |file|
|
25
|
+
file << URI.parse("#{BASE_URL}/#{zipfile}").open(&:read)
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
29
|
def datafile
|
29
|
-
@datafile ||=
|
30
|
-
datafile_with_headers
|
31
|
-
end
|
30
|
+
@datafile ||= datafile_with_headers
|
32
31
|
end
|
33
32
|
|
34
33
|
private
|
@@ -51,6 +50,7 @@ module FreeZipcodeData
|
|
51
50
|
Zip::File.open(zipfile_path) do |zip|
|
52
51
|
zip.each do |entry|
|
53
52
|
next if entry.name =~ /readme/i
|
53
|
+
|
54
54
|
country_file = File.join(options.work_dir, entry.name)
|
55
55
|
if File.exist?(country_file)
|
56
56
|
if options[:clobber]
|
data/lib/free_zipcode_data.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'readline'
|
4
4
|
|
5
|
+
require 'bundler/setup'
|
5
6
|
require 'free_zipcode_data/version'
|
6
7
|
|
7
8
|
module FreeZipcodeData
|
@@ -16,6 +17,7 @@ module FreeZipcodeData
|
|
16
17
|
#:nocov:
|
17
18
|
def self.config_file(filename = '.free_zipcode_data.yml')
|
18
19
|
return root.join('spec', 'fixtures', filename) if current_environment == 'test'
|
20
|
+
|
19
21
|
home = ENV.fetch('HOME')
|
20
22
|
file = ENV.fetch('FZD_CONFIG_FILE', File.join(home, '.free_zipcode_data.yml'))
|
21
23
|
FileUtils.touch(file)
|
data/lib/tasks/version.rake
CHANGED
@@ -65,9 +65,10 @@ namespace :version do
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def module_name
|
68
|
-
|
68
|
+
case PROJECT_NAME
|
69
|
+
when /-/
|
69
70
|
PROJECT_NAME.split('-').map(&:capitalize).join('::')
|
70
|
-
|
71
|
+
when /_/
|
71
72
|
PROJECT_NAME.split('_').map(&:capitalize).join
|
72
73
|
else
|
73
74
|
PROJECT_NAME.capitalize
|
@@ -100,8 +101,9 @@ namespace :version do
|
|
100
101
|
def update_readme_version_strings
|
101
102
|
version_string = read_version.join('.')
|
102
103
|
readme = open('README.md').read
|
103
|
-
regex = /^\*\*Version: [0-9
|
104
|
+
regex = /^\*\*Version: [0-9.]+\*\*$/i
|
104
105
|
return nil unless readme =~ regex
|
106
|
+
|
105
107
|
File.open('README.md', 'w') do |f|
|
106
108
|
f.write(readme.gsub(regex, "**Version: #{version_string}**"))
|
107
109
|
end
|
@@ -109,6 +111,7 @@ namespace :version do
|
|
109
111
|
|
110
112
|
def changelog
|
111
113
|
return @changelog_path if @changelog_path
|
114
|
+
|
112
115
|
@changelog_path = File.join(PROJECT_ROOT, 'CHANGELOG')
|
113
116
|
FileUtils.touch(@changelog_path)
|
114
117
|
@changelog_path
|
@@ -158,9 +161,11 @@ namespace :version do
|
|
158
161
|
|
159
162
|
def check_branch_and_warn
|
160
163
|
return true unless current_branch == 'master'
|
164
|
+
|
161
165
|
puts(branch_warning_message)
|
162
166
|
while (line = $stdin.gets.chomp)
|
163
167
|
return true if line =~ /[yY]/
|
168
|
+
|
164
169
|
puts 'Aborting version bump.'
|
165
170
|
return false
|
166
171
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,7 +4,7 @@ ENV['APP_ENV'] = 'test'
|
|
4
4
|
|
5
5
|
require 'pry'
|
6
6
|
|
7
|
-
Dir[
|
7
|
+
Dir[Pathname.new(File.dirname(__FILE__)).parent.join('spec/support/**/*.rb')].sort.each { |f| require f }
|
8
8
|
|
9
9
|
RSpec.configure do |config|
|
10
10
|
config.expect_with :rspec do |expectations|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: free_zipcode_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Blackburn
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-08-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '0'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: pry-nav
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '13.0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '13.0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rspec
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -71,16 +71,16 @@ dependencies:
|
|
71
71
|
name: rubocop
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - "
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '0
|
76
|
+
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '0
|
83
|
+
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: ruby-prof
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -207,6 +207,7 @@ files:
|
|
207
207
|
- ".gitignore"
|
208
208
|
- ".rspec"
|
209
209
|
- ".rubocop.yml"
|
210
|
+
- ".ruby-version"
|
210
211
|
- CHANGELOG
|
211
212
|
- CODE_OF_CONDUCT.md
|
212
213
|
- CONTRIBUTING.md
|
@@ -245,7 +246,8 @@ files:
|
|
245
246
|
homepage: https://github.com/midwire/free_zipcode_data
|
246
247
|
licenses:
|
247
248
|
- MIT
|
248
|
-
metadata:
|
249
|
+
metadata:
|
250
|
+
rubygems_mfa_required: 'true'
|
249
251
|
post_install_message:
|
250
252
|
rdoc_options: []
|
251
253
|
require_paths:
|
@@ -254,17 +256,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
254
256
|
requirements:
|
255
257
|
- - ">="
|
256
258
|
- !ruby/object:Gem::Version
|
257
|
-
version: 2.3
|
259
|
+
version: 2.7.3
|
258
260
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
259
261
|
requirements:
|
260
262
|
- - ">="
|
261
263
|
- !ruby/object:Gem::Version
|
262
264
|
version: '0'
|
263
265
|
requirements: []
|
264
|
-
|
265
|
-
rubygems_version: 2.7.6
|
266
|
+
rubygems_version: 3.1.6
|
266
267
|
signing_key:
|
267
268
|
specification_version: 4
|
268
269
|
summary: Free US and world-wide postal codes in SQLite and CSV format
|
269
|
-
test_files:
|
270
|
-
- spec/spec_helper.rb
|
270
|
+
test_files: []
|