Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dump_data returns empty stringIO #37

Open
koenhandekyn opened this issue Jan 11, 2013 · 2 comments
Open

dump_data returns empty stringIO #37

koenhandekyn opened this issue Jan 11, 2013 · 2 comments

Comments

@koenhandekyn
Copy link

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

@koenhandekyn
Copy link
Author

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

@tcocca
Copy link
Owner

tcocca commented Feb 12, 2013

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants