lib/qed.rb in qed-2.1.1 vs lib/qed.rb in qed-2.2.0
- old
+ new
@@ -1,6 +1,25 @@
+require 'yaml'
+
module QED
- VERSION="2.1.1" #:till: VERSION="<%= version %>"
+ DIRECTORY = File.dirname(__FILE__) + '/qed'
+
+ PROFILE = YAML.load(File.new(DIRECTORY + '/profile.yml')) rescue {}
+ PACKAGE = YAML.load(File.new(DIRECTORY + '/package.yml')) rescue {}
+
+ VERSION = PACKAGE.values_at('major','minor','patch','build').compact.join('.')
+
+ #
+ def self.const_missing(name)
+ key = name.to_s.downcase
+ if PACKAGE.key?(key)
+ PACKAGE[key]
+ elsif PROFILE.key?(key)
+ PROFILE[key]
+ else
+ super(name)
+ end
+ end
end
require 'qed/session'