retrospring/lib/version.rb

33 lines
631 B
Ruby
Raw Permalink Normal View History

2022-04-16 03:47:48 +02: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
2022-07-23 12:45:24 +02:00
def year = 2022
2022-04-16 03:47:48 +02:00
2022-07-23 12:45:24 +02:00
def month = 7
2022-04-16 03:47:48 +02:00
2022-07-31 02:19:40 +02:00
def day = 31
2022-04-16 03:47:48 +02:00
2022-07-31 02:40:56 +02:00
def patch = 1
2022-04-16 03:47:48 +02:00
2022-07-23 12:45:24 +02:00
def suffix = ""
2022-04-16 03:47:48 +02:00
2022-07-23 12:45:24 +02:00
def minor = [month.to_s.rjust(2, "0"), day.to_s.rjust(2, "0")].join
2022-04-16 03:47:48 +02:00
2022-07-23 12:45:24 +02:00
def to_a = [year.to_s, minor, patch.to_s]
2022-04-16 03:47:48 +02:00
2022-07-23 12:45:24 +02:00
def to_s = [to_a.join("."), suffix].join
2022-04-16 03:47:48 +02:00
end
2022-04-16 04:03:49 +02:00
end