lib/kameleon/persistent_cache.rb in kameleon-builder-2.2.5 vs lib/kameleon/persistent_cache.rb in kameleon-builder-2.3.0
- old
+ new
@@ -73,11 +73,11 @@
port
end
def check_polipo_binary
- @polipo_path ||= which("polipo")
+ @polipo_path ||= Utils.which("polipo")
if @polipo_path.nil? then
Kameleon.ui.error("Polipo binary not found, make sure it is in your current PATH")
Kameleon.ui.error("or use the option --proxy-path")
raise BuildError, "Failed to use persistent cache"
@@ -232,17 +232,9 @@
command = [cmd ] + args.split(" ")
process = ChildProcess.build(*command)
process.cwd = dir unless dir.nil?
process.start
process.wait
- end
-
- def which(cmd)
- ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
- exe = File.join(path, "#{cmd}")
- return path if File.executable? exe
- end
- return nil
end
def common_prefix(paths)
return '' if paths.empty?
return paths.first.split('/').slice(0...-1).join('/') if paths.length <= 1