One problem with packages like Ruby is they include all the source files into a versioned folder instead of root. These changes relocate those folders when found.
Leverage in RubyZip (0.9.1) to extract zip file contents into specified destination folders. RubyZip source was added to lib/contrib/zip folder. Defined Zip::extract as simple helper (hides the complexity of RubyZip). Updated OneClick::Utils#extract to reflect the dependency Generate an error if any other file type is tried to be extracted (we need to bootstrap the the extraction).
Call to OneClick::Utils#extract for extraction of files. Added before and after actions and persistance. Ensured task execution.
On previous implementation all the actions are executed one time only, since it used a checkpoint file to avoid double execution. That practice is good for actions that affect files in the structure, but render useless for tasks that only alter current environment, like compiler flags or environment. This new method allows execution of persistent tasks (:persist => true) and also non-persisting tasks. after :extract do # this will be executed always end after :extract, :persist => true do # this only will be executed once and marked in the checkpoint end
Thanks Flay again for that.