jipcode 1.2.10 → 1.3.0
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 +5 -5
- data/Gemfile.lock +3 -3
- data/lib/jipcode/japan_post.rb +6 -6
- data/lib/jipcode/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 39c9ab8fb3bc5cee093fff5d7c4f3d3dc6f1615c
|
|
4
|
+
data.tar.gz: d26eae03c3de6c0bbe8e57650b411c4a2f692b40
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 355f155f4a79a8d1737760902fab19500ae4cb687efefb73083b41f2c1c07f8075c495a63ae8b17b72c954f43bf40d87e511d58aeb3211cebd9b37d6905d49a1
|
|
7
|
+
data.tar.gz: 6f9919b2fccab798470da3b53b2c1faa75011c13c488030ffe34d72550b4ee30e0b497dac691b2fe40da5dba7ee0796b8419a3969cfc342d227562a6ab941b35
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
jipcode (1.
|
|
4
|
+
jipcode (1.3.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
@@ -28,7 +28,7 @@ GEM
|
|
|
28
28
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
29
29
|
rspec-support (~> 3.7.0)
|
|
30
30
|
rspec-support (3.7.1)
|
|
31
|
-
rubyzip (1.2.
|
|
31
|
+
rubyzip (1.2.2)
|
|
32
32
|
safe_yaml (1.0.4)
|
|
33
33
|
vcr (4.0.0)
|
|
34
34
|
webmock (3.3.0)
|
|
@@ -50,4 +50,4 @@ DEPENDENCIES
|
|
|
50
50
|
webmock
|
|
51
51
|
|
|
52
52
|
BUNDLED WITH
|
|
53
|
-
1.16.
|
|
53
|
+
1.16.3
|
data/lib/jipcode/japan_post.rb
CHANGED
|
@@ -7,8 +7,8 @@ require 'nkf'
|
|
|
7
7
|
module Jipcode
|
|
8
8
|
module JapanPost
|
|
9
9
|
ZIPCODE_URLS = {
|
|
10
|
-
general: '
|
|
11
|
-
company: '
|
|
10
|
+
general: 'https://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip'.freeze,
|
|
11
|
+
company: 'https://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/jigyosyo.zip'.freeze
|
|
12
12
|
}.freeze
|
|
13
13
|
ZIPCODE_FILES = {
|
|
14
14
|
general: 'KEN_ALL.CSV'.freeze,
|
|
@@ -23,10 +23,10 @@ module Jipcode
|
|
|
23
23
|
def download_all
|
|
24
24
|
ZIPCODE_URLS.each do |type, url|
|
|
25
25
|
url = URI.parse(url)
|
|
26
|
-
Net::HTTP.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
http = Net::HTTP.new(url.host, 443)
|
|
27
|
+
http.use_ssl = true
|
|
28
|
+
res = http.get(url.path)
|
|
29
|
+
File.open("zipcode/#{type}.zip", 'wb') { |f| f.write(res.body) }
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
data/lib/jipcode/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jipcode
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- rinkei
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-09-
|
|
11
|
+
date: 2018-09-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -1102,7 +1102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1102
1102
|
version: '0'
|
|
1103
1103
|
requirements: []
|
|
1104
1104
|
rubyforge_project:
|
|
1105
|
-
rubygems_version: 2.
|
|
1105
|
+
rubygems_version: 2.6.14
|
|
1106
1106
|
signing_key:
|
|
1107
1107
|
specification_version: 4
|
|
1108
1108
|
summary: A gem for Japan Post's official zipcode data search & update.
|