Skip to content

Commit 5a4c5ca

Browse files
committed
Refactor: Use same code style to dump JSON file
1 parent ddf4323 commit 5a4c5ca

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

get_data_from_japan.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@
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") do |file|
13-
file.write(DOJOS_JSON)
14-
end
15-
16-
File.open("events_japan.json", "w") do |file|
17-
file.write(EVENTS_JSON)
18-
end
12+
File.open("dojos_japan.json", "w") { |file| file.write(DOJOS_JSON) }
13+
File.open("events_japan.json", "w") { |file| file.write(EVENTS_JSON) }
1914

2015
# Show next step for developers
2116
puts DOJOS_JSON

0 commit comments

Comments
 (0)