1 require 'rexml/document'
4 module VERSION #:nodoc:
10 # * official release: nil
11 # * stable branch: stable
17 entries_path = "#{RAILS_ROOT}/.svn/entries"
18 if File.readable?(entries_path)
20 f = File.open(entries_path, 'r')
23 if entries.match(%r{^\d+})
24 revision = $1.to_i if entries.match(%r{^\d+\s+dir\s+(\d+)\s})
26 xml = REXML::Document.new(entries)
27 revision = xml.elements['wc-entries'].elements[1].attributes['revision'].to_i
30 # Could not find the current revision
36 REVISION = self.revision
37 ARRAY = [MAJOR, MINOR, TINY, BRANCH, REVISION].compact
38 STRING = ARRAY.join('.')
40 def self.to_a; ARRAY end
41 def self.to_s; STRING end