Skip to content

Commit 40c9b06

Browse files
committed
exercism#37 - fix rubocop warning
1 parent b869c27 commit 40c9b06

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/extract_test_metadata.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ def task_id
7575

7676
c = code_for_line(idx)
7777
# Find a line started with `### task_id` and get the number
78-
if c.start_with?(/\s*###\s*task_id/)
79-
c.chomp.strip.delete('### task_id:').to_i
80-
end
78+
ch_task_id = /\s*###\s*task_id/
79+
c.chomp.strip.delete('### task_id:').to_i if c.start_with?(ch_task_id)
8180
end.compact.first
8281
end
8382

0 commit comments

Comments
 (0)