From f59700138f7360436767fddea554c739e2cd484b Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Tue, 25 Sep 2012 08:55:35 +1000 Subject: Extract configuration with defaults into one module --- lib/alaveteli_external_command.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/alaveteli_external_command.rb') diff --git a/lib/alaveteli_external_command.rb b/lib/alaveteli_external_command.rb index 7d32be904..3bfc34e3a 100644 --- a/lib/alaveteli_external_command.rb +++ b/lib/alaveteli_external_command.rb @@ -14,16 +14,15 @@ module AlaveteliExternalCommand if program_name =~ %r(^/) program_path = program_name else - utility_search_path = MySociety::Config.get("UTILITY_SEARCH_PATH", ["/usr/bin", "/usr/local/bin"]) found = false - utility_search_path.each do |d| + Configuration::utility_search_path.each do |d| program_path = File.join(d, program_name) if File.file? program_path and File.executable? program_path found = true break end end - raise "Could not find #{program_name} in any of #{utility_search_path.join(', ')}" if !found + raise "Could not find #{program_name} in any of #{Configuration::utility_search_path.join(', ')}" if !found end xc = ExternalCommand.new(program_path, *args) -- cgit v1.2.3