ken_all 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +56 -56
- data/ken_all.gemspec +2 -2
- data/lib/ken_all/import.rb +17 -15
- data/lib/ken_all/version.rb +1 -1
- data/spec/lib/ken_all_spec.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55d4a1ede60427c136f5c6a2cbf2388f8f098f60e0846e53f0847a2abe17307b
|
4
|
+
data.tar.gz: 2a98902d3d74ddfad2d137db398e7e7131fcef7a4d072f91c2dfb67454cd3887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d00c447625c7906fa08402868c852d7c6f2679cf25007ed0f95bac311c55b33662a9bc3b47b2189437bc38b6fca9142a2b565fa66894bcb58a7ac763fe99723
|
7
|
+
data.tar.gz: b89914e04419fa13ec8e5f979c0af460515f48c499c5ff143763d2cab235f0ba6c89d6540a3ae37ef2dc8d7ea384227015e5e2a81878e373fb6c413382987b0a
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ken_all (0.
|
5
|
-
activerecord-import (
|
4
|
+
ken_all (0.4.0)
|
5
|
+
activerecord-import (>= 0.4)
|
6
6
|
curses (~> 1.0)
|
7
7
|
rails (>= 3.0.9)
|
8
8
|
rubyzip (>= 1.2)
|
@@ -10,107 +10,107 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actioncable (5.2.
|
14
|
-
actionpack (= 5.2.
|
13
|
+
actioncable (5.2.4.2)
|
14
|
+
actionpack (= 5.2.4.2)
|
15
15
|
nio4r (~> 2.0)
|
16
16
|
websocket-driver (>= 0.6.1)
|
17
|
-
actionmailer (5.2.
|
18
|
-
actionpack (= 5.2.
|
19
|
-
actionview (= 5.2.
|
20
|
-
activejob (= 5.2.
|
17
|
+
actionmailer (5.2.4.2)
|
18
|
+
actionpack (= 5.2.4.2)
|
19
|
+
actionview (= 5.2.4.2)
|
20
|
+
activejob (= 5.2.4.2)
|
21
21
|
mail (~> 2.5, >= 2.5.4)
|
22
22
|
rails-dom-testing (~> 2.0)
|
23
|
-
actionpack (5.2.
|
24
|
-
actionview (= 5.2.
|
25
|
-
activesupport (= 5.2.
|
26
|
-
rack (~> 2.0)
|
23
|
+
actionpack (5.2.4.2)
|
24
|
+
actionview (= 5.2.4.2)
|
25
|
+
activesupport (= 5.2.4.2)
|
26
|
+
rack (~> 2.0, >= 2.0.8)
|
27
27
|
rack-test (>= 0.6.3)
|
28
28
|
rails-dom-testing (~> 2.0)
|
29
29
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
30
|
-
actionview (5.2.
|
31
|
-
activesupport (= 5.2.
|
30
|
+
actionview (5.2.4.2)
|
31
|
+
activesupport (= 5.2.4.2)
|
32
32
|
builder (~> 3.1)
|
33
33
|
erubi (~> 1.4)
|
34
34
|
rails-dom-testing (~> 2.0)
|
35
35
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
36
|
-
activejob (5.2.
|
37
|
-
activesupport (= 5.2.
|
36
|
+
activejob (5.2.4.2)
|
37
|
+
activesupport (= 5.2.4.2)
|
38
38
|
globalid (>= 0.3.6)
|
39
|
-
activemodel (5.2.
|
40
|
-
activesupport (= 5.2.
|
41
|
-
activerecord (5.2.
|
42
|
-
activemodel (= 5.2.
|
43
|
-
activesupport (= 5.2.
|
39
|
+
activemodel (5.2.4.2)
|
40
|
+
activesupport (= 5.2.4.2)
|
41
|
+
activerecord (5.2.4.2)
|
42
|
+
activemodel (= 5.2.4.2)
|
43
|
+
activesupport (= 5.2.4.2)
|
44
44
|
arel (>= 9.0)
|
45
|
-
activerecord-import (0.
|
45
|
+
activerecord-import (1.0.5)
|
46
46
|
activerecord (>= 3.2)
|
47
|
-
activestorage (5.2.
|
48
|
-
actionpack (= 5.2.
|
49
|
-
activerecord (= 5.2.
|
47
|
+
activestorage (5.2.4.2)
|
48
|
+
actionpack (= 5.2.4.2)
|
49
|
+
activerecord (= 5.2.4.2)
|
50
50
|
marcel (~> 0.3.1)
|
51
|
-
activesupport (5.2.
|
51
|
+
activesupport (5.2.4.2)
|
52
52
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
53
53
|
i18n (>= 0.7, < 2)
|
54
54
|
minitest (~> 5.1)
|
55
55
|
tzinfo (~> 1.1)
|
56
56
|
arel (9.0.0)
|
57
|
-
builder (3.2.
|
58
|
-
concurrent-ruby (1.1.
|
59
|
-
crass (1.0.
|
60
|
-
curses (1.3.
|
57
|
+
builder (3.2.4)
|
58
|
+
concurrent-ruby (1.1.6)
|
59
|
+
crass (1.0.6)
|
60
|
+
curses (1.3.2)
|
61
61
|
diff-lcs (1.3)
|
62
62
|
erubi (1.9.0)
|
63
63
|
ffi (1.11.1)
|
64
64
|
globalid (0.4.2)
|
65
65
|
activesupport (>= 4.2.0)
|
66
|
-
i18n (1.
|
66
|
+
i18n (1.8.2)
|
67
67
|
concurrent-ruby (~> 1.0)
|
68
68
|
listen (3.2.0)
|
69
69
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
70
70
|
rb-inotify (~> 0.9, >= 0.9.10)
|
71
|
-
loofah (2.
|
71
|
+
loofah (2.5.0)
|
72
72
|
crass (~> 1.0.2)
|
73
73
|
nokogiri (>= 1.5.9)
|
74
74
|
mail (2.7.1)
|
75
75
|
mini_mime (>= 0.1.1)
|
76
76
|
marcel (0.3.3)
|
77
77
|
mimemagic (~> 0.3.2)
|
78
|
-
method_source (0.
|
79
|
-
mimemagic (0.3.
|
78
|
+
method_source (1.0.0)
|
79
|
+
mimemagic (0.3.5)
|
80
80
|
mini_mime (1.0.2)
|
81
81
|
mini_portile2 (2.4.0)
|
82
|
-
minitest (5.
|
82
|
+
minitest (5.14.1)
|
83
83
|
nio4r (2.5.2)
|
84
|
-
nokogiri (1.10.
|
84
|
+
nokogiri (1.10.9)
|
85
85
|
mini_portile2 (~> 2.4.0)
|
86
|
-
rack (2.
|
86
|
+
rack (2.2.2)
|
87
87
|
rack-test (1.1.0)
|
88
88
|
rack (>= 1.0, < 3)
|
89
|
-
rails (5.2.
|
90
|
-
actioncable (= 5.2.
|
91
|
-
actionmailer (= 5.2.
|
92
|
-
actionpack (= 5.2.
|
93
|
-
actionview (= 5.2.
|
94
|
-
activejob (= 5.2.
|
95
|
-
activemodel (= 5.2.
|
96
|
-
activerecord (= 5.2.
|
97
|
-
activestorage (= 5.2.
|
98
|
-
activesupport (= 5.2.
|
89
|
+
rails (5.2.4.2)
|
90
|
+
actioncable (= 5.2.4.2)
|
91
|
+
actionmailer (= 5.2.4.2)
|
92
|
+
actionpack (= 5.2.4.2)
|
93
|
+
actionview (= 5.2.4.2)
|
94
|
+
activejob (= 5.2.4.2)
|
95
|
+
activemodel (= 5.2.4.2)
|
96
|
+
activerecord (= 5.2.4.2)
|
97
|
+
activestorage (= 5.2.4.2)
|
98
|
+
activesupport (= 5.2.4.2)
|
99
99
|
bundler (>= 1.3.0)
|
100
|
-
railties (= 5.2.
|
100
|
+
railties (= 5.2.4.2)
|
101
101
|
sprockets-rails (>= 2.0.0)
|
102
102
|
rails-dom-testing (2.0.3)
|
103
103
|
activesupport (>= 4.2.0)
|
104
104
|
nokogiri (>= 1.6)
|
105
105
|
rails-html-sanitizer (1.3.0)
|
106
106
|
loofah (~> 2.3)
|
107
|
-
railties (5.2.
|
108
|
-
actionpack (= 5.2.
|
109
|
-
activesupport (= 5.2.
|
107
|
+
railties (5.2.4.2)
|
108
|
+
actionpack (= 5.2.4.2)
|
109
|
+
activesupport (= 5.2.4.2)
|
110
110
|
method_source
|
111
111
|
rake (>= 0.8.7)
|
112
112
|
thor (>= 0.19.0, < 2.0)
|
113
|
-
rake (13.0.
|
113
|
+
rake (13.0.1)
|
114
114
|
rb-fsevent (0.10.3)
|
115
115
|
rb-inotify (0.10.0)
|
116
116
|
ffi (~> 1.0)
|
@@ -131,7 +131,7 @@ GEM
|
|
131
131
|
rspec-mocks (~> 3.9.0)
|
132
132
|
rspec-support (~> 3.9.0)
|
133
133
|
rspec-support (3.9.0)
|
134
|
-
rubyzip (2.
|
134
|
+
rubyzip (2.3.0)
|
135
135
|
sprockets (4.0.0)
|
136
136
|
concurrent-ruby (~> 1.0)
|
137
137
|
rack (> 1, < 3)
|
@@ -140,9 +140,9 @@ GEM
|
|
140
140
|
activesupport (>= 4.0)
|
141
141
|
sprockets (>= 3.0.0)
|
142
142
|
sqlite3 (1.4.1)
|
143
|
-
thor (0.
|
143
|
+
thor (1.0.1)
|
144
144
|
thread_safe (0.3.6)
|
145
|
-
tzinfo (1.2.
|
145
|
+
tzinfo (1.2.7)
|
146
146
|
thread_safe (~> 0.1)
|
147
147
|
websocket-driver (0.7.1)
|
148
148
|
websocket-extensions (>= 0.1.0)
|
@@ -154,7 +154,7 @@ PLATFORMS
|
|
154
154
|
DEPENDENCIES
|
155
155
|
ken_all!
|
156
156
|
listen
|
157
|
-
rails (
|
157
|
+
rails (= 5.2.4.2)
|
158
158
|
rspec-rails
|
159
159
|
sqlite3
|
160
160
|
|
data/ken_all.gemspec
CHANGED
@@ -20,12 +20,12 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
21
21
|
s.require_paths = ['lib']
|
22
22
|
|
23
|
-
s.add_dependency "activerecord-import","
|
23
|
+
s.add_dependency "activerecord-import",">= 0.4"
|
24
24
|
s.add_dependency "rails", ">= 3.0.9"
|
25
25
|
s.add_dependency "rubyzip", '>= 1.2'
|
26
26
|
s.add_dependency "curses", '~> 1.0'
|
27
27
|
s.add_development_dependency 'listen'
|
28
28
|
s.add_development_dependency "sqlite3"
|
29
29
|
s.add_development_dependency "rspec-rails"
|
30
|
-
s.add_development_dependency 'rails', '
|
30
|
+
s.add_development_dependency 'rails', '5.2.4.2'
|
31
31
|
end
|
data/lib/ken_all/import.rb
CHANGED
@@ -7,18 +7,18 @@ module KenAll
|
|
7
7
|
class Import
|
8
8
|
URI = "http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip"
|
9
9
|
|
10
|
-
def initialize(opt = {visualize: true})
|
10
|
+
def initialize(opt = { visualize: true })
|
11
11
|
@visualizer = KenAll::Visualizer.new(opt[:visualize])
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
$ rake
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
return unless old_schema?
|
13
|
+
|
14
|
+
error = <<~ERROR
|
15
|
+
KenAll Error.
|
16
|
+
This project is using old schema information.
|
17
|
+
Type First.
|
18
|
+
$ rake ken_all:install:migrations
|
19
|
+
$ rake db:migrate
|
20
|
+
ERROR
|
21
|
+
raise KenAll::OldSchemaException.new(error)
|
22
22
|
end
|
23
23
|
|
24
24
|
def from_net
|
@@ -97,9 +97,11 @@ EOS
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
100
|
+
private
|
101
|
+
|
102
|
+
def old_schema?
|
103
|
+
column = KenAll::PostalCode.columns.find { |v| v.name == 'address1' }
|
104
|
+
column.sql_type !~ /text/
|
105
|
+
end
|
104
106
|
end
|
105
107
|
end
|
data/lib/ken_all/version.rb
CHANGED
data/spec/lib/ken_all_spec.rb
CHANGED
@@ -97,7 +97,7 @@ EOS
|
|
97
97
|
context 'スキーマ情報が古い場合' do
|
98
98
|
let(:column){ double('Column', sql_type: 'varchar(255)') }
|
99
99
|
before do
|
100
|
-
allow(KenAll::PostalCode.columns).to receive(:
|
100
|
+
allow(KenAll::PostalCode.columns).to receive(:find) { column }
|
101
101
|
end
|
102
102
|
it '例外が発生すること' do
|
103
103
|
expect {KenAll::Import.new}.to raise_error(KenAll::OldSchemaException)
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ken_all
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yamamoto Kazuhisa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-import
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -112,16 +112,16 @@ dependencies:
|
|
112
112
|
name: rails
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 5.2.4.2
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 5.2.4.2
|
125
125
|
description: Japanese postal code tools.
|
126
126
|
email:
|
127
127
|
- ak.hisashi@gmail.com
|