version.rb 458 B

1234567891011121314151617181920212223242526272829303132
  1. # Copyright (C) 2012-2017 Zammad Foundation, http://zammad-foundation.org/
  2. class Version
  3. =begin
  4. Returns version number of application
  5. version = Version.get
  6. returns
  7. '1.3.0' # example
  8. =end
  9. def self.get
  10. begin
  11. version = File.read("#{Rails.root}/VERSION")
  12. version.strip!
  13. rescue => e
  14. message = e.to_s
  15. Rails.logger.error "VERSION file could not be read: #{message}"
  16. version = ''
  17. end
  18. version
  19. end
  20. end