lib/build/environment/evaluator.rb in build-environment-1.5.0 vs lib/build/environment/evaluator.rb in build-environment-1.6.0
- old
+ new
@@ -21,17 +21,18 @@
module Build
class Environment
class Evaluator
def initialize(environment)
@environment = environment
+ @cache = {}
end
def respond_to?(name, include_private = false)
@environment.include?(name) || super
end
def method_missing(name)
- object_value(@environment[name])
+ @cache[name] ||= object_value(@environment[name])
end
# Compute the literal object value for a given key:
def object_value(value)
case value