1 require 'rexml/document'
4 module VERSION #:nodoc:
11 entries_path = "#{RAILS_ROOT}/.svn/entries"
12 if File.readable?(entries_path)
14 f = File.open(entries_path, 'r')
17 if entries.match(%r{^\d+})
18 revision = $1.to_i if entries.match(%r{^\d+\s+dir\s+(\d+)\s})
20 xml = REXML::Document.new(entries)
21 revision = xml.elements['wc-entries'].elements[1].attributes['revision'].to_i
24 # Could not find the current revision
30 REVISION = self.revision
31 STRING = [MAJOR, MINOR, TINY, REVISION].compact.join('.')
33 def self.to_s; STRING end