From d75a17d866fc5f2545f956a36146b1c67a44e170 Mon Sep 17 00:00:00 2001 From: KMY Date: Mon, 11 Sep 2023 08:26:24 +0900 Subject: [PATCH] Add kmyblue version label --- lib/mastodon/version.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index fac76c2045ef22..b63e59557b161b 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -4,6 +4,14 @@ module Mastodon module Version module_function + def kmyblue_major + 1 + end + + def kmyblue_minor + 0 + end + def major 4 end @@ -24,8 +32,17 @@ def prerelease ENV['MASTODON_VERSION_PRERELEASE'].presence || default_prerelease end + def to_a_of_kmyblue + [kmyblue_major, kmyblue_minor].compact + end + + def to_s_of_kmyblue + components = [to_a_of_kmyblue.join('.')] + components.join + end + def build_metadata - ENV.fetch('MASTODON_VERSION_METADATA', nil) + ['kmyblue', to_s_of_kmyblue, ENV.fetch('MASTODON_VERSION_METADATA', nil)].compact.join('.') end def to_a