lib/rdf/rdfa/version.rb in rdf-rdfa-0.2.2 vs lib/rdf/rdfa/version.rb in rdf-rdfa-0.3.0
- old
+ new
@@ -1,13 +1,10 @@
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]
def self.to_s() STRING end
@@ -15,7 +12,7 @@
# @return [String]
def self.to_str() STRING end
##
# @return [Array(Integer, Integer, Integer)]
- def self.to_a() [MAJOR, MINOR, TINY] end
+ def self.to_a() STRING.split(".") end
end