Mercurial > hg > soundsoftware-site
annotate .svn/pristine/78/7851fb6d2c8ac3e7230e3330da36a81f831b2c06.svn-base @ 1327:287f201c2802 redmine-2.2-integration
Add italic
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Wed, 19 Jun 2013 20:56:22 +0100 |
parents | 038ba2d95de8 |
children |
rev | line source |
---|---|
Chris@1296 | 1 require 'rexml/document' |
Chris@1296 | 2 |
Chris@1296 | 3 module Redmine |
Chris@1296 | 4 module VERSION #:nodoc: |
Chris@1296 | 5 MAJOR = 2 |
Chris@1296 | 6 MINOR = 2 |
Chris@1296 | 7 TINY = 4 |
Chris@1296 | 8 |
Chris@1296 | 9 # Branch values: |
Chris@1296 | 10 # * official release: nil |
Chris@1296 | 11 # * stable branch: stable |
Chris@1296 | 12 # * trunk: devel |
Chris@1296 | 13 BRANCH = 'stable' |
Chris@1296 | 14 |
Chris@1296 | 15 # Retrieves the revision from the working copy |
Chris@1296 | 16 def self.revision |
Chris@1296 | 17 if File.directory?(File.join(Rails.root, '.svn')) |
Chris@1296 | 18 begin |
Chris@1296 | 19 path = Redmine::Scm::Adapters::AbstractAdapter.shell_quote(Rails.root.to_s) |
Chris@1296 | 20 if `svn info --xml #{path}` =~ /revision="(\d+)"/ |
Chris@1296 | 21 return $1.to_i |
Chris@1296 | 22 end |
Chris@1296 | 23 rescue |
Chris@1296 | 24 # Could not find the current revision |
Chris@1296 | 25 end |
Chris@1296 | 26 end |
Chris@1296 | 27 nil |
Chris@1296 | 28 end |
Chris@1296 | 29 |
Chris@1296 | 30 REVISION = self.revision |
Chris@1296 | 31 ARRAY = [MAJOR, MINOR, TINY, BRANCH, REVISION].compact |
Chris@1296 | 32 STRING = ARRAY.join('.') |
Chris@1296 | 33 |
Chris@1296 | 34 def self.to_a; ARRAY end |
Chris@1296 | 35 def self.to_s; STRING end |
Chris@1296 | 36 end |
Chris@1296 | 37 end |