annotate .svn/pristine/e2/e21a4b89d491f51b044f36a2083293e96a46fada.svn-base @ 1298:4f746d8966dd redmine_2.3_integration

Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author Chris Cannam
date Fri, 14 Jun 2013 09:28:30 +0100
parents 622f24f53b42
children
rev   line source
Chris@1295 1 require 'rexml/document'
Chris@1295 2
Chris@1295 3 module Redmine
Chris@1295 4 module VERSION #:nodoc:
Chris@1295 5 MAJOR = 2
Chris@1295 6 MINOR = 3
Chris@1295 7 TINY = 1
Chris@1295 8
Chris@1295 9 # Branch values:
Chris@1295 10 # * official release: nil
Chris@1295 11 # * stable branch: stable
Chris@1295 12 # * trunk: devel
Chris@1295 13 BRANCH = 'stable'
Chris@1295 14
Chris@1295 15 # Retrieves the revision from the working copy
Chris@1295 16 def self.revision
Chris@1295 17 if File.directory?(File.join(Rails.root, '.svn'))
Chris@1295 18 begin
Chris@1295 19 path = Redmine::Scm::Adapters::AbstractAdapter.shell_quote(Rails.root.to_s)
Chris@1295 20 if `svn info --xml #{path}` =~ /revision="(\d+)"/
Chris@1295 21 return $1.to_i
Chris@1295 22 end
Chris@1295 23 rescue
Chris@1295 24 # Could not find the current revision
Chris@1295 25 end
Chris@1295 26 end
Chris@1295 27 nil
Chris@1295 28 end
Chris@1295 29
Chris@1295 30 REVISION = self.revision
Chris@1295 31 ARRAY = [MAJOR, MINOR, TINY, BRANCH, REVISION].compact
Chris@1295 32 STRING = ARRAY.join('.')
Chris@1295 33
Chris@1295 34 def self.to_a; ARRAY end
Chris@1295 35 def self.to_s; STRING end
Chris@1295 36 end
Chris@1295 37 end