module RDF::RDFa::VERSION
  VERSION_FILE = File.join(File.expand_path(File.dirname(__FILE__)), "..", "..", "..", "VERSION")
  MAJOR, MINOR, TINY, EXTRA = File.read(VERSION_FILE).chop.split(".")

  STRING = [MAJOR, MINOR, TINY, EXTRA].compact.join('.')

  ##
  # @return [String]
  def self.to_s()   STRING end

  ##
  # @return [String]
  def self.to_str() STRING end

  ##
  # @return [Array(Integer, Integer, Integer)]
  def self.to_a() STRING.split(".") end
end

module RDF::RDFa::VERSION
  MAJOR = 0
  MINOR = 2
  TINY  = 2
  EXTRA = nil

  STRING = [MAJOR, MINOR, TINY].join('.')
  STRING << "-#{EXTRA}" if EXTRA

  ##
  # @return [String]
  def self.to_s()   STRING end

  ##
  # @return [String]
  def self.to_str() STRING end

  ##
  # @return [Array(Integer, Integer, Integer)]
  def self.to_a() [MAJOR, MINOR, TINY] end
end

--- 
+++ 
@@ -1,11 +1,8 @@
 module RDF::RDFa::VERSION
-  MAJOR = 0
-  MINOR = 2
-  TINY  = 2
-  EXTRA = nil
+  VERSION_FILE = File.join(File.expand_path(File.dirname(__FILE__)), "..", "..", "..", "VERSION")
+  MAJOR, MINOR, TINY, EXTRA = File.read(VERSION_FILE).chop.split(".")
 
-  STRING = [MAJOR, MINOR, TINY].join('.')
-  STRING << "-#{EXTRA}" if EXTRA
+  STRING = [MAJOR, MINOR, TINY, EXTRA].compact.join('.')
 
   ##
   # @return [String]
@@ -17,5 +14,5 @@
 
   ##
   # @return [Array(Integer, Integer, Integer)]
-  def self.to_a() [MAJOR, MINOR, TINY] end
+  def self.to_a() STRING.split(".") end
 end
Implement RDF::RDFa::VERSION by parsing VERSION file.
