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
Doing something similar to what Edu suggested and How do I redirect stderr and stdout to file for a Ruby script? helped.
Here is how the new code is similar to:
$stdout.reopen(@dir_+"/my_file.out",'w+')
puts "All metrics are:"
pp final_map
$stdout=STDOUT
Would still be interested to know why redirection operators > , and 2>&1 in back-ticks doesn't work