jp_prefecture 0.8.0 → 0.8.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a6fc2c7b381afa449625bf8295c9dde2e89025e
4
- data.tar.gz: 8860880c91399cf152aed754e2206f48c399ed1e
3
+ metadata.gz: c6636c60d594d140725ac2f9b01c6724b66328e3
4
+ data.tar.gz: dfb83ab23f2bb8be09afc748d17f3b51180e2e7b
5
5
  SHA512:
6
- metadata.gz: 2366a6fc0884ef37a5bb2f687d5afeb91397e6c18bc4c62edff017154039a3cf29801026b0b94a81c09cec47dc214612a27f3349b365ebdebd151d07c2b7a90a
7
- data.tar.gz: 412f4586f1b44c6c2c13e22da5d906c85459f292849fed471945de8ec704279b0e6474c04be2f3fc422dfaded9f9770be5d3cadafdd772add8a78c6af9b9c88c
6
+ metadata.gz: d8e91fddb44bc5cfbce465c541a5ca3312afaf8412900fbf122591a64a2215f1b29900d4437149a800be5d67ba28e0ceaaa37cae7c1c7cfe8d2eeafdfaa257d8
7
+ data.tar.gz: c5fa940c3614cb491f32f5bf740e2140a02dde3ca8f42af4bb8adcdf5da941ad09470f298042702760a07afeabc3d507237e6349805655368d801e0b286f3791
@@ -1,4 +1,13 @@
1
+ language: ruby
2
+ sudo: false
1
3
  rvm:
2
4
  - 1.9.3
3
5
  - 2.0.0
4
- - 2.1.2
6
+ - 2.1.8
7
+ - 2.2.4
8
+ - 2.3.0
9
+ - ruby-head
10
+ matrix:
11
+ allow_failures:
12
+ - rvm: ruby-head
13
+ fast_finish: true
@@ -1,3 +1,7 @@
1
+ ## 0.8.1 (Mar 30, 2016)
2
+
3
+ * `JpPrefecture::Prefecture.find(name: name)` に `nil` や空文字を渡した時に `nil` を返す (Issue [#18](https://github.com/chocoby/jp_prefecture/issues/18)/PR [#19](https://github.com/chocoby/jp_prefecture/pull/19)/[@k-motoyan](https://github.com/k-motoyan))
4
+
1
5
  ## 0.8.0 (Sep 07, 2014)
2
6
 
3
7
  * 都道府県情報に八地方区分情報を追加 (PR [#14](https://github.com/chocoby/jp_prefecture/pull/14)/[@kkosuge](https://github.com/kkosuge))
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # JpPrefecture
2
2
 
3
- [![Build Status](http://img.shields.io/travis/chocoby/jp_prefecture/master.svg)](https://travis-ci.org/chocoby/jp_prefecture)
4
- [![Dependency Status](http://img.shields.io/gemnasium/chocoby/jp_prefecture.svg)](https://gemnasium.com/chocoby/jp_prefecture)
5
- [![Gem Version](http://img.shields.io/gem/v/jp_prefecture.svg)](https://rubygems.org/gems/jp_prefecture)
3
+ [![Gem Version](http://img.shields.io/gem/v/jp_prefecture.svg?style=flat)](https://rubygems.org/gems/jp_prefecture)
4
+ [![Build Status](http://img.shields.io/travis/chocoby/jp_prefecture/master.svg?style=flat)](https://travis-ci.org/chocoby/jp_prefecture)
5
+ [![Coveralls](https://img.shields.io/coveralls/chocoby/jp_prefecture.svg)](https://coveralls.io/r/chocoby/jp_prefecture)
6
+ [![Code Climate](https://img.shields.io/codeclimate/github/chocoby/jp_prefecture.svg)](https://codeclimate.com/github/chocoby/jp_prefecture)
7
+ [![Dependency Status](http://img.shields.io/gemnasium/chocoby/jp_prefecture.svg?style=flat)](https://gemnasium.com/chocoby/jp_prefecture)
6
8
 
7
9
  https://rubygems.org/gems/jp_prefecture
8
10
 
@@ -178,10 +180,10 @@ end
178
180
 
179
181
  GitHub の [Issues](https://github.com/chocoby/jp_prefecture/issues) を参照してください。
180
182
 
181
- ## 対象バージョン
183
+ ## サポートしているバージョン
182
184
 
183
- * Ruby: 1.9.3 / 2.0 / 2.1
184
- * Rails: 3.2 / 4.0 / 4.1
185
+ * Ruby: 1.9.3 / 2.0.0 / 2.1 / 2.2 / 2.3
186
+ * Rails: 3.2 / 4.0 / 4.1 / 4.2
185
187
 
186
188
  ## Contributing
187
189
 
@@ -206,4 +208,4 @@ https://github.com/chocoby/jp_prefecture
206
208
 
207
209
  ## ライセンス
208
210
 
209
- MIT: http://chocoby.mit-license.org/
211
+ [MIT License](http://chocoby.mit-license.org/)
@@ -19,4 +19,5 @@ Gem::Specification.new do |gem|
19
19
  gem.add_development_dependency 'rspec', '~> 3.1'
20
20
  gem.add_development_dependency 'activerecord', '>= 3.2.0'
21
21
  gem.add_development_dependency 'sqlite3'
22
+ gem.add_development_dependency 'coveralls'
22
23
  end
@@ -115,6 +115,8 @@ module JpPrefecture
115
115
  # @return [Integer] 見つかった場合は都道府県コード
116
116
  # @return [nil] 見つからない場合は nil
117
117
  def self.find_code_by_name(name)
118
+ return nil if name.nil? || name.empty?
119
+
118
120
  name = name.downcase
119
121
 
120
122
  Mapping.data.each do |m|
@@ -1,3 +1,3 @@
1
1
  module JpPrefecture
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
@@ -127,6 +127,20 @@ describe JpPrefecture::Prefecture do
127
127
  JpPrefecture::Prefecture.find(name: name)
128
128
  expect(name).to eq 'hokkaido'
129
129
  end
130
+
131
+ context '空の文字列が与えられた場合' do
132
+ it 'nilを返すこと' do
133
+ actual = JpPrefecture::Prefecture.find(name: '')
134
+ expect(actual).to be_nil
135
+ end
136
+ end
137
+
138
+ context 'nilが与えられた場合' do
139
+ it 'nilを返すこと' do
140
+ actual = JpPrefecture::Prefecture.find(name: nil)
141
+ expect(actual).to be_nil
142
+ end
143
+ end
130
144
  end
131
145
 
132
146
  context 'zip の場合' do
@@ -1,4 +1,9 @@
1
1
  # coding: utf-8
2
+ if ENV['CI']
3
+ require 'coveralls'
4
+ Coveralls.wear!
5
+ end
6
+
2
7
  require 'jp_prefecture'
3
8
  require "active_record"
4
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jp_prefecture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - chocoby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-07 00:00:00.000000000 Z
11
+ date: 2016-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: Convert japan prefecture code(JIS X 0402 based) into prefecture name.
70
84
  email:
71
85
  - chocoby@gmail.com
@@ -119,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
133
  version: '0'
120
134
  requirements: []
121
135
  rubyforge_project:
122
- rubygems_version: 2.2.2
136
+ rubygems_version: 2.4.5.1
123
137
  signing_key:
124
138
  specification_version: 4
125
139
  summary: Convert japan prefecture code into prefecture name