Retrospring/lib/version.rb

49 lines
727 B
Ruby
Raw Normal View History

2022-04-15 18:47:48 -07:00
# frozen_string_literal: true
# Retrospring's version scheme is based on CalVer
# because we don't really track/plan ahead feature releases
#
# The version is structured like this:
# YYYY.MMDD.PATCH
#
# PATCH being a zero-indexed number representing the
# amount of patch releases for the given day
module Retrospring
module Version
module_function
def year
2022
end
def month
2022-07-02 09:10:18 -07:00
7
2022-04-15 18:47:48 -07:00
end
def day
2022-07-21 03:32:56 -07:00
21
2022-04-15 18:47:48 -07:00
end
def patch
2022-07-08 16:16:11 -07:00
0
2022-04-15 18:47:48 -07:00
end
def suffix
""
end
def minor
[month.to_s.rjust(2, "0"), day.to_s.rjust(2, "0")].join
end
def to_a
[year.to_s, minor, patch.to_s]
end
def to_s
[to_a.join("."), suffix].join
end
end
2022-04-15 19:03:49 -07:00
end