mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 16:29:52 +01:00
32 lines
631 B
Ruby
32 lines
631 B
Ruby
# 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
|
|
|
|
def month = 7
|
|
|
|
def day = 31
|
|
|
|
def patch = 1
|
|
|
|
def suffix = ""
|
|
|
|
def minor = [month.to_s.rjust(2, "0"), day.to_s.rjust(2, "0")].join
|
|
|
|
def to_a = [year.to_s, minor, patch.to_s]
|
|
|
|
def to_s = [to_a.join("."), suffix].join
|
|
end
|
|
end
|