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

Tempdir option #34

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Tempdir option #34

wants to merge 3 commits into from

Conversation

rylwin
Copy link

@rylwin rylwin commented May 21, 2012

I needed to add a way to set the tmpdir used during bursts to avoid a race condition where the single pages would be overwritten. I implemented this by allowing users to pass a :tmpdir option. If none is provided, it defaults to Dir.tmpdir, which is what the code was previously using. Please merge this if you think this is a good addition.

Also, note that there is also a commit in this pull request that adds a require for 'digest'. I added this because I got errors when running the tests when digest was not required, so please cherry-pick around this commit if necessary.

And thanks for your work on active_pdftk!

@tcocca
Copy link
Owner

tcocca commented May 25, 2012

Hi, thanks for your interest in the project. I will definitely check out this PR. This is an interesting option to be able to set the tmpdir.

What OS/Ruby are you on where you are getting the digest errors? I have tested on os x 10.6 ree and 1.9.2 and ubuntu 1.8.7/1.9.2.

I would love to get a travis-ci set up for the project but I'm not sure how I could get the pdftk lib installed to be able to run the tests.

Thanks again, hopefully I'll have some time to spend on this project this weekend.

@tcocca
Copy link
Owner

tcocca commented May 25, 2012

The other thing I would love to be able to do is use Dir.chdir to get into the tmpdir, which is supported by popen3 in version 1.9.2 and up http://apidock.com/ruby/Open3/popen3 but I don't know how to make it work for 1.8.7 / ree w/out pre-pending it to the command? Any ideas?

~ Tom

@rylwin
Copy link
Author

rylwin commented May 26, 2012

Upon further examination of the "digest" issue, I realized it was only required for the custom matchers, so I moved the requires to the spec_helper.rb. I'm running ubuntu and I had the issue with ree and 1.9.2. Not sure if this matters but I use rvm to manage my rubies. It's certainly strange that I'm getting those errors and you aren't.

travis-ci allows you to install packages via apt-get. Check out http://about.travis-ci.org/docs/user/build-configuration/. There is a section titled "Installing Packages Using apt" that may be of interest.

With respect to chdir, I played with this a bit and if you do:

Dir.chdir(tmpdir)
Open3.po...

Then this will use the provided tmpdir without prepending cmd. Now you can't pass :chdir like in 1.9.2, but it seems like you could use this code for all versions of ruby.

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

Successfully merging this pull request may close these issues.

2 participants