You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

version.rb 1000B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # frozen_string_literal: true
  2. require 'redmine/scm/adapters/subversion_adapter'
  3. module Redmine
  4. # @private
  5. module VERSION
  6. MAJOR = 5
  7. MINOR = 0
  8. TINY = 3
  9. # Branch values:
  10. # * official release: nil
  11. # * stable branch: stable
  12. # * trunk: devel
  13. BRANCH = 'devel'
  14. # Retrieves the revision from the working copy
  15. def self.revision
  16. if File.directory?(File.join(Rails.root, '.svn'))
  17. begin
  18. path = Redmine::Scm::Adapters::AbstractAdapter.shell_quote(Rails.root.to_s)
  19. if `#{Redmine::Scm::Adapters::SubversionAdapter.client_command} info --xml #{path}` =~ /commit\s+revision="(\d+)"/
  20. return $1.to_i
  21. end
  22. rescue
  23. # Could not find the current revision
  24. end
  25. end
  26. nil
  27. end
  28. REVISION = self.revision
  29. ARRAY = [MAJOR, MINOR, TINY, BRANCH, REVISION].compact
  30. STRING = ARRAY.join('.')
  31. def self.to_a; ARRAY end
  32. def self.to_s; STRING end
  33. end
  34. end