2017-01-26 10:02:06 +00:00
|
|
|
# Copyright (C) 2012-2017 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
|
|
|
class Version
|
|
|
|
|
|
|
|
=begin
|
|
|
|
|
|
|
|
Returns version number of application
|
|
|
|
|
|
|
|
version = Version.get
|
|
|
|
|
|
|
|
returns
|
|
|
|
|
|
|
|
'1.3.0' # example
|
|
|
|
|
|
|
|
=end
|
|
|
|
|
|
|
|
def self.get
|
|
|
|
|
|
|
|
begin
|
2017-11-23 08:09:44 +00:00
|
|
|
version = File.read(Rails.root.join('VERSION'))
|
2017-01-26 10:02:06 +00:00
|
|
|
version.strip!
|
|
|
|
rescue => e
|
|
|
|
message = e.to_s
|
|
|
|
Rails.logger.error "VERSION file could not be read: #{message}"
|
|
|
|
|
|
|
|
version = ''
|
|
|
|
end
|
|
|
|
|
|
|
|
version
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|