annotate lib/redmine/version.rb @ 1459:cf78a7ade302 luisf

Merge from branch "bug_794"
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 11 Nov 2013 18:25:50 +0000
parents 0a574315af3e
children 4f746d8966dd fb9a13467253
rev   line source
Chris@0 1 require 'rexml/document'
Chris@0 2
Chris@0 3 module Redmine
Chris@0 4 module VERSION #:nodoc:
Chris@1115 5 MAJOR = 2
Chris@1115 6 MINOR = 2
Chris@1294 7 TINY = 4
Chris@441 8
Chris@0 9 # Branch values:
Chris@0 10 # * official release: nil
Chris@0 11 # * stable branch: stable
Chris@0 12 # * trunk: devel
Chris@441 13 BRANCH = 'stable'
Chris@0 14
Chris@1115 15 # Retrieves the revision from the working copy
Chris@0 16 def self.revision
Chris@1115 17 if File.directory?(File.join(Rails.root, '.svn'))
Chris@0 18 begin
Chris@1115 19 path = Redmine::Scm::Adapters::AbstractAdapter.shell_quote(Rails.root.to_s)
Chris@1115 20 if `svn info --xml #{path}` =~ /revision="(\d+)"/
Chris@1115 21 return $1.to_i
Chris@441 22 end
Chris@441 23 rescue
Chris@441 24 # Could not find the current revision
Chris@441 25 end
Chris@441 26 end
Chris@1115 27 nil
Chris@0 28 end
Chris@0 29
Chris@0 30 REVISION = self.revision
Chris@441 31 ARRAY = [MAJOR, MINOR, TINY, BRANCH, REVISION].compact
Chris@441 32 STRING = ARRAY.join('.')
Chris@909 33
Chris@441 34 def self.to_a; ARRAY end
Chris@909 35 def self.to_s; STRING end
Chris@0 36 end
Chris@0 37 end