To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / lib / redmine / version.rb @ 1298:4f746d8966dd
History | View | Annotate | Download (876 Bytes)
| 1 | 0:513646585e45 | Chris | require 'rexml/document'
|
|---|---|---|---|
| 2 | |||
| 3 | module Redmine |
||
| 4 | module VERSION #:nodoc: |
||
| 5 | 1115:433d4f72a19b | Chris | MAJOR = 2 |
| 6 | 1295:622f24f53b42 | Chris | MINOR = 3 |
| 7 | TINY = 1 |
||
| 8 | 441:cbce1fd3b1b7 | Chris | |
| 9 | 0:513646585e45 | Chris | # Branch values:
|
| 10 | # * official release: nil
|
||
| 11 | # * stable branch: stable
|
||
| 12 | # * trunk: devel
|
||
| 13 | 441:cbce1fd3b1b7 | Chris | BRANCH = 'stable' |
| 14 | 0:513646585e45 | Chris | |
| 15 | 1115:433d4f72a19b | Chris | # Retrieves the revision from the working copy
|
| 16 | 0:513646585e45 | Chris | def self.revision |
| 17 | 1115:433d4f72a19b | Chris | if File.directory?(File.join(Rails.root, '.svn')) |
| 18 | 0:513646585e45 | Chris | begin
|
| 19 | 1115:433d4f72a19b | Chris | path = Redmine::Scm::Adapters::AbstractAdapter.shell_quote(Rails.root.to_s) |
| 20 | if `svn info --xml #{path}` =~ /revision="(\d+)"/ |
||
| 21 | return $1.to_i |
||
| 22 | 441:cbce1fd3b1b7 | Chris | end
|
| 23 | rescue
|
||
| 24 | # Could not find the current revision
|
||
| 25 | end
|
||
| 26 | end
|
||
| 27 | 1115:433d4f72a19b | Chris | nil
|
| 28 | 0:513646585e45 | Chris | end
|
| 29 | |||
| 30 | REVISION = self.revision |
||
| 31 | 441:cbce1fd3b1b7 | Chris | ARRAY = [MAJOR, MINOR, TINY, BRANCH, REVISION].compact |
| 32 | STRING = ARRAY.join('.') |
||
| 33 | 909:cbb26bc654de | Chris | |
| 34 | 441:cbce1fd3b1b7 | Chris | def self.to_a; ARRAY end |
| 35 | 909:cbb26bc654de | Chris | def self.to_s; STRING end |
| 36 | 0:513646585e45 | Chris | end
|
| 37 | end |