Skip to content

Commit ecacf55

Browse files
authored
Merge pull request #23 from coderdojo-japan/move-dojos-japan-to-data-dir
すべての JSON データファイルを _data ディレクトリに移動
2 parents b35a054 + b0169b9 commit ecacf55

File tree

8 files changed

+8
-10
lines changed

8 files changed

+8
-10
lines changed

.github/workflows/scheduler_daily.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ jobs:
7171
git add Gemfile.lock
7272
7373
# Cache responses from Japan/Clubs APIs
74-
git add _data/dojos_earth.json
75-
git add dojos_japan.json
76-
git add events_japan.json
74+
git add _data/*.json
7775
git add images/dojos
7876
7977
# Save GeoJSON data to render DojoMap
File renamed without changes.

cache_dojo_logos.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Caching images from coderdojo.jp to local filesystem
66
dojos_japan = []
7-
File.open('dojos_japan.json') do |file|
7+
File.open('_data/dojos_japan.json') do |file|
88
dojos_japan = JSON.load(file, nil, symbolize_names: true, create_additions: false)
99
end
1010

get_data_from_japan.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
EVENTS_DATA = JSON.parse Net::HTTP.get(URI.parse "#{BASE_URL}/events.json"), symbolize_names: true
1010
EVENTS_JSON = JSON.pretty_generate EVENTS_DATA.sort_by{|dojo| dojo[:id]}
1111

12-
File.open("dojos_japan.json", "w") { |file| file.write(DOJOS_JSON) }
13-
File.open("events_japan.json", "w") { |file| file.write(EVENTS_JSON) }
12+
File.open("_data/dojos_japan.json", "w") { |file| file.write(DOJOS_JSON) }
13+
File.open("_data/events_japan.json", "w") { |file| file.write(EVENTS_JSON) }
1414

1515
# Show next step for developers
1616
puts DOJOS_JSON
1717
puts ''
1818
puts 'Check out JSON data you fetched by:'
19-
puts '$ cat dojos_japan.json'
19+
puts '$ cat _data/dojos_japan.json'
2020
puts ''
2121
puts EVENTS_JSON
2222
puts ''
2323
puts 'Check out JSON data you fetched by:'
24-
puts '$ cat events_japan.json'
24+
puts '$ cat _data/events_japan.json'
2525
puts ''

upsert_dojos_geojson.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
json_load_options = { symbolize_names: true, create_additions: false }
1111
File.open("_data/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) }
12+
File.open("_data/dojos_japan.json") {|file| dojos_japan = JSON.load(file, nil, json_load_options) }
13+
File.open("_data/events_japan.json"){|file| events_japan = JSON.load(file, nil, json_load_options) }
1414
#pp dojos_earth.first, dojos_japan.first, events_japan.first
1515

1616
# dojo2dojo.csv で Clubs DB と Japan DB のクラブ名を突合する

0 commit comments

Comments
 (0)