aboutsummaryrefslogtreecommitdiffstats
path: root/lib/alaveteli_external_command.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2012-09-25 08:55:35 +1000
committerMatthew Landauer <matthew@openaustralia.org>2012-09-25 08:55:35 +1000
commitf59700138f7360436767fddea554c739e2cd484b (patch)
tree8c3af52f3f1f369ab412fa7571f19860e4f260b8 /lib/alaveteli_external_command.rb
parent265e336ae0608af39aa3aad8b27862e572222562 (diff)
Extract configuration with defaults into one module
Diffstat (limited to 'lib/alaveteli_external_command.rb')
-rw-r--r--lib/alaveteli_external_command.rb5
1 files changed, 2 insertions, 3 deletions
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)