lib/ae.rb in ae-1.2.3 vs lib/ae.rb in ae-1.3.0

- old
+ new

@@ -1,9 +1,25 @@ require 'yaml' module AE - vers = YAML.load(File.read(File.dirname(__FILE__) + '/ae/version.yml')) - VERSION = vers.values_at('major', 'minor', 'patch', 'state', 'build').compact.join('.') + DIRECTORY = File.dirname(__FILE__) + '/ae' + + 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 'ae/assert' require 'ae/expect'