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

Add a :preservenothing option to never persist build files #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RootTJNII
Copy link

This PR adds a :preservenothing flag. When set no build files will be persisted. This is important for our use case as we're using this gem to generate sensitive documents, so having the .tex files laying around after they're needed is a security concern, as well as being generally useful in environments where these files will never be read in any case.

The main change is the work is now done in a Ruby Dir.mktempdir block that is always cleaned up. If :preservenothing is falsy then the basedir is created and input.tex and input.log are copied to it to maintain existing behavior. If :preservenothing is falsy and :preservework is truthy then the tmpdir is copied to workdir to maintain existing behavior. If :preservenothing is truthy then nothing is copied out of the tempdir which is automatically cleaned up by Ruby.

The exception message changes when :preservenothing is truthy as there are no log files to check. When :preservenothing is falsy a conscious effort was made to keep the gem behavior unchanged.

@RootTJNII RootTJNII force-pushed the TJNII-PreserveNothing branch from 0c73068 to 66bee00 Compare October 8, 2019 00:00
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.

1 participant