jp_prefecture 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.2 (June 12, 2013) ##
2
+
3
+ * 文字列を downcase してから都道府県の検索を行うようにした
4
+
1
5
  ## 0.3.1 (June 11, 2013) ##
2
6
 
3
7
  * name で渡した文字列が変更されるバグを修正
@@ -5,53 +5,53 @@ module JpPrefecture
5
5
  # JIS X 0402 で定義されている都道府県コードと都道府県名をベースに
6
6
  # コードがゼロから始まるもの(09 など)を 1 ケタにしたもの
7
7
  PREFECTURE_CODE_NAME = {
8
- 1 => { name: '北海道', name_e: 'Hokkaido' },
9
- 2 => { name: '青森県', name_e: 'Aomori' },
10
- 3 => { name: '岩手県', name_e: 'Iwate' },
11
- 4 => { name: '宮城県', name_e: 'Miyagi' },
12
- 5 => { name: '秋田県', name_e: 'Akita' },
13
- 6 => { name: '山形県', name_e: 'Yamagata' },
14
- 7 => { name: '福島県', name_e: 'Fukushima' },
15
- 8 => { name: '茨城県', name_e: 'Ibaraki' },
16
- 9 => { name: '栃木県', name_e: 'Tochigi' },
17
- 10 => { name: '群馬県', name_e: 'Gunma' },
18
- 11 => { name: '埼玉県', name_e: 'Saitama' },
19
- 12 => { name: '千葉県', name_e: 'Chiba' },
20
- 13 => { name: '東京都', name_e: 'Tokyo' },
21
- 14 => { name: '神奈川県', name_e: 'Kanagawa' },
22
- 15 => { name: '新潟県', name_e: 'Niigata' },
23
- 16 => { name: '富山県', name_e: 'Toyama' },
24
- 17 => { name: '石川県', name_e: 'Ishikawa' },
25
- 18 => { name: '福井県', name_e: 'Fukui' },
26
- 19 => { name: '山梨県', name_e: 'Yamanashi' },
27
- 20 => { name: '長野県', name_e: 'Nagano' },
28
- 21 => { name: '岐阜県', name_e: 'Gifu' },
29
- 22 => { name: '静岡県', name_e: 'Shizuoka' },
30
- 23 => { name: '愛知県', name_e: 'Aichi' },
31
- 24 => { name: '三重県', name_e: 'Mie' },
32
- 25 => { name: '滋賀県', name_e: 'Shiga' },
33
- 26 => { name: '京都府', name_e: 'Kyoto' },
34
- 27 => { name: '大阪府', name_e: 'Osaka' },
35
- 28 => { name: '兵庫県', name_e: 'Hyogo' },
36
- 29 => { name: '奈良県', name_e: 'Nara' },
37
- 30 => { name: '和歌山県', name_e: 'Wakayama' },
38
- 31 => { name: '鳥取県', name_e: 'Tottori' },
39
- 32 => { name: '島根県', name_e: 'Shimane' },
40
- 33 => { name: '岡山県', name_e: 'Okayama' },
41
- 34 => { name: '広島県', name_e: 'Hiroshima' },
42
- 35 => { name: '山口県', name_e: 'Yamaguchi' },
43
- 36 => { name: '徳島県', name_e: 'Tokushima' },
44
- 37 => { name: '香川県', name_e: 'Kagawa' },
45
- 38 => { name: '愛媛県', name_e: 'Ehime' },
46
- 39 => { name: '高知県', name_e: 'Kochi' },
47
- 40 => { name: '福岡県', name_e: 'Fukuoka' },
48
- 41 => { name: '佐賀県', name_e: 'Saga' },
49
- 42 => { name: '長崎県', name_e: 'Nagasaki' },
50
- 43 => { name: '熊本県', name_e: 'Kumamoto' },
51
- 44 => { name: '大分県', name_e: 'Oita' },
52
- 45 => { name: '宮崎県', name_e: 'Miyazaki' },
53
- 46 => { name: '鹿児島県', name_e: 'Kagoshima' },
54
- 47 => { name: '沖縄県', name_e: 'Okinawa' },
8
+ 1 => { name: '北海道', name_e: 'hokkaido' },
9
+ 2 => { name: '青森県', name_e: 'aomori' },
10
+ 3 => { name: '岩手県', name_e: 'iwate' },
11
+ 4 => { name: '宮城県', name_e: 'miyagi' },
12
+ 5 => { name: '秋田県', name_e: 'akita' },
13
+ 6 => { name: '山形県', name_e: 'yamagata' },
14
+ 7 => { name: '福島県', name_e: 'fukushima' },
15
+ 8 => { name: '茨城県', name_e: 'ibaraki' },
16
+ 9 => { name: '栃木県', name_e: 'tochigi' },
17
+ 10 => { name: '群馬県', name_e: 'gunma' },
18
+ 11 => { name: '埼玉県', name_e: 'saitama' },
19
+ 12 => { name: '千葉県', name_e: 'chiba' },
20
+ 13 => { name: '東京都', name_e: 'tokyo' },
21
+ 14 => { name: '神奈川県', name_e: 'kanagawa' },
22
+ 15 => { name: '新潟県', name_e: 'niigata' },
23
+ 16 => { name: '富山県', name_e: 'toyama' },
24
+ 17 => { name: '石川県', name_e: 'ishikawa' },
25
+ 18 => { name: '福井県', name_e: 'fukui' },
26
+ 19 => { name: '山梨県', name_e: 'yamanashi' },
27
+ 20 => { name: '長野県', name_e: 'nagano' },
28
+ 21 => { name: '岐阜県', name_e: 'gifu' },
29
+ 22 => { name: '静岡県', name_e: 'shizuoka' },
30
+ 23 => { name: '愛知県', name_e: 'aichi' },
31
+ 24 => { name: '三重県', name_e: 'mie' },
32
+ 25 => { name: '滋賀県', name_e: 'shiga' },
33
+ 26 => { name: '京都府', name_e: 'kyoto' },
34
+ 27 => { name: '大阪府', name_e: 'osaka' },
35
+ 28 => { name: '兵庫県', name_e: 'hyogo' },
36
+ 29 => { name: '奈良県', name_e: 'nara' },
37
+ 30 => { name: '和歌山県', name_e: 'wakayama' },
38
+ 31 => { name: '鳥取県', name_e: 'tottori' },
39
+ 32 => { name: '島根県', name_e: 'shimane' },
40
+ 33 => { name: '岡山県', name_e: 'okayama' },
41
+ 34 => { name: '広島県', name_e: 'hiroshima' },
42
+ 35 => { name: '山口県', name_e: 'yamaguchi' },
43
+ 36 => { name: '徳島県', name_e: 'tokushima' },
44
+ 37 => { name: '香川県', name_e: 'kagawa' },
45
+ 38 => { name: '愛媛県', name_e: 'ehime' },
46
+ 39 => { name: '高知県', name_e: 'kochi' },
47
+ 40 => { name: '福岡県', name_e: 'fukuoka' },
48
+ 41 => { name: '佐賀県', name_e: 'saga' },
49
+ 42 => { name: '長崎県', name_e: 'nagasaki' },
50
+ 43 => { name: '熊本県', name_e: 'kumamoto' },
51
+ 44 => { name: '大分県', name_e: 'oita' },
52
+ 45 => { name: '宮崎県', name_e: 'miyazaki' },
53
+ 46 => { name: '鹿児島県', name_e: 'kagoshima' },
54
+ 47 => { name: '沖縄県', name_e: 'okinawa' },
55
55
  }
56
56
  end
57
57
  end
@@ -22,7 +22,7 @@ module JpPrefecture
22
22
 
23
23
  p.code = code
24
24
  p.name = name
25
- p.name_e = name_e
25
+ p.name_e = name_e.capitalize
26
26
 
27
27
  p
28
28
  end
@@ -95,7 +95,7 @@ module JpPrefecture
95
95
  # 名前から都道府県コードを検索
96
96
  def self.find_code_by_name(name)
97
97
  result = PREFECTURE_CODE_NAME.select { |_, v|
98
- v.has_value?(name.capitalize)
98
+ v.has_value?(name.downcase)
99
99
  }.first
100
100
 
101
101
  return if result.nil?
@@ -1,3 +1,3 @@
1
1
  module JpPrefecture
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jp_prefecture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-11 00:00:00.000000000 Z
12
+ date: 2013-06-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake