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

Already on GitHub? Sign in to your account

Generator #142

Closed
wants to merge 65 commits into
from

Conversation

Projects
None yet
3 participants

Hello there,

I have applied the singleton pattern to create an instance (called generator) that provides 2 methods to generate pdf out of the require document parts/specifications such as: path to the document, document specifications, document parts and the styleesheets applied to the pdf document to be generated.

This way one calls PDFKit.generator.generate(...) or PDFKit.generator.pdf(...) and it returns the pdf document file.

The different between the two methods is that one receive the document parts(header, body, etc..) as strings(.generate) and the other (.pdf) as paths to the html files.

If I could have feedback from your regarding this feature would be great! I hope that you will decided to merge it with master. if not..all good anyways...:)

All The Best,

frankapimenta

frankapimenta added some commits Jun 24, 2012

+ generator: specs -> -self.default_directory_path - returns the path…
… of the directory where generated pdf will be saved
+ generator: specs -> -self.temporary_directory_path - returns path o…
…f the temporary directory used by pdfkit to create required html files
+ generator: -self.temporary_directory_path - returns path of the tem…
…porary directory used by pdfkit to create required html files
+ generator: specs -> -self.temporary_files_creation - creates the te…
…mporary files that help in the generation of the pdf document
+ generator: -self.temporary_files_creation - creates the temporary f…
…iles that help in the generation of the pdf document
+ generator: specs -> -self.temporary_files_injection - injects the c…
…ontent of the several parts of the pdf document to be generated in each support file assigned to it
+ generator: -self.temporary_files_injection - injects the content of…
… the several parts of the pdf document to be generated in each support file assigned to it
+ generator: specs -> -self.temporary_files_deletion - deletes the te…
…mporary files created to help in the generation of the pdf document
+ generator: -self.temporary_files_deletion - deletes the temporary f…
…iles created to help in the generation of the pdf document
+ generator: specs -> -self.set_environment - creates the required te…
…mporary folder and files to help in the generation of the pdf document
+ generator: -self.set_environment - creates the required temporary f…
…older and files to help in the generation of the pdf document
+ generator: specs -> -self.unset_environment - deletes the required …
…temporary folder and files to help in the generation of the pdf document
+ generator: -self.unset_environment - deletes the required temporary…
… folder and files to help in the generation of the pdf document
+ generator: specs -> -self.document_path - return the document path …
…to be used in the generation of the pdf file
+ generator: spec_helper -> added 2 new methods for returning path to…
… pdf css file and to create an empty examplar
+ generator: specs -> +pdf - generate a pdf document out of html file…
…s -- specced in -self.print since it calls it to generate pdf
% generator: use of Pathname instead of String to paths, comments, do…
…cs and now options_for_pdf_kit takes care of the document body too
Owner

devn commented Feb 22, 2013

Apologies for not responding sooner, especially given the amount of time you put into this PR. I'll review within the next few days.

np! if you have anyquestions do not hesitate to contact me. I hope you find it useful!
Thanks for your time.

Owner

devn commented May 10, 2013

Could you explain your commit message syntax?

My commit messages usuall have the following format:

symbol branch_name: what -> work done - message/notes -- additional remarks.

The symbol in the beginning of the sentance indicates what was done in that commit. In the case of a:
. (dot) something was changed (for example something on a view)
% indicates that refactoring took place
! a bug correction was done

  • or - some feature (regarding architecture) was added or removed

branch name - tells where the work was done (in this case the generator)
what - tells about the subject matter that was under work - for example a refactor of a method or the addition of a new method and then a little explanation about the work done.

I must admit that in some cases (new method addition) I should have commited the spec along with the method it self.

so in the case of this commit:

% generator: specs -> long hashes reduced

says that some refactoring was done in the specs (all or just a few) of the generator of the project.

  • generator: -self.set_environment - creates the required temporary folder and files to help in the generation of the pdf document

says that a new private class method named set_environment was added. then the message. Possible remark notes could be -- calls other class method and doc missing.

There are people that don't like this kind of commit syntax but i always find it easy when finding for commits where bugs were added. Usually when I want to go through the code to look for some particular code commit, this commit syntax helped me a lot.

Anyways, some people don't like but it was always useful to me.

when there is a bullet point i mean a plus symbol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment