call original method_missing() from Environment's method_missing() when a builder is not found

This commit is contained in:
Josh Holtrop 2013-06-26 20:49:16 -04:00
parent 16918570d2
commit 58d7f4edd5

View File

@ -61,11 +61,15 @@ module Rscons
fname.sub(/\.[^.]*$/, '')
end
alias_method :orig_method_missing, :method_missing
def method_missing(method, *args)
if @builders.has_key?(method.to_s)
# TODO: build sources if necessary
builder = @builders[method.to_s].new
builder.run(self, *args)
else
orig_method_missing(method, *args)
end
end
end