jipcode-address_locator 0.1.1 → 0.1.2

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: 88540f570e9468b62d7bb0cf8412a7502f9498ac6d36b1ad8c5d361b919baece
4
- data.tar.gz: 71534dc3a70ad972b8dd6833bed51022c6a6d90dfad86d4fe52e0f354febb8e9
3
+ metadata.gz: 5872bdfefa7c475edb16ff88c5bd801acdbb54497dd83d9f74fd903b1831cf2b
4
+ data.tar.gz: f6d7b489e89071702af28f13e71a0a4de91e14caaa97d70b8bb856e58d6d78ee
5
5
  SHA512:
6
- metadata.gz: 627e8115e8dfd99daa16e9bfdbbe128c5d67baff42a3c92fede5303d85743b266ed503c9923c9f6ce2577f27c299c53bd450f6e88b20af181f0d706012305180
7
- data.tar.gz: ff134cb1873b7a0b7ad0ea481a23d86e7ce24cf97f0e5bb7c8e81e9b2e7bbc9a848c746dbc675e6c857dcbbd4add76ba314fb3bc76de85dd1823eef5abb6c690
6
+ metadata.gz: f4cfe55f2198406bc506e20dc69239aadd61d9734c6700fca94cd563a1f124488628f3c7caf541df14894a8c082134716e3b4bbfadee1070bab013da8ce08187
7
+ data.tar.gz: 0dc49d8471c64732fb9e741f74a5fa04440ffe5d5c2e58fc905cd02bb2250d97d5e1cb1eb4b680c697054ee0543224f0e3998eb7f8b484cdfd01e24e0d4fb072
@@ -0,0 +1,35 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches: '*'
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - name: Set up Ruby 3.2
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: 3.2
18
+ - name: Build and test with Rake
19
+ run: |
20
+ gem install bundler
21
+ bundle install --jobs 4 --retry 3
22
+ bundle exec rspec
23
+ lint:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v3
27
+ - name: Set up Ruby 3.2
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: 3.2
31
+ - name: Build and test with Rake
32
+ run: |
33
+ gem install bundler
34
+ bundle install --jobs 4 --retry 3
35
+ bundle exec rubocop
data/.rubocop.yml CHANGED
@@ -1,3 +1,10 @@
1
+ require:
2
+ - rubocop-rake
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ NewCops: enable
7
+
1
8
  Naming/FileName:
2
9
  Enabled: false
3
10
 
@@ -13,3 +20,12 @@ Style/Documentation:
13
20
 
14
21
  Style/AsciiComments:
15
22
  Enabled: false
23
+
24
+ RSpec/ContextWording:
25
+ Enabled: false
26
+
27
+ RSpec/FilePath:
28
+ Enabled: false
29
+
30
+ RSpec/NamedSubject:
31
+ Enabled: false
data/Gemfile CHANGED
@@ -6,3 +6,12 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
7
7
  # Specify your gem's dependencies in jipcode.gemspec
8
8
  gemspec
9
+
10
+ # for development
11
+ gem 'bundler'
12
+ gem 'byebug'
13
+ gem 'rake'
14
+ gem 'rspec'
15
+ gem 'rubocop'
16
+ gem 'rubocop-rake'
17
+ gem 'rubocop-rspec'
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/jipcode-address_locator.svg)](https://badge.fury.io/rb/jipcode-address_locator)
2
- [![Build Status](https://travis-ci.com/oieioi/jipcode-address_locator.svg?branch=master)](https://travis-ci.com/oieioi/jipcode-address_locator)
2
+ ![Ruby](https://github.com/oieioi/jipcode-address_locator/workflows/Ruby/badge.svg)
3
3
 
4
4
  # Jipcode::AddressLocator
5
5
 
@@ -9,6 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.version = Jipcode::AddressLocator::VERSION
10
10
  spec.authors = ['oieioi']
11
11
  spec.email = ['atsuinatsu.samuifuyu@gmail.com']
12
+ spec.required_ruby_version = '>= 2.7.0'
12
13
 
13
14
  spec.summary = 'Extend jipcode.gem to locate zipcode data by address'
14
15
  spec.description = 'Extend jipcode.gem to locate zipcode data by address'
@@ -21,10 +22,6 @@ Gem::Specification.new do |spec|
21
22
  spec.require_paths = ['lib']
22
23
 
23
24
  spec.add_dependency 'jaro_winkler', '~> 1.5.3'
24
- spec.add_dependency 'jipcode', '>= 1.5.0'
25
- spec.add_development_dependency 'bundler'
26
- spec.add_development_dependency 'byebug'
27
- spec.add_development_dependency 'rake'
28
- spec.add_development_dependency 'rspec'
29
- spec.add_development_dependency 'rubocop'
25
+ spec.add_dependency 'jipcode', '>= 1.5.0', '< 3.0'
26
+ spec.metadata['rubygems_mfa_required'] = 'true'
30
27
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'csv'
4
+ require 'fileutils'
4
5
  require 'jipcode/address_locator/helper'
5
6
  require 'jipcode/address_locator/normalizer'
6
7
 
@@ -23,20 +24,18 @@ module Jipcode
23
24
 
24
25
  export_index(index)
25
26
 
26
- File.open(INDEX_VERSION_FILE, 'w') do |f|
27
- f.write(Jipcode::VERSION)
28
- end
27
+ File.write(INDEX_VERSION_FILE, Jipcode::VERSION)
29
28
  end
30
29
 
31
30
  # @private
32
31
  def self.refresh_index_dir
33
- FileUtils.rm_rf(INDEX_PATH) if File.exist?(INDEX_PATH)
32
+ FileUtils.rm_rf(INDEX_PATH)
34
33
  Dir.mkdir(INDEX_PATH)
35
34
  end
36
35
 
37
36
  # @private
38
37
  def self.collect_index
39
- index = 47.times.each_with_object({}) { |item, memo| memo[item + 1] = []; }
38
+ index = 47.times.each_with_object({}) { |item, memo| memo[item + 1] = [] }
40
39
 
41
40
  Dir.glob("#{ZIPCODE_PATH}/*.csv").each do |file_name|
42
41
  CSV.read(file_name).each do |row|
@@ -10,8 +10,8 @@ module Jipcode
10
10
  # @return [String] normalized address
11
11
  def self.normalize_address(raw_address)
12
12
  zenkaku2hankaku(raw_address)
13
- .yield_self { |address| kansuji2hankaku(address) }
14
- .yield_self { |address| jukyohyouji2hyphen(address) }
13
+ .then { |address| kansuji2hankaku(address) }
14
+ .then { |address| jukyohyouji2hyphen(address) }
15
15
  end
16
16
 
17
17
  # 全角数字ハイフン→半角数字ハイフン
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jipcode
4
4
  module AddressLocator
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jipcode-address_locator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - oieioi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-20 00:00:00.000000000 Z
11
+ date: 2023-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jaro_winkler
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.5.0
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '3.0'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,76 +41,9 @@ dependencies:
38
41
  - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: 1.5.0
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: byebug
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
44
+ - - "<"
67
45
  - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rake
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'
83
- - !ruby/object:Gem::Dependency
84
- name: rspec
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: rubocop
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'
46
+ version: '3.0'
111
47
  description: Extend jipcode.gem to locate zipcode data by address
112
48
  email:
113
49
  - atsuinatsu.samuifuyu@gmail.com
@@ -115,10 +51,10 @@ executables: []
115
51
  extensions: []
116
52
  extra_rdoc_files: []
117
53
  files:
54
+ - ".github/workflows/ruby.yml"
118
55
  - ".gitignore"
119
56
  - ".rspec"
120
57
  - ".rubocop.yml"
121
- - ".travis.yml"
122
58
  - Gemfile
123
59
  - LICENSE
124
60
  - README.md
@@ -137,8 +73,9 @@ files:
137
73
  homepage: https://github.com/oieioi/jipcode-address_locator
138
74
  licenses:
139
75
  - MIT
140
- metadata: {}
141
- post_install_message:
76
+ metadata:
77
+ rubygems_mfa_required: 'true'
78
+ post_install_message:
142
79
  rdoc_options: []
143
80
  require_paths:
144
81
  - lib
@@ -146,15 +83,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
83
  requirements:
147
84
  - - ">="
148
85
  - !ruby/object:Gem::Version
149
- version: '0'
86
+ version: 2.7.0
150
87
  required_rubygems_version: !ruby/object:Gem::Requirement
151
88
  requirements:
152
89
  - - ">="
153
90
  - !ruby/object:Gem::Version
154
91
  version: '0'
155
92
  requirements: []
156
- rubygems_version: 3.0.3
157
- signing_key:
93
+ rubygems_version: 3.3.3
94
+ signing_key:
158
95
  specification_version: 4
159
96
  summary: Extend jipcode.gem to locate zipcode data by address
160
97
  test_files: []
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.5.0
6
- before_install:
7
- - gem install bundler -v 1.16.1
8
- script:
9
- - bundle exec rubocop
10
- - bundle exec rspec