don't repeat yourself uwu

This commit is contained in:
Lynne Megido 2020-03-06 21:33:57 +10:00
parent e6f2077d9b
commit f088650669
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90

View file

@ -66,12 +66,14 @@ module Jekyll
minutes = " minute" + (time[1] > 1 ? "s" : "") + " " minutes = " minute" + (time[1] > 1 ? "s" : "") + " "
end end
out = ["#{time[0]}#{hours}", "#{time[1]}#{minutes}"]
if time[1] == 0 if time[1] == 0
"#{time[0]}#{hours}" out[0]
elsif time[0] == 0 elsif time[0] == 0
"#{time[1]}#{minutes}" out[1]
else else
"#{time[0]}#{hours}#{time[1]}#{minutes}" out.join("")
end end
end end
end end