Mercurial > hg > soundsoftware-site
annotate lib/redmine/version.rb @ 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 | 0a574315af3e 622f24f53b42 |
children |
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@1295 | 6 MINOR = 3 |
Chris@1295 | 7 TINY = 1 |
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 |