From 8a1dfb07853fa7e758ddb2eb94a36480bb562be7 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 23 May 2017 16:24:45 -0400 Subject: [PATCH] do not catch NameError when looking up Builder#run method --- lib/rscons/environment.rb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index dea7ea6..8c5ce66 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -584,15 +584,10 @@ module Rscons # Invoke pre-build hooks. call_build_hooks[:pre] - use_new_run_method_signature = - begin - builder.method(:run).arity == 1 - rescue NameError - false - end - # Call the builder's #run method. - if use_new_run_method_signature + if builder.method(:run).arity == 5 + rv = builder.run(target, sources, cache, self, vars) + else rv = builder.run( target: target, sources: sources, @@ -600,8 +595,6 @@ module Rscons env: self, vars: vars, setup_info: options[:setup_info]) - else - rv = builder.run(target, sources, cache, self, vars) end if rv.is_a?(ThreadedCommand)