Skip to content

Commit

Permalink
Improve logging
Browse files Browse the repository at this point in the history
- Added multiline support for car class files.
- Added multiline support for the tracks file.
  • Loading branch information
BGMP authored and bgm committed Jan 16, 2023
1 parent 1755599 commit 320439e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ task :profile_cars do
data.drop(1).each do |l|
slug = l[0].gsub(' ', '_').downcase

car_line = [
car_lines = [
"\s\s#{slug}:",
"\s\s\s\sname: #{l[0]}",
"\s\s\s\sslug: #{slug}",
Expand All @@ -35,8 +35,11 @@ task :profile_cars do
"\s\s\s\smultiplier: #{l[4]}"
]

puts "Writing car #{car_line} ..."
contents.append(car_line)
car_lines.each do |line|
puts(line)
end

contents.append(car_lines)
end

Dir.mkdir('yml') unless File.exist?('yml')
Expand All @@ -57,14 +60,19 @@ task :profile_tracks do

contents = []

puts('Writing tracks ...')

data = CSV.read("models/tracks/#{f}")
data.drop(1).each do |l|
track_line = [
track_lines = [
"\"#{l[0]}\": #{l[1]}"
]

puts "Writing track #{track_line} ..."
contents.append(track_line)
track_lines.each do |line|
puts(line.to_s)
end

contents.append(track_lines)
end

Dir.mkdir('yml') unless File.exist?('yml')
Expand Down

0 comments on commit 320439e

Please sign in to comment.