Skip to content

Fixed some annoyances in the EOC conversion script #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/tasks/exercises/tag.rake
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,16 @@
end

chapter = chapter_index.nil? ? chapter_uuid_by_page_uuid[row[page_index]] : row[chapter_index]

# The value in the Chapter column may be a UUID or a chapter number
chapter_uuid = chapter_uuids.include?(chapter) ? chapter : chapter_uuids[Integer(chapter) - 1]
chapter_uuid = if chapter_uuids.include?(chapter)
chapter
elsif chapter.to_i == 0
Rails.logger.info { "Skipped row #{index + 1} due to no Chapter" }
next

Check warning on line 119 in lib/tasks/exercises/tag.rake

View check run for this annotation

Codecov / codecov/patch

lib/tasks/exercises/tag.rake#L115-L119

Added lines #L115 - L119 were not covered by tests
else
chapter_uuids[chapter.to_i - 1]

Check warning on line 121 in lib/tasks/exercises/tag.rake

View check run for this annotation

Codecov / codecov/patch

lib/tasks/exercises/tag.rake#L121

Added line #L121 was not covered by tests
end

csv << [
row[exercise_id_index],
Expand Down