lib/datasets/libsvm.rb in red-datasets-0.0.8 vs lib/datasets/libsvm.rb in red-datasets-0.0.9
- old
+ new
@@ -101,18 +101,10 @@
data_path = cache_dir_path + @file.name
unless data_path.exist?
download(data_path, @file.url)
end
if data_path.extname == ".bz2"
- input, output = IO.pipe
- pid = spawn("bzcat", data_path.to_s, {:out => output})
- begin
- output.close
- yield(input)
- ensure
- input.close
- Process.waitpid(pid)
- end
+ extract_bz2(data_path, &block)
else
File.open(data_path, &block)
end
end