Skip to content

Commit

Permalink
job: make regex more readable
Browse files Browse the repository at this point in the history
Co-authored-by: Bo Anderson <[email protected]>
  • Loading branch information
carlocab and Bo98 authored May 11, 2024
1 parent 47b2145 commit ffb7f82
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ class Job
# rubocop:disable Layout/LineLength
# Splitting the long line up is probably just going to make things worse.
NAME_REGEX =
/\A(?<runner>\d+(?:\.\d+)?(?:-(?:arm|x86_)64)?(?:-cross)?)-(?<run_id>\d+)(?:-(?<run_attempt>\d+))?(?:-(?<tags>[-a-z]+))?\z/
NAME_REGEX = %r{
\A
(?<runner>\d+(?:\.\d+)?(?:-(?:arm|x86_)64)?(?:-cross)?)
-(?<run_id>\d+)
(?:-(?<run_attempt>\d+))?
(?:-(?<tags>[-a-z]+))?
\z
}x
# rubocop:enable Layout/LineLength

attr_reader :runner_name, :repository, :github_id, :secret, :group
Expand Down

0 comments on commit ffb7f82

Please sign in to comment.