-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add version to user-agent, footer and about page
- Loading branch information
1 parent
d7b6019
commit b8012b3
Showing
6 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# frozen_string_literal: true | ||
|
||
module RetroMeet | ||
# This module contains functions to build the retromeet web version to be used around programatically | ||
# Should be modified when releasing to indicate the proper versions | ||
module Version | ||
class << self | ||
# The major part of the version | ||
# @return [Integer] | ||
def major | ||
0 | ||
end | ||
|
||
# The minor part of the version | ||
# @return [Integer] | ||
def minor | ||
1 | ||
end | ||
|
||
# The patch part of the version | ||
# @return [Integer] | ||
def patch | ||
0 | ||
end | ||
|
||
# The default prerelease name | ||
# @return [String] | ||
def default_prerelease | ||
"alpha.1" | ||
end | ||
|
||
# The prerelease name, takes the +RETROMEET_VERSION_PRERELEASE+ environment variable into consideration | ||
# @return [String] | ||
def prerelease | ||
ENV["RETROMEET_VERSION_PRERELEASE"].presence || default_prerelease | ||
end | ||
|
||
# The build metadata, should be used to indicate a fork or other special build condition | ||
# Takes the +RETROMEET_VERSION_METADATA+ environment variable into consideration | ||
# @return [String,nil] | ||
def build_metadata | ||
ENV.fetch("RETROMEET_VERSION_METADATA", nil) | ||
end | ||
|
||
# @return [Array<String>] | ||
def to_a | ||
[major, minor, patch].compact | ||
end | ||
|
||
# @return [String] | ||
def to_s | ||
components = [to_a.join(".")] | ||
components << "-#{prerelease}" if prerelease.present? | ||
components << "+#{build_metadata}" if build_metadata.present? | ||
components.join | ||
end | ||
|
||
# @return [String] | ||
def user_agent | ||
# TODO: (renatolond, 2024-10-31): properly build the address of the server | ||
@user_agent ||= "RetroMeet-web/#{Version} (async-http #{Async::HTTP::VERSION}; +http#{false ? "s" : ""}://localhost:3000/)" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.container | ||
%h1.title.has-text-centered About us | ||
%p | ||
%strong> Version | ||
\: #{RetroMeet::Version} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
Rails.autoloaders.each do |autoloader| | ||
autoloader.inflector.inflect( | ||
"retromeet" => "RetroMeet" | ||
) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters