@@ -1,7 +1,7 @@ | |||||
# frozen_string_literal: true | # frozen_string_literal: true | ||||
module HttpHelper | module HttpHelper | ||||
USER_AGENT = "#{HTTP::Request::USER_AGENT} (Mastodon/#{Mastodon::VERSION}; +http://#{Rails.configuration.x.local_domain}/)" | |||||
USER_AGENT = "#{HTTP::Request::USER_AGENT} (Mastodon/#{Mastodon::Version}; +http://#{Rails.configuration.x.local_domain}/)" | |||||
def http_client(options = {}) | def http_client(options = {}) | ||||
timeout = { write: 10, connect: 10, read: 10 }.merge(options) | timeout = { write: 10, connect: 10, read: 10 }.merge(options) | ||||
@@ -27,6 +27,6 @@ class InstancePresenter | |||||
end | end | ||||
def version_number | def version_number | ||||
Mastodon::VERSION | |||||
Mastodon::Version | |||||
end | end | ||||
end | end |
@@ -4,4 +4,4 @@ node(:uri) { site_hostname } | |||||
node(:title) { Setting.site_title } | node(:title) { Setting.site_title } | ||||
node(:description) { Setting.site_description } | node(:description) { Setting.site_description } | ||||
node(:email) { Setting.site_contact_email } | node(:email) { Setting.site_contact_email } | ||||
node(:version) { Mastodon::VERSION } | |||||
node(:version) { Mastodon::Version } |
@@ -1,5 +1,31 @@ | |||||
# frozen_string_literal: true | # frozen_string_literal: true | ||||
module Mastodon | module Mastodon | ||||
VERSION = '1.2.2' | |||||
module Version | |||||
module_function | |||||
def major | |||||
1 | |||||
end | |||||
def minor | |||||
3 | |||||
end | |||||
def patch | |||||
0 | |||||
end | |||||
def pre | |||||
nil | |||||
end | |||||
def to_a | |||||
[major, minor, patch, pre].compact | |||||
end | |||||
def to_s | |||||
to_a.join('.') | |||||
end | |||||
end | |||||
end | end |