I am trying to pretty print a hash to a file.
I tried unix redirects [added different flags to it incrementally] :
`echo #{pp mymap} | tee summary.out
What about (not using pp directly):
File.open("myfile.out","w+") do |f| f.puts mymap.inspect end
Or even redirect stdout for the file
file = File.open("myfile.out", "w+) old_stdout = STDOUT $stdout = STDOUT = file pp get_submap_from_final(all_mapping_file,final_map) $stdout = STDOUT = old_stdout