jp_jis_code 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Guardfile +8 -1
- data/README.md +13 -4
- data/data/jis_code.yml +3540 -3540
- data/lib/jp_jis_code/code.rb +7 -7
- data/lib/jp_jis_code/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a533c4bd673a3cd5bd95771ff0c12e5a56bacaca9b9df1f00c0aff4dd075e2f
|
4
|
+
data.tar.gz: bbd75599810e05515fe7d8bd102dc7c5097fe72691f4caa4cd0017b708e53367
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf4fba353f377491481737d32c0f6f31ce2b3745d8ed09e173db1981d645a393e1c80350080221fce742920fb83a9d06284c60f1d8eb1acc22ee14b4dba69f2
|
7
|
+
data.tar.gz: 671919d598fd117ec290d7e3b60cbd3c7141d88eb699f3e55113565fd07e9178f8e1d9baf91169e220260942009e86317508a90cbf8c17a83681719c5f14524f
|
data/Guardfile
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
# A sample Guardfile
|
2
3
|
# More info at https://github.com/guard/guard#readme
|
3
4
|
|
@@ -39,4 +40,10 @@ guard :rspec, cmd: "bundle exec rspec" do
|
|
39
40
|
# Ruby files
|
40
41
|
ruby = dsl.ruby
|
41
42
|
dsl.watch_spec_files_for(ruby.lib_files)
|
42
|
-
|
43
|
+
|
44
|
+
# Turnip features and steps
|
45
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
46
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
47
|
+
Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
|
48
|
+
end
|
49
|
+
end
|
data/README.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# JpJisCode
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/jp_jis_code.svg)](https://badge.fury.io/rb/jp_jis_code)
|
4
|
+
[![Build Status](https://travis-ci.org/YuzuruS/jp_jis_code.svg?branch=master)](https://travis-ci.org/YuzuruS/jp_jis_code)
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/74f87eba9109855a15f1/maintainability)](https://codeclimate.com/github/YuzuruS/jp_jis_code/maintainability)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/github/YuzuruS/jp_jis_code/badge.svg)](https://coveralls.io/github/YuzuruS/jp_jis_code)
|
7
|
+
[![Dependency Status](https://beta.gemnasium.com/badges/github.com/YuzuruS/jp_jis_code.svg)](https://beta.gemnasium.com/projects/github.com/YuzuruS/jp_jis_code)
|
8
|
+
|
3
9
|
全国地方公共団体コード(JIS地名コード)から都道府県、市区町村を変換するライブラリです。
|
4
10
|
|
5
11
|
参考: [全国地方公共団体コード](https://ja.wikipedia.org/wiki/全国地方公共団体コード)
|
@@ -30,23 +36,26 @@ code = JpJisCode::Code.find('011002')
|
|
30
36
|
code.prefecture_name
|
31
37
|
# => '北海道'
|
32
38
|
code.prefecture_name_k
|
33
|
-
# => '
|
39
|
+
# => 'ほっかいどう'
|
34
40
|
code.city_name
|
35
41
|
# => '札幌市'
|
36
42
|
code.city_name_k
|
37
|
-
# => '
|
43
|
+
# => 'さっぽろし'
|
38
44
|
|
39
45
|
code = JpJisCode::Code.find('01100')
|
40
46
|
code.prefecture_name
|
41
47
|
# => '北海道'
|
42
48
|
code.prefecture_name_k
|
43
|
-
# => '
|
49
|
+
# => 'ほっかいどう'
|
44
50
|
code.city_name
|
45
51
|
# => '札幌市'
|
46
52
|
code.city_name_k
|
47
|
-
# => '
|
53
|
+
# => 'さっぽろし'
|
48
54
|
```
|
49
55
|
|
56
|
+
## TODO
|
57
|
+
- [総務省の全国地方公共団体コード](http://www.soumu.go.jp/denshijiti/code.html)のExcelから[jis_code.yml](https://github.com/YuzuruS/jp_jis_code/blob/master/data/jis_code.yml)を出力するスクリプト作成
|
58
|
+
|
50
59
|
## Development
|
51
60
|
|
52
61
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|