jpostcode 1.0.0.20200901 → 1.0.0.20210201
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +28 -10
- data/.ruby-version +1 -1
- data/CHANGELOG.md +72 -6
- data/Gemfile.lock +36 -35
- data/jpostcode-data/data/json/003.json +13 -0
- data/jpostcode-data/data/json/004.json +26 -0
- data/jpostcode-data/data/json/014.json +3 -3
- data/jpostcode-data/data/json/024.json +26 -0
- data/jpostcode-data/data/json/038.json +5 -5
- data/jpostcode-data/data/json/060.json +11 -24
- data/jpostcode-data/data/json/063.json +13 -0
- data/jpostcode-data/data/json/064.json +5 -5
- data/jpostcode-data/data/json/079.json +11 -76
- data/jpostcode-data/data/json/080.json +13 -0
- data/jpostcode-data/data/json/100.json +70 -16
- data/jpostcode-data/data/json/101.json +13 -26
- data/jpostcode-data/data/json/102.json +68 -16
- data/jpostcode-data/data/json/103.json +4 -17
- data/jpostcode-data/data/json/104.json +3 -3
- data/jpostcode-data/data/json/105.json +533 -26
- data/jpostcode-data/data/json/106.json +3 -3
- data/jpostcode-data/data/json/108.json +18 -5
- data/jpostcode-data/data/json/110.json +13 -0
- data/jpostcode-data/data/json/113.json +29 -31
- data/jpostcode-data/data/json/114.json +3 -3
- data/jpostcode-data/data/json/135.json +5 -18
- data/jpostcode-data/data/json/136.json +0 -13
- data/jpostcode-data/data/json/140.json +13 -0
- data/jpostcode-data/data/json/141.json +13 -0
- data/jpostcode-data/data/json/150.json +5 -5
- data/jpostcode-data/data/json/151.json +1 -1
- data/jpostcode-data/data/json/158.json +3 -3
- data/jpostcode-data/data/json/160.json +7 -7
- data/jpostcode-data/data/json/163.json +1 -1
- data/jpostcode-data/data/json/164.json +0 -13
- data/jpostcode-data/data/json/192.json +2 -2
- data/jpostcode-data/data/json/203.json +3 -3
- data/jpostcode-data/data/json/210.json +13 -26
- data/jpostcode-data/data/json/212.json +0 -52
- data/jpostcode-data/data/json/215.json +3 -16
- data/jpostcode-data/data/json/216.json +26 -13
- data/jpostcode-data/data/json/220.json +26 -0
- data/jpostcode-data/data/json/221.json +13 -0
- data/jpostcode-data/data/json/222.json +2 -2
- data/jpostcode-data/data/json/223.json +3 -3
- data/jpostcode-data/data/json/224.json +13 -0
- data/jpostcode-data/data/json/231.json +51 -90
- data/jpostcode-data/data/json/235.json +2 -2
- data/jpostcode-data/data/json/237.json +0 -26
- data/jpostcode-data/data/json/241.json +3 -3
- data/jpostcode-data/data/json/242.json +2 -15
- data/jpostcode-data/data/json/243.json +0 -26
- data/jpostcode-data/data/json/248.json +1 -1
- data/jpostcode-data/data/json/251.json +13 -0
- data/jpostcode-data/data/json/252.json +54 -41
- data/jpostcode-data/data/json/253.json +4 -30
- data/jpostcode-data/data/json/254.json +27 -14
- data/jpostcode-data/data/json/257.json +17 -4
- data/jpostcode-data/data/json/259.json +3 -29
- data/jpostcode-data/data/json/272.json +30 -15
- data/jpostcode-data/data/json/275.json +1 -1
- data/jpostcode-data/data/json/289.json +0 -13
- data/jpostcode-data/data/json/297.json +13 -0
- data/jpostcode-data/data/json/301.json +6 -6
- data/jpostcode-data/data/json/306.json +13 -0
- data/jpostcode-data/data/json/307.json +16 -16
- data/jpostcode-data/data/json/310.json +1 -1
- data/jpostcode-data/data/json/312.json +13 -0
- data/jpostcode-data/data/json/319.json +2 -2
- data/jpostcode-data/data/json/321.json +2 -2
- data/jpostcode-data/data/json/330.json +16 -3
- data/jpostcode-data/data/json/351.json +13 -0
- data/jpostcode-data/data/json/362.json +78 -0
- data/jpostcode-data/data/json/395.json +13 -0
- data/jpostcode-data/data/json/399.json +5 -18
- data/jpostcode-data/data/json/400.json +3 -3
- data/jpostcode-data/data/json/410.json +2 -2
- data/jpostcode-data/data/json/414.json +1 -1
- data/jpostcode-data/data/json/440.json +0 -13
- data/jpostcode-data/data/json/444.json +13 -0
- data/jpostcode-data/data/json/445.json +13 -0
- data/jpostcode-data/data/json/448.json +13 -0
- data/jpostcode-data/data/json/453.json +0 -13
- data/jpostcode-data/data/json/455.json +13 -0
- data/jpostcode-data/data/json/503.json +3 -3
- data/jpostcode-data/data/json/505.json +13 -0
- data/jpostcode-data/data/json/506.json +5 -5
- data/jpostcode-data/data/json/515.json +2 -2
- data/jpostcode-data/data/json/516.json +13 -0
- data/jpostcode-data/data/json/518.json +2 -2
- data/jpostcode-data/data/json/520.json +13 -0
- data/jpostcode-data/data/json/525.json +28 -13
- data/jpostcode-data/data/json/530.json +13 -0
- data/jpostcode-data/data/json/536.json +1 -1
- data/jpostcode-data/data/json/539.json +8 -8
- data/jpostcode-data/data/json/564.json +5 -5
- data/jpostcode-data/data/json/575.json +5 -5
- data/jpostcode-data/data/json/583.json +2 -2
- data/jpostcode-data/data/json/596.json +0 -13
- data/jpostcode-data/data/json/604.json +2 -2
- data/jpostcode-data/data/json/616.json +3 -3
- data/jpostcode-data/data/json/620.json +315 -104
- data/jpostcode-data/data/json/630.json +17 -4
- data/jpostcode-data/data/json/651.json +3 -3
- data/jpostcode-data/data/json/657.json +1 -1
- data/jpostcode-data/data/json/670.json +3 -3
- data/jpostcode-data/data/json/701.json +13 -0
- data/jpostcode-data/data/json/712.json +2 -2
- data/jpostcode-data/data/json/720.json +2 -2
- data/jpostcode-data/data/json/733.json +0 -13
- data/jpostcode-data/data/json/742.json +3 -3
- data/jpostcode-data/data/json/754.json +13 -0
- data/jpostcode-data/data/json/760.json +13 -26
- data/jpostcode-data/data/json/761.json +26 -0
- data/jpostcode-data/data/json/781.json +2 -2
- data/jpostcode-data/data/json/800.json +13 -0
- data/jpostcode-data/data/json/810.json +0 -26
- data/jpostcode-data/data/json/811.json +13 -0
- data/jpostcode-data/data/json/812.json +1 -1
- data/jpostcode-data/data/json/819.json +26 -0
- data/jpostcode-data/data/json/820.json +3 -3
- data/jpostcode-data/data/json/821.json +3 -3
- data/jpostcode-data/data/json/839.json +2 -2
- data/jpostcode-data/data/json/842.json +3 -3
- data/jpostcode-data/data/json/849.json +5 -5
- data/jpostcode-data/data/json/852.json +1 -1
- data/jpostcode-data/data/json/861.json +3 -3
- data/jpostcode-data/data/json/867.json +41 -13
- data/jpostcode-data/data/json/870.json +42 -16
- data/jpostcode-data/data/json/879.json +0 -13
- data/jpostcode-data/data/json/901.json +2 -2
- data/jpostcode-data/data/json/907.json +26 -0
- data/jpostcode-data/data/json/920.json +74 -22
- data/jpostcode-data/data/json/926.json +2 -2
- data/jpostcode-data/data/json/940.json +13 -0
- data/jpostcode-data/data/json/942.json +13 -0
- data/jpostcode-data/data/json/945.json +3 -3
- data/jpostcode-data/data/json/948.json +26 -0
- data/jpostcode-data/data/json/949.json +14 -1
- data/jpostcode-data/data/json/955.json +2 -2
- data/jpostcode-data/data/json/958.json +5 -5
- data/jpostcode-data/data/json/964.json +1 -1
- data/jpostcode-data/data/json/969.json +4 -30
- data/jpostcode-data/data/json/981.json +26 -13
- data/jpostcode-data/data/json/983.json +0 -91
- data/jpostcode-data/data/json/984.json +3 -3
- data/jpostcode-data/data/json/989.json +39 -0
- data/jpostcode-data/data/json/990.json +1 -1
- data/jpostcode.gemspec +2 -1
- data/lib/jpostcode.rb +2 -2
- data/lib/jpostcode/version.rb +1 -1
- metadata +6 -6
data/lib/jpostcode.rb
CHANGED
@@ -5,7 +5,7 @@ require 'jpostcode/address'
|
|
5
5
|
require 'json'
|
6
6
|
|
7
7
|
module Jpostcode
|
8
|
-
DATA_DIR = File.dirname(__FILE__)
|
8
|
+
DATA_DIR = "#{File.dirname(__FILE__)}/../jpostcode-data/data/json/"
|
9
9
|
|
10
10
|
module_function
|
11
11
|
|
@@ -13,7 +13,7 @@ module Jpostcode
|
|
13
13
|
zip_code = raw_zip_code.to_s.delete('-')
|
14
14
|
return nil unless /^\d{7,7}$/ =~ zip_code
|
15
15
|
|
16
|
-
json_file = DATA_DIR
|
16
|
+
json_file = "#{DATA_DIR}#{zip_code.slice(0, 3)}.json"
|
17
17
|
return nil unless File.exist?(json_file)
|
18
18
|
|
19
19
|
data = JSON.parse(File.open(json_file).read)
|
data/lib/jpostcode/version.rb
CHANGED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jpostcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.20210201
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kakipo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.1'
|
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
26
|
version: '2.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -1156,14 +1156,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1156
1156
|
requirements:
|
1157
1157
|
- - ">="
|
1158
1158
|
- !ruby/object:Gem::Version
|
1159
|
-
version: '
|
1159
|
+
version: '2.5'
|
1160
1160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1161
1161
|
requirements:
|
1162
1162
|
- - ">="
|
1163
1163
|
- !ruby/object:Gem::Version
|
1164
1164
|
version: '0'
|
1165
1165
|
requirements: []
|
1166
|
-
rubygems_version: 3.
|
1166
|
+
rubygems_version: 3.2.3
|
1167
1167
|
signing_key:
|
1168
1168
|
specification_version: 4
|
1169
1169
|
summary: A Ruby implementation for Japan postcode.
|