dump_data returns empty stringIO
on mac os x and ruby 1.9.3 with the current 'latest greatest' branch form active_activepdftk it seams that dump_data returns an empty stringIO
1.9.3-p327-turbo :030 > p.dump_data('~/Desktop/UpNxt.pdf').readlines => []
while the following nicely creates the correct data dump in to a file that contains the data. 1.9.3-p327-turbo :031 > p.dump_data('~/Desktop/UpNxt.pdf', :output => '~/Desktop/UpNxt.txt') => "~/Desktop/UpNxt.txt"
for performance and deployments reasons i'd like to avoid (temp) files. is this stringIO behaviour known ? any ideas ?
thanks koen
patch below. it seems that that the puts command on a StringIO doesn't seem to behave as the author expected (anymore?).
to fix, replace call.rb#196 with
if @output && [email protected]_a?(String)
@output.write stdout.read
@output.rewind
end
Thanks for this patch. I will test this out on multiple ruby versions. I have been testing on 1.8.7 and 1.9.2. It looks like you are using 1.9.3, I will merge and test the patch on all 3 versions, unless you want to.
Did the tests pass for you on this change?