jp_prefecture 0.8.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +70 -13
- data/LICENSE +17 -18
- data/README.md +64 -51
- data/README_EN.md +227 -0
- data/data/zip.yml +10 -5
- data/lib/jp_prefecture.rb +6 -5
- data/lib/jp_prefecture/base.rb +3 -2
- data/lib/jp_prefecture/config.rb +2 -4
- data/lib/jp_prefecture/mapping.rb +2 -2
- data/lib/jp_prefecture/prefecture.rb +74 -101
- data/lib/jp_prefecture/prefecture/finder.rb +71 -0
- data/lib/jp_prefecture/version.rb +3 -1
- data/lib/jp_prefecture/zip_mapping.rb +9 -6
- metadata +107 -44
- data/.gitignore +0 -18
- data/.rspec +0 -2
- data/.travis.yml +0 -13
- data/.yardopts +0 -2
- data/Gemfile +0 -3
- data/Rakefile +0 -74
- data/jp_prefecture.gemspec +0 -23
- data/spec/base_spec.rb +0 -81
- data/spec/config_spec.rb +0 -18
- data/spec/fixtures/prefecture.yml +0 -148
- data/spec/jp_prefecture_spec.rb +0 -36
- data/spec/mapping_spec.rb +0 -10
- data/spec/prefecture_spec.rb +0 -163
- data/spec/spec_helper.rb +0 -35
- data/spec/zip_mapping_spec.rb +0 -10
data/data/zip.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# { prefecture_code: [[from_zip_1, to_zip_1], [from_zip_2, to_zip_2], ...], ... }
|
2
|
+
# Last updated: 2021-02-10 05:59:09 UTC
|
2
3
|
---
|
3
4
|
1:
|
4
5
|
- - 10000
|
@@ -41,6 +42,8 @@
|
|
41
42
|
- 3491221
|
42
43
|
10:
|
43
44
|
- - 3700000
|
45
|
+
- 3701506
|
46
|
+
- - 3701511
|
44
47
|
- 3792314
|
45
48
|
- - 3840097
|
46
49
|
- 3840097
|
@@ -51,6 +54,8 @@
|
|
51
54
|
- 3491216
|
52
55
|
- - 3500001
|
53
56
|
- 3691912
|
57
|
+
- - 3701507
|
58
|
+
- 3701507
|
54
59
|
12:
|
55
60
|
- - 2600000
|
56
61
|
- 2995506
|
@@ -110,14 +115,14 @@
|
|
110
115
|
- - 4314121
|
111
116
|
- 4314121
|
112
117
|
- - 4400001
|
113
|
-
-
|
114
|
-
- -
|
118
|
+
- 4980000
|
119
|
+
- - 4980001
|
115
120
|
- 4980069
|
116
121
|
24:
|
117
122
|
- - 4980000
|
118
123
|
- 4980000
|
119
124
|
- - 4980801
|
120
|
-
-
|
125
|
+
- 4980824
|
121
126
|
- - 5100000
|
122
127
|
- 5195835
|
123
128
|
- - 6471321
|
@@ -231,8 +236,8 @@
|
|
231
236
|
- - 8391421
|
232
237
|
- 8391421
|
233
238
|
- - 8700001
|
234
|
-
-
|
235
|
-
- -
|
239
|
+
- 8701223
|
240
|
+
- - 8710000
|
236
241
|
- 8710208
|
237
242
|
- - 8710311
|
238
243
|
- 8710716
|
data/lib/jp_prefecture.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'jp_prefecture/base'
|
4
|
+
require 'jp_prefecture/config'
|
5
|
+
require 'jp_prefecture/prefecture'
|
6
|
+
require 'jp_prefecture/version'
|
6
7
|
|
7
8
|
module JpPrefecture
|
8
9
|
@config = Config.new
|
data/lib/jp_prefecture/base.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module JpPrefecture
|
3
4
|
module Base
|
4
5
|
# モデル内で使用するための設定を行う
|
@@ -34,7 +35,7 @@ module JpPrefecture
|
|
34
35
|
method_name = options[:method_name] || :prefecture
|
35
36
|
|
36
37
|
define_method method_name do
|
37
|
-
JpPrefecture::Prefecture.find(
|
38
|
+
JpPrefecture::Prefecture.find(send(column_name))
|
38
39
|
end
|
39
40
|
end
|
40
41
|
end
|
data/lib/jp_prefecture/config.rb
CHANGED
@@ -1,91 +1,46 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'jp_prefecture/prefecture/finder'
|
4
|
+
require 'jp_prefecture/mapping'
|
5
|
+
require 'jp_prefecture/zip_mapping'
|
4
6
|
|
5
7
|
module JpPrefecture
|
6
8
|
# 都道府県のコードと名前を扱うクラス
|
7
9
|
class Prefecture
|
10
|
+
attr_accessor :code, :name, :name_e, :name_h, :name_k, :zips, :area, :type
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
# 配列から都道府県クラスを生成
|
12
|
+
# 都道府県コードから都道府県インスタンスを作成
|
12
13
|
#
|
13
14
|
# @example
|
14
|
-
# #
|
15
|
-
# JpPrefecture::Prefecture.
|
16
|
-
#
|
17
|
-
# @param pref [Integer] 都道府県コード
|
18
|
-
# @param name [String] 都道府県名
|
19
|
-
# @param name_e [String] 都道府県名(英語表記)
|
20
|
-
# @param optional name_h [String] 都道府県名(ひらがな表記)
|
21
|
-
# @param optional name_k [String] 都道府県名(カタカナ表記)
|
22
|
-
# @param optional area [String] 地方名
|
23
|
-
# @param zips [Array] 郵便番号の配列 (array of ranges, can be used in ARel, e.g. User.where(zip: prefecture.zips))
|
24
|
-
def self.build(code, name, name_e, name_h = nil, name_k = nil, area = nil)
|
25
|
-
pref = self.new
|
26
|
-
|
27
|
-
pref.code = code
|
28
|
-
pref.name = name
|
29
|
-
pref.name_e = name_e.capitalize
|
30
|
-
pref.name_h = name_h
|
31
|
-
pref.name_k = name_k
|
32
|
-
pref.zips = ZipMapping.data[code]
|
33
|
-
pref.area = area
|
34
|
-
|
35
|
-
pref
|
36
|
-
end
|
37
|
-
|
38
|
-
# 都道府県を検索
|
39
|
-
#
|
40
|
-
# @example
|
41
|
-
# # 都道府県コードから検索
|
42
|
-
# JpPrefecture::Prefecture.find(1)
|
43
|
-
# JpPrefecture::Prefecture.find(code: 1)
|
15
|
+
# # 都道府県コードから都道府県インスタンスを生成
|
16
|
+
# JpPrefecture::Prefecture.build_by_code(1)
|
44
17
|
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
# # 都道府県名から検索(前方一致)
|
49
|
-
# JpPrefecture::Prefecture.find(name: '東京')
|
50
|
-
#
|
51
|
-
# # 英語表記の都道府県名から検索
|
52
|
-
# JpPrefecture::Prefecture.find(name: 'Hokkaido')
|
53
|
-
# JpPrefecture::Prefecture.find(name: 'hokkaido')
|
54
|
-
#
|
55
|
-
# @param args [Integer] 都道府県コード
|
56
|
-
# @param [Hash] args 検索条件
|
57
|
-
# @option args [Integer] :code 都道府県コード
|
58
|
-
# @option args [String] :name 都道府県名/英語/ひらがな/カタカナ表記の都道府県名
|
59
|
-
# @option args [Integer] :zip 郵便番号
|
60
|
-
# @return [JpPrefecture::Prefecture] 都道府県が見つかった場合は都道府県クラス
|
18
|
+
# @param code [Integer] 都道府県コード
|
19
|
+
# @return [JpPrefecture::Prefecture] 都道府県インスタンス
|
61
20
|
# @return [nil] 都道府県が見つからない場合は nil
|
62
|
-
def self.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
return unless names
|
21
|
+
def self.build_by_code(code) # rubocop:disable Metrics/AbcSize
|
22
|
+
result = Mapping.data[code]
|
23
|
+
return unless result
|
24
|
+
|
25
|
+
pref = new
|
26
|
+
|
27
|
+
pref.code = code
|
28
|
+
pref.name = result[:name]
|
29
|
+
pref.name_e = result[:name_e].capitalize
|
30
|
+
pref.name_h = result[:name_h]
|
31
|
+
pref.name_k = result[:name_k]
|
32
|
+
pref.zips = ZipMapping.data[code]
|
33
|
+
pref.area = result[:area]
|
34
|
+
pref.type =
|
35
|
+
case pref.name[-1]
|
36
|
+
when '都', '道', '府', '県'
|
37
|
+
pref.name[-1]
|
38
|
+
end
|
82
39
|
|
83
|
-
|
84
|
-
names[:name], names[:name_e],
|
85
|
-
names[:name_h], names[:name_k], names[:area])
|
40
|
+
pref
|
86
41
|
end
|
87
42
|
|
88
|
-
#
|
43
|
+
# すべての都道府県を取得
|
89
44
|
#
|
90
45
|
# @example
|
91
46
|
# # 都道府県の一覧を取得
|
@@ -97,38 +52,56 @@ module JpPrefecture
|
|
97
52
|
# # collection_select で選択肢を生成(英語表記)
|
98
53
|
# f.collection_select :prefecture_code, JpPrefecture::Prefecture.all, :code, :name_e
|
99
54
|
#
|
100
|
-
# @return [Array]
|
55
|
+
# @return [Array<JpPrefecture::Prefecture>] 都道府県インスタンスの配列
|
101
56
|
def self.all
|
102
|
-
Mapping.data.map
|
103
|
-
names = pref[1]
|
104
|
-
self.build(pref[0],
|
105
|
-
names[:name], names[:name_e],
|
106
|
-
names[:name_h], names[:name_k], names[:area])
|
107
|
-
end
|
57
|
+
Mapping.data.map { |code, _| build_by_code(code) }
|
108
58
|
end
|
109
59
|
|
110
|
-
|
111
|
-
|
112
|
-
#
|
60
|
+
# 都道府県を検索
|
61
|
+
#
|
62
|
+
# 文字列は前方一致で検索する
|
63
|
+
#
|
64
|
+
# @example
|
65
|
+
# # 都道府県コードを検索
|
66
|
+
# JpPrefecture::Prefecture.find(1)
|
67
|
+
# JpPrefecture::Prefecture.find(code: 1)
|
68
|
+
#
|
69
|
+
# # 都道府県名を検索
|
70
|
+
# JpPrefecture::Prefecture.find(name: '北海道')
|
71
|
+
# JpPrefecture::Prefecture.find(name: '東京')
|
72
|
+
#
|
73
|
+
# # 英語表記の都道府県名を検索
|
74
|
+
# JpPrefecture::Prefecture.find(name_e: 'Hokkaido')
|
75
|
+
# JpPrefecture::Prefecture.find(name_e: 'hokkaido')
|
76
|
+
#
|
77
|
+
# # ひらがな表記の都道府県名を検索
|
78
|
+
# JpPrefecture::Prefecture.find(name_h: 'ほっかいどう')
|
113
79
|
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
|
118
|
-
|
80
|
+
# # カタカナ表記の都道府県名を検索
|
81
|
+
# JpPrefecture::Prefecture.find(name_k: 'ホッカイドウ')
|
82
|
+
#
|
83
|
+
# # すべての項目を検索
|
84
|
+
# JpPrefecture::Prefecture.find(all_fields: '東')
|
85
|
+
#
|
86
|
+
# @param args [Integer] 都道府県コード
|
87
|
+
# @param args [Hash<Symbol, Integer>] :code 都道府県コード
|
88
|
+
# @param args [Hash<Symbol, String>] :name 漢字表記/:name_e 英語表記/:name_h ひらがな表記/:name_k カタカナ表記
|
89
|
+
# @param args [Hash<Symbol, Integer>] :zip 郵便番号
|
90
|
+
# @param args [Hash<Symbol, (String, Integer)>] :all_fields マッピングに定義しているすべてのフィールドから検索
|
91
|
+
# @return [JpPrefecture::Prefecture] 都道府県が見つかった場合は都道府県インスタンス
|
92
|
+
# @return [nil] 都道府県が見つからない場合は nil
|
93
|
+
def self.find(args)
|
94
|
+
return if args.nil?
|
119
95
|
|
120
|
-
|
96
|
+
case args
|
97
|
+
when Integer, String
|
98
|
+
JpPrefecture::Prefecture::Finder.new.find(field: nil, value: args)
|
99
|
+
when Hash
|
100
|
+
search_field = args.keys.first
|
101
|
+
search_value = args.values.first
|
121
102
|
|
122
|
-
|
123
|
-
m[1].values.each do |v|
|
124
|
-
if v.start_with?(name)
|
125
|
-
return m[0]
|
126
|
-
end
|
127
|
-
end
|
103
|
+
JpPrefecture::Prefecture::Finder.new.find(field: search_field, value: search_value)
|
128
104
|
end
|
129
|
-
|
130
|
-
nil
|
131
105
|
end
|
132
|
-
|
133
106
|
end
|
134
107
|
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'jp_prefecture/mapping'
|
4
|
+
require 'jp_prefecture/zip_mapping'
|
5
|
+
|
6
|
+
module JpPrefecture
|
7
|
+
class Prefecture
|
8
|
+
# 都道府県の検索を行うクラス
|
9
|
+
class Finder
|
10
|
+
def initialize
|
11
|
+
@mapping = Mapping.data
|
12
|
+
end
|
13
|
+
|
14
|
+
# 指定した項目を検索
|
15
|
+
#
|
16
|
+
# @param field [Symbol] 検索する項目。nil の場合は都道府県コードとして扱う
|
17
|
+
# @param value [String, Integer] 検索する内容
|
18
|
+
# @return [JpPrefecture::Prefecture] 都道府県が見つかった場合は都道府県インスタンス
|
19
|
+
# @return [nil] 都道府県が見つからない場合は nil
|
20
|
+
def find(field:, value:)
|
21
|
+
code = find_code(field, value)
|
22
|
+
JpPrefecture::Prefecture.build_by_code(code)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
# @param field [Symbol] 検索する項目
|
28
|
+
# @param value [String, Integer] 検索する内容
|
29
|
+
# @return [Integer] 見つかった場合は都道府県コード
|
30
|
+
# @return [nil] 見つからない場合は nil
|
31
|
+
def find_code(field, value)
|
32
|
+
return value.to_i if field.nil?
|
33
|
+
|
34
|
+
case field
|
35
|
+
when :all_fields
|
36
|
+
find_code_by_name_from_all_fields(value)
|
37
|
+
when :name, :name_h, :name_k, :name_e
|
38
|
+
find_code_by_name(field, value)
|
39
|
+
when :code
|
40
|
+
value.to_i
|
41
|
+
when :zip
|
42
|
+
ZipMapping.code_for_zip(value.to_i)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# すべての項目を前方一致で検索
|
47
|
+
def find_code_by_name_from_all_fields(value)
|
48
|
+
return if value.nil? || value.empty?
|
49
|
+
|
50
|
+
value = value.downcase
|
51
|
+
|
52
|
+
@mapping.each do |m|
|
53
|
+
m[1].each_value do |v|
|
54
|
+
return m[0] if v.start_with?(value)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# 指定した項目を前方一致で検索
|
60
|
+
def find_code_by_name(field, value)
|
61
|
+
return if value.nil? || value.empty?
|
62
|
+
|
63
|
+
value = value.downcase
|
64
|
+
|
65
|
+
@mapping.each do |m|
|
66
|
+
return m[0] if m[1][field].start_with?(value)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -1,21 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'yaml'
|
3
4
|
|
4
5
|
module JpPrefecture
|
5
6
|
# コードと郵便番号のマッピング
|
6
7
|
module ZipMapping
|
7
|
-
|
8
8
|
filepath = File.join(File.dirname(__FILE__), '../../data/zip.yml')
|
9
9
|
@data = YAML.load_file(filepath)
|
10
|
-
|
10
|
+
# rubocop:disable Style/HashConversion
|
11
|
+
# https://github.com/rubocop-hq/rubocop/issues/9526
|
12
|
+
@data = Hash[*@data.collect { |code, arr| [code, arr.collect { |zip_from, zip_to| zip_from..zip_to }] }.flatten(1)]
|
13
|
+
# rubocop:enable Style/HashConversion
|
11
14
|
|
12
15
|
def self.data
|
13
16
|
JpPrefecture.config.zip_mapping_data || @data
|
14
17
|
end
|
15
18
|
|
16
|
-
def self.code_for_zip
|
17
|
-
|
18
|
-
zip_ranges.find{|range|range.include? zip}
|
19
|
+
def self.code_for_zip(zip)
|
20
|
+
data.select do |_code, zip_ranges|
|
21
|
+
zip_ranges.find { |range| range.include? zip }
|
19
22
|
end.keys.first
|
20
23
|
end
|
21
24
|
end
|
metadata
CHANGED
@@ -1,15 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jp_prefecture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- chocoby
|
8
|
-
autorequire:
|
7
|
+
- "@chocoby"
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activerecord
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.0.0
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: appraisal
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: rake
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -28,32 +56,32 @@ dependencies:
|
|
28
56
|
name: rspec
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
|
-
- - "
|
59
|
+
- - ">="
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
61
|
+
version: '0'
|
34
62
|
type: :development
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
|
-
- - "
|
66
|
+
- - ">="
|
39
67
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
68
|
+
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
70
|
+
name: rubocop
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
44
72
|
requirements:
|
45
73
|
- - ">="
|
46
74
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
75
|
+
version: '0'
|
48
76
|
type: :development
|
49
77
|
prerelease: false
|
50
78
|
version_requirements: !ruby/object:Gem::Requirement
|
51
79
|
requirements:
|
52
80
|
- - ">="
|
53
81
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
82
|
+
version: '0'
|
55
83
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
84
|
+
name: rubocop-performance
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
58
86
|
requirements:
|
59
87
|
- - ">="
|
@@ -67,7 +95,7 @@ dependencies:
|
|
67
95
|
- !ruby/object:Gem::Version
|
68
96
|
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
98
|
+
name: rubocop-rake
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
101
|
- - ">="
|
@@ -80,44 +108,88 @@ dependencies:
|
|
80
108
|
- - ">="
|
81
109
|
- !ruby/object:Gem::Version
|
82
110
|
version: '0'
|
83
|
-
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: simplecov
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov-lcov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: sqlite3
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
description: Convert japan prefecture code (JIS X 0402 based) into prefecture name.
|
84
168
|
email:
|
85
169
|
- chocoby@gmail.com
|
86
170
|
executables: []
|
87
171
|
extensions: []
|
88
172
|
extra_rdoc_files: []
|
89
173
|
files:
|
90
|
-
- ".gitignore"
|
91
|
-
- ".rspec"
|
92
|
-
- ".travis.yml"
|
93
|
-
- ".yardopts"
|
94
174
|
- CHANGELOG.md
|
95
|
-
- Gemfile
|
96
175
|
- LICENSE
|
97
176
|
- README.md
|
98
|
-
-
|
177
|
+
- README_EN.md
|
99
178
|
- data/prefecture.yml
|
100
179
|
- data/zip.yml
|
101
|
-
- jp_prefecture.gemspec
|
102
180
|
- lib/jp_prefecture.rb
|
103
181
|
- lib/jp_prefecture/base.rb
|
104
182
|
- lib/jp_prefecture/config.rb
|
105
183
|
- lib/jp_prefecture/mapping.rb
|
106
184
|
- lib/jp_prefecture/prefecture.rb
|
185
|
+
- lib/jp_prefecture/prefecture/finder.rb
|
107
186
|
- lib/jp_prefecture/version.rb
|
108
187
|
- lib/jp_prefecture/zip_mapping.rb
|
109
|
-
- spec/base_spec.rb
|
110
|
-
- spec/config_spec.rb
|
111
|
-
- spec/fixtures/prefecture.yml
|
112
|
-
- spec/jp_prefecture_spec.rb
|
113
|
-
- spec/mapping_spec.rb
|
114
|
-
- spec/prefecture_spec.rb
|
115
|
-
- spec/spec_helper.rb
|
116
|
-
- spec/zip_mapping_spec.rb
|
117
188
|
homepage: https://github.com/chocoby/jp_prefecture
|
118
|
-
licenses:
|
189
|
+
licenses:
|
190
|
+
- MIT
|
119
191
|
metadata: {}
|
120
|
-
post_install_message:
|
192
|
+
post_install_message:
|
121
193
|
rdoc_options: []
|
122
194
|
require_paths:
|
123
195
|
- lib
|
@@ -125,24 +197,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
197
|
requirements:
|
126
198
|
- - ">="
|
127
199
|
- !ruby/object:Gem::Version
|
128
|
-
version:
|
200
|
+
version: 2.4.0
|
129
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
202
|
requirements:
|
131
203
|
- - ">="
|
132
204
|
- !ruby/object:Gem::Version
|
133
205
|
version: '0'
|
134
206
|
requirements: []
|
135
|
-
|
136
|
-
|
137
|
-
signing_key:
|
207
|
+
rubygems_version: 3.1.4
|
208
|
+
signing_key:
|
138
209
|
specification_version: 4
|
139
210
|
summary: Convert japan prefecture code into prefecture name
|
140
|
-
test_files:
|
141
|
-
- spec/base_spec.rb
|
142
|
-
- spec/config_spec.rb
|
143
|
-
- spec/fixtures/prefecture.yml
|
144
|
-
- spec/jp_prefecture_spec.rb
|
145
|
-
- spec/mapping_spec.rb
|
146
|
-
- spec/prefecture_spec.rb
|
147
|
-
- spec/spec_helper.rb
|
148
|
-
- spec/zip_mapping_spec.rb
|
211
|
+
test_files: []
|