tax_jp 0.0.3 → 0.0.4
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 +4 -4
- data/.travis.yml +7 -0
- data/Rakefile +5 -1
- data/data/prefectures.yml +48 -0
- data/features/step_definitions/prefectures.rb +12 -0
- data/features//351/203/275/351/201/223/345/272/234/347/234/214.feature +53 -0
- data/lib/tax_jp/prefecture.rb +29 -0
- data/lib/tax_jp/version.rb +1 -1
- data/lib/tax_jp.rb +2 -0
- data/tax_jp.gemspec +2 -2
- metadata +11 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 650a1d550ed212642954cfc87463138f4ff34275
|
|
4
|
+
data.tar.gz: a4b87be4557e715d1070cd51d6392de237954f8a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dae8cc37ae36fc305c658db858bc8aae8d0bb27552d2156b4a0c4eeb378c3bbf8471cf1abb954749141acc65d5db91ae328bae62e17ed88df3d68fa4e5b9a3f0
|
|
7
|
+
data.tar.gz: 48208ad895ed83d4533a3b84eacd08431fe066e6c4855e00e61e25eacf6430652a79831ab0f30eacb637512f8be8893f70e1f4378ce20ad2eeb710d479dc7788
|
data/.travis.yml
ADDED
data/Rakefile
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
prefectures:
|
|
2
|
+
01: '北海道'
|
|
3
|
+
02: '青森県'
|
|
4
|
+
03: '岩手県'
|
|
5
|
+
04: '宮城県'
|
|
6
|
+
05: '秋田県'
|
|
7
|
+
06: '山形県'
|
|
8
|
+
07: '福島県'
|
|
9
|
+
08: '茨城県'
|
|
10
|
+
09: '栃木県'
|
|
11
|
+
10: '群馬県'
|
|
12
|
+
11: '埼玉県'
|
|
13
|
+
12: '千葉県'
|
|
14
|
+
13: '東京都'
|
|
15
|
+
14: '神奈川県'
|
|
16
|
+
15: '新潟県'
|
|
17
|
+
16: '富山県'
|
|
18
|
+
17: '石川県'
|
|
19
|
+
18: '福井県'
|
|
20
|
+
19: '山梨県'
|
|
21
|
+
20: '長野県'
|
|
22
|
+
21: '岐阜県'
|
|
23
|
+
22: '静岡県'
|
|
24
|
+
23: '愛知県'
|
|
25
|
+
24: '三重県'
|
|
26
|
+
25: '滋賀県'
|
|
27
|
+
26: '京都府'
|
|
28
|
+
27: '大阪府'
|
|
29
|
+
28: '兵庫県'
|
|
30
|
+
29: '奈良県'
|
|
31
|
+
30: '和歌山県'
|
|
32
|
+
31: '鳥取県'
|
|
33
|
+
32: '島根県'
|
|
34
|
+
33: '岡山県'
|
|
35
|
+
34: '広島県'
|
|
36
|
+
35: '山口県'
|
|
37
|
+
36: '徳島県'
|
|
38
|
+
37: '香川県'
|
|
39
|
+
38: '愛媛県'
|
|
40
|
+
39: '高知県'
|
|
41
|
+
40: '福岡県'
|
|
42
|
+
41: '佐賀県'
|
|
43
|
+
42: '長崎県'
|
|
44
|
+
43: '熊本県'
|
|
45
|
+
44: '大分県'
|
|
46
|
+
45: '宮崎県'
|
|
47
|
+
46: '鹿児島県'
|
|
48
|
+
47: '沖縄県'
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# language: ja
|
|
2
|
+
|
|
3
|
+
機能: 都道府県
|
|
4
|
+
|
|
5
|
+
シナリオ: 都道府県コード
|
|
6
|
+
* JISで定義されているコードは以下の通りです。
|
|
7
|
+
| 01 | 北海道 |
|
|
8
|
+
| 02 | 青森県 |
|
|
9
|
+
| 03 | 岩手県 |
|
|
10
|
+
| 04 | 宮城県 |
|
|
11
|
+
| 05 | 秋田県 |
|
|
12
|
+
| 06 | 山形県 |
|
|
13
|
+
| 07 | 福島県 |
|
|
14
|
+
| 08 | 茨城県 |
|
|
15
|
+
| 09 | 栃木県 |
|
|
16
|
+
| 10 | 群馬県 |
|
|
17
|
+
| 11 | 埼玉県 |
|
|
18
|
+
| 12 | 千葉県 |
|
|
19
|
+
| 13 | 東京都 |
|
|
20
|
+
| 14 | 神奈川県 |
|
|
21
|
+
| 15 | 新潟県 |
|
|
22
|
+
| 16 | 富山県 |
|
|
23
|
+
| 17 | 石川県 |
|
|
24
|
+
| 18 | 福井県 |
|
|
25
|
+
| 19 | 山梨県 |
|
|
26
|
+
| 20 | 長野県 |
|
|
27
|
+
| 21 | 岐阜県 |
|
|
28
|
+
| 22 | 静岡県 |
|
|
29
|
+
| 23 | 愛知県 |
|
|
30
|
+
| 24 | 三重県 |
|
|
31
|
+
| 25 | 滋賀県 |
|
|
32
|
+
| 26 | 京都府 |
|
|
33
|
+
| 27 | 大阪府 |
|
|
34
|
+
| 28 | 兵庫県 |
|
|
35
|
+
| 29 | 奈良県 |
|
|
36
|
+
| 30 | 和歌山県 |
|
|
37
|
+
| 31 | 鳥取県 |
|
|
38
|
+
| 32 | 島根県 |
|
|
39
|
+
| 33 | 岡山県 |
|
|
40
|
+
| 34 | 広島県 |
|
|
41
|
+
| 35 | 山口県 |
|
|
42
|
+
| 36 | 徳島県 |
|
|
43
|
+
| 37 | 香川県 |
|
|
44
|
+
| 38 | 愛媛県 |
|
|
45
|
+
| 39 | 高知県 |
|
|
46
|
+
| 40 | 福岡県 |
|
|
47
|
+
| 41 | 佐賀県 |
|
|
48
|
+
| 42 | 長崎県 |
|
|
49
|
+
| 43 | 熊本県 |
|
|
50
|
+
| 44 | 大分県 |
|
|
51
|
+
| 45 | 宮崎県 |
|
|
52
|
+
| 46 | 鹿児島県 |
|
|
53
|
+
| 47 | 沖縄県 |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require 'yaml'
|
|
2
|
+
|
|
3
|
+
module TaxJp
|
|
4
|
+
class Prefecture
|
|
5
|
+
attr_reader :code, :name
|
|
6
|
+
|
|
7
|
+
def initialize(code, name)
|
|
8
|
+
@code = code
|
|
9
|
+
@name = name
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
@@prefectures = {}
|
|
13
|
+
gem_dir = File.dirname(File.dirname(File.dirname(__FILE__)))
|
|
14
|
+
prefectures = YAML.load_file(File.join(gem_dir, 'data', 'prefectures.yml'))['prefectures']
|
|
15
|
+
prefectures.each do |key, value|
|
|
16
|
+
code = "%02d" % key.to_i
|
|
17
|
+
@@prefectures[code] = Prefecture.new(code, value)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.all
|
|
21
|
+
@@prefectures.values
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.find_by_code(code)
|
|
25
|
+
@@prefectures["%02d" % code.to_i]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
end
|
data/lib/tax_jp/version.rb
CHANGED
data/lib/tax_jp.rb
CHANGED
data/tax_jp.gemspec
CHANGED
|
@@ -5,8 +5,8 @@ require 'tax_jp/version'
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "tax_jp"
|
|
7
7
|
spec.version = TaxJp::VERSION
|
|
8
|
-
spec.authors = [
|
|
9
|
-
spec.email = [
|
|
8
|
+
spec.authors = ['ichylinux', 'hyzhiro']
|
|
9
|
+
spec.email = ['ichylinux@gmail.com', 'hiroyuki@hybitz.co.jp']
|
|
10
10
|
spec.summary = %q{税金計算ライブラリ}
|
|
11
11
|
spec.description = %q{税金計算ライブラリ}
|
|
12
12
|
spec.homepage = 'https://github.com/hybitz/tax_jp'
|
metadata
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tax_jp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
7
|
+
- ichylinux
|
|
8
|
+
- hyzhiro
|
|
8
9
|
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain: []
|
|
@@ -55,24 +56,30 @@ dependencies:
|
|
|
55
56
|
description: "税金計算ライブラリ"
|
|
56
57
|
email:
|
|
57
58
|
- ichylinux@gmail.com
|
|
59
|
+
- hiroyuki@hybitz.co.jp
|
|
58
60
|
executables: []
|
|
59
61
|
extensions: []
|
|
60
62
|
extra_rdoc_files: []
|
|
61
63
|
files:
|
|
62
64
|
- ".gitignore"
|
|
65
|
+
- ".travis.yml"
|
|
63
66
|
- Gemfile
|
|
64
67
|
- LICENSE
|
|
65
68
|
- README.md
|
|
66
69
|
- Rakefile
|
|
67
70
|
- app/assets/javascripts/tax.js
|
|
68
71
|
- app/assets/javascripts/tax_jp.js
|
|
72
|
+
- data/prefectures.yml
|
|
69
73
|
- features/.gitignore
|
|
70
74
|
- features/step_definitions/consumption_tax.rb
|
|
75
|
+
- features/step_definitions/prefectures.rb
|
|
71
76
|
- features/support/env.rb
|
|
72
77
|
- features/消費税.feature
|
|
78
|
+
- features/都道府県.feature
|
|
73
79
|
- lib/tax_jp.rb
|
|
74
80
|
- lib/tax_jp/const.rb
|
|
75
81
|
- lib/tax_jp/consumption_tax.rb
|
|
82
|
+
- lib/tax_jp/prefecture.rb
|
|
76
83
|
- lib/tax_jp/rails/engine.rb
|
|
77
84
|
- lib/tax_jp/rails/railtie.rb
|
|
78
85
|
- lib/tax_jp/version.rb
|
|
@@ -104,5 +111,7 @@ summary: "税金計算ライブラリ"
|
|
|
104
111
|
test_files:
|
|
105
112
|
- features/.gitignore
|
|
106
113
|
- features/step_definitions/consumption_tax.rb
|
|
114
|
+
- features/step_definitions/prefectures.rb
|
|
107
115
|
- features/support/env.rb
|
|
108
116
|
- features/消費税.feature
|
|
117
|
+
- features/都道府県.feature
|