japan_etc 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/database/japan_etc_tollbooths.csv +6 -6
- data/lib/japan_etc/database_provider/nexco.rb +2 -2
- data/lib/japan_etc/tollbooth.rb +24 -5
- data/lib/japan_etc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 670b30bf29dbabbe8811c7c81cdbad4933547a0ff137fa82219f095dcfa0bb4d
|
4
|
+
data.tar.gz: 94402a9ca0281c8d39e39302db03cc756c47dd7979867bcf4223fc82165c1e99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1b7ad4978d015880789800884719cc767a65888f5479a224526f354167d249865c878158346b870eb8eb404634117f7bcebacd12daff75d0fa9d76ce87eb174
|
7
|
+
data.tar.gz: 40d865a917082deaf61cd8da0dd60cb3fe409b566575c34724adcc9809782d92487ee13e1ae53d20962cd08068f986d0fb6e7fa2bb39e21f7cc9ec15377fcde3
|
@@ -1218,8 +1218,8 @@ tollbooth_id,road_name,route_name,tollbooth_name,direction,entrance_or_exit,note
|
|
1218
1218
|
10-049,東京外環自動車道,,外環三郷西,,,
|
1219
1219
|
03-249,東京外環自動車道,,外環三郷西,,,
|
1220
1220
|
03-260,東京外環自動車道,,外環三郷西,,,
|
1221
|
-
10-050
|
1222
|
-
03-259
|
1221
|
+
10-050,東京外環自動車道,,三郷中央,,,
|
1222
|
+
03-259,東京外環自動車道,,三郷中央,,,
|
1223
1223
|
03-261,東京外環自動車道,,三郷中央,,,
|
1224
1224
|
10-051,東京外環自動車道,,三郷南,,,
|
1225
1225
|
03-251,東京外環自動車道,,三郷南,,,
|
@@ -1567,7 +1567,7 @@ tollbooth_id,road_name,route_name,tollbooth_name,direction,entrance_or_exit,note
|
|
1567
1567
|
01-453,長野自動車道,,塩尻北,,,
|
1568
1568
|
01-454,長野自動車道,,松本,,,
|
1569
1569
|
01-461,長野自動車道,,梓川スマート,,,
|
1570
|
-
01-455
|
1570
|
+
01-455,長野自動車道,,安曇野,,,
|
1571
1571
|
01-456,長野自動車道,,麻績,,,
|
1572
1572
|
01-449,長野自動車道,,姨捨スマート,,,
|
1573
1573
|
04-797,新東名高速道路,,厚木南,,,
|
@@ -2389,9 +2389,9 @@ tollbooth_id,road_name,route_name,tollbooth_name,direction,entrance_or_exit,note
|
|
2389
2389
|
03-568,京葉道路,,篠崎,上り,,
|
2390
2390
|
03-569,京葉道路,,篠崎,下り,,
|
2391
2391
|
03-571,京葉道路,,京葉JCT,上り,,
|
2392
|
-
03-570
|
2393
|
-
03-572
|
2394
|
-
03-573
|
2392
|
+
03-570,京葉道路,,京葉市川,上り,,
|
2393
|
+
03-572,京葉道路,,京葉市川,上り,,
|
2394
|
+
03-573,京葉道路,,京葉市川,下り,,
|
2395
2395
|
03-077,京葉道路,,原木,,,
|
2396
2396
|
03-576,京葉道路,,原木,上り,,
|
2397
2397
|
03-575,京葉道路,,原木,下り,,
|
@@ -12,14 +12,14 @@ module JapanETC
|
|
12
12
|
include Util
|
13
13
|
|
14
14
|
# NEXCO East
|
15
|
-
URL = 'https://www.driveplaza.com/traffic/tolls_etc/etc_area/pdf/all01.pdf'
|
15
|
+
# URL = 'https://www.driveplaza.com/traffic/tolls_etc/etc_area/pdf/all01.pdf'
|
16
16
|
|
17
17
|
# NEXCO Central
|
18
18
|
# NOTE: This PDF has issues with text encoding
|
19
19
|
# URL = 'https://highwaypost.c-nexco.co.jp/faq/etc/use/documents/etcriyoukanouic.pdf'
|
20
20
|
|
21
21
|
# NEXCO West
|
22
|
-
|
22
|
+
URL = 'https://www.w-nexco.co.jp/etc/maintenance/pdfs/list01.pdf'
|
23
23
|
|
24
24
|
WHITESPACE = /[\s ]/.freeze
|
25
25
|
|
data/lib/japan_etc/tollbooth.rb
CHANGED
@@ -38,11 +38,7 @@ module JapanETC
|
|
38
38
|
@notes = []
|
39
39
|
notes << normalize(note) if note
|
40
40
|
|
41
|
-
|
42
|
-
extract_direction_from_notes!
|
43
|
-
extract_entrance_or_exit_from_notes!
|
44
|
-
extract_direction_from_name!
|
45
|
-
extract_entrance_or_exit_from_name!
|
41
|
+
normalize!
|
46
42
|
end
|
47
43
|
|
48
44
|
def initialize_copy(original)
|
@@ -71,6 +67,16 @@ module JapanETC
|
|
71
67
|
].flatten
|
72
68
|
end
|
73
69
|
|
70
|
+
def normalize!
|
71
|
+
extract_notes_from_name!
|
72
|
+
extract_direction_from_notes!
|
73
|
+
extract_entrance_or_exit_from_notes!
|
74
|
+
extract_direction_from_name!
|
75
|
+
extract_entrance_or_exit_from_name!
|
76
|
+
name_was_changed = extract_name_from_notes!
|
77
|
+
normalize! if name_was_changed
|
78
|
+
end
|
79
|
+
|
74
80
|
def extract_notes_from_name!
|
75
81
|
name.sub!(/(?<head>.+?)?\s*[(\(](?<note>.+?)[)\)]\s*(?<tail>.+)?/) do
|
76
82
|
match = Regexp.last_match
|
@@ -155,6 +161,19 @@ module JapanETC
|
|
155
161
|
end
|
156
162
|
end
|
157
163
|
|
164
|
+
def extract_name_from_notes!
|
165
|
+
name_was_changed = notes.reject! do |note|
|
166
|
+
match = note.match(/「(?<new_name>.+?)」へ名称変更/)
|
167
|
+
next false unless match
|
168
|
+
|
169
|
+
@name = normalize(match[:new_name])
|
170
|
+
|
171
|
+
true
|
172
|
+
end
|
173
|
+
|
174
|
+
name_was_changed
|
175
|
+
end
|
176
|
+
|
158
177
|
def prepend_to_notes(note)
|
159
178
|
note = normalize(note)
|
160
179
|
notes.prepend(note)
|
data/lib/japan_etc/version.rb
CHANGED