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
|
|
|
|
|
2023-01-02 04:07:10 -08:00
|
|
|
def year = 2023
|
2022-04-15 18:47:48 -07:00
|
|
|
|
2023-05-07 03:57:52 -07:00
|
|
|
def month = 5
|
2022-04-15 18:47:48 -07:00
|
|
|
|
2023-05-31 10:09:54 -07:00
|
|
|
def day = 31
|
2022-04-15 18:47:48 -07:00
|
|
|
|
2023-05-09 14:38:27 -07:00
|
|
|
def patch = 0
|
2022-04-15 18:47:48 -07:00
|
|
|
|
2022-07-23 03:45:24 -07:00
|
|
|
def suffix = ""
|
2022-04-15 18:47:48 -07:00
|
|
|
|
2022-07-23 03:45:24 -07:00
|
|
|
def minor = [month.to_s.rjust(2, "0"), day.to_s.rjust(2, "0")].join
|
2022-04-15 18:47:48 -07:00
|
|
|
|
2022-07-23 03:45:24 -07:00
|
|
|
def to_a = [year.to_s, minor, patch.to_s]
|
2022-04-15 18:47:48 -07:00
|
|
|
|
2022-07-23 03:45:24 -07:00
|
|
|
def to_s = [to_a.join("."), suffix].join
|
2022-04-15 18:47:48 -07:00
|
|
|
end
|
2022-04-15 19:03:49 -07:00
|
|
|
end
|