Skip to content

Commit f6b49ef

Browse files
committed
Cosmetic: Pass options for JSON.load via hash variable
1 parent f682864 commit f6b49ef

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

upsert_dojos_geojson.rb

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,11 @@
77
events_japan = []
88
zen2japan = {}
99

10-
File.open("dojos_earth.json") do |file|
11-
dojos_earth = JSON.load(file, nil, symbolize_names: true, create_additions: false)
12-
end
13-
14-
File.open("dojos_japan.json") do |file|
15-
dojos_japan = JSON.load(file, nil, symbolize_names: true, create_additions: false)
16-
end
17-
18-
File.open("events_japan.json") do |file|
19-
events_japan = JSON.load(file, nil, symbolize_names: true, create_additions: false)
20-
end
10+
json_load_options = { symbolize_names: true, create_additions: false }
11+
File.open("dojos_earth.json") {|file| dojos_earth = JSON.load(file, nil, json_load_options) }
12+
File.open("dojos_japan.json") {|file| dojos_japan = JSON.load(file, nil, json_load_options) }
13+
File.open("events_japan.json"){|file| events_japan = JSON.load(file, nil, json_load_options) }
14+
#pp dojos_earth.first, dojos_japan.first, events_japan.first
2115

2216
# Sample format of dojo2dojo.csv:
2317
# Japan登録名 Zen登録名

0 commit comments

Comments
 (0)