jipcode 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d468ee7a5f482ea5e9be32e3311a6d04dcb2ade23f140f72004c189200d4f9f0
4
- data.tar.gz: ebb8fa9b680ea84d44c7effdbb1cf5e28f7bfb071a4f1284e20465bc60a8f374
3
+ metadata.gz: 9061e40ffd2f724d3807e569bbea5c2e21c78904c7ad02cce9f66950f1e17d2a
4
+ data.tar.gz: 86318a4c74ee141ce9384b8d8ed158c8ace0f2d1b2aa32a862645c1e62da225d
5
5
  SHA512:
6
- metadata.gz: 83c7dbf1ba8ef34979c6cca97d0ab2716139adaf389277441b98e46ddc438c049d3a583da2a3ef864039a9d2f085413b216c83d3fdee8c64da8fae5a8c6f98f0
7
- data.tar.gz: e76574f207c228945f21929f5c163dc888e50701db791e785727150c3855bd92579342eb702632f94324de910a530c3380072b9b58b7ae5fa94e2a014842270d
6
+ metadata.gz: f697df606d3eea50ecde98620735cec9286a7c37071b1303d8a6b2336a516716cb750b3dd52138abbb3836ee702d72cf8942957875c09f3d897ecdaa50b63b29
7
+ data.tar.gz: 4932e3b5391ea7ec1b8f504c86d057651260c7d719d4c5ef7daac7da74ccf6be6575793e6df59c7e5542c8f04b402563c9ca6dde7bedc35068007cae2e4b1ac9
data/.travis.yml CHANGED
@@ -3,3 +3,5 @@ language: ruby
3
3
  rvm:
4
4
  - 2.5.0
5
5
  before_install: gem install bundler -v 1.16.1
6
+ script:
7
+ - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then bin/update; fi
data/Gemfile.lock CHANGED
@@ -1,13 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jipcode (1.1.1)
4
+ jipcode (1.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  addressable (2.5.2)
10
10
  public_suffix (>= 2.0.2, < 4.0)
11
+ bump (0.6.0)
11
12
  crack (0.4.3)
12
13
  safe_yaml (~> 1.0.0)
13
14
  diff-lcs (1.3)
@@ -39,6 +40,7 @@ PLATFORMS
39
40
  ruby
40
41
 
41
42
  DEPENDENCIES
43
+ bump
42
44
  bundler (~> 1.16)
43
45
  jipcode!
44
46
  rake (~> 10.0)
data/bin/update ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+
3
+ bundle exec rake update
4
+ git add zipcode/latest
5
+
6
+ if git commit -m '最新の郵便番号データに更新'; then
7
+ bundle exec bump patch -m '郵便番号データの更新に伴うアップデート'
8
+
9
+ git push origin master
10
+ bundle exec rake release
11
+ fi
data/jipcode.gemspec CHANGED
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'rubyzip'
26
26
  spec.add_development_dependency 'webmock'
27
27
  spec.add_development_dependency 'vcr'
28
+ spec.add_development_dependency 'bump'
28
29
  end
data/lib/jipcode.rb CHANGED
@@ -8,8 +8,7 @@ module Jipcode
8
8
  path = "#{ZIPCODE_PATH}/#{zipcode[0..2]}.csv"
9
9
  return [] unless File.exist?(path)
10
10
 
11
- addresses_csv = open(path) { |f| f.read }
12
- addresses_array = CSV.parse(addresses_csv).select { |address| address[0] == zipcode }
11
+ addresses_array = CSV.read(path).select { |address| address[0] == zipcode }
13
12
  addresses_array.map do |address_param|
14
13
  {
15
14
  zipcode: address_param[0],
@@ -20,13 +19,5 @@ module Jipcode
20
19
  end
21
20
  end
22
21
 
23
- def search(zipcode)
24
- warn '[DEPRECATION] `search` is deprecated. Please use `locate` instead.'
25
- path = "#{ZIPCODE_PATH}/#{zipcode[0..2]}.csv"
26
- return [] unless File.exist?(path)
27
- addresses = open(path) { |f| f.read }
28
- CSV.parse(addresses).select { |address| address[0] == zipcode }
29
- end
30
-
31
- module_function :locate, :search
22
+ module_function :locate
32
23
  end
@@ -1,3 +1,3 @@
1
1
  module Jipcode
2
- VERSION = '1.1.1'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jipcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rinkei
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-03 00:00:00.000000000 Z
11
+ date: 2018-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: bump
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: A gem for Japan Post's official zipcode data search & update.
98
112
  email:
99
113
  - kei.h.hayashi@gmail.com
@@ -112,6 +126,7 @@ files:
112
126
  - Rakefile
113
127
  - bin/console
114
128
  - bin/setup
129
+ - bin/update
115
130
  - jipcode.gemspec
116
131
  - lib/jipcode.rb
117
132
  - lib/jipcode/japan_post.rb