Skip to content

Commit

Permalink
k rollback: make it compatible with Struct from older ruby versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dbackeus committed Sep 10, 2024
1 parent 799d621 commit 8fc32a0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions k
Original file line number Diff line number Diff line change
Expand Up @@ -2290,19 +2290,19 @@ def lookup_latest_releases(application)
--pretty=format:'%H<col>%aN<col>%ad<col>%ar<col>%s<col>%b<row>' \
--follow -- applications/#{application}/values.yaml
`

release_struct = Struct.new(:sha, :pretty_sha, :author, :time, :relative_time, :subject, :body)

git_log.split("<row>").map do |row|
sha, author, time, relative_time, subject, body = row.strip.split("<col>")

release_struct.new(
sha: sha,
pretty_sha: sha[0..10],
author: author,
time: Time.parse(time),
relative_time: relative_time,
subject: subject.delete_prefix("#{application}: "),
body: body,
sha,
sha[0..10],
author,
Time.parse(time),
relative_time,
subject.delete_prefix("#{application}: "),
body,
)
end
end
Expand Down

0 comments on commit 8fc32a0

Please sign in to comment.