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 935B

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