ruby - RubyZip - files from different directories have path in zip -


I'm trying to use rubypip to package some files, I currently have a method that is special Visually zips on directory and sub-directories

  def zip_directory (zipfile) Dir ["# {@ directory_ to_zip} / ** / **"] Reject {| F | Reject_file (f)} Do each. File_path | File_name = file_path.sub (@directory_to_zip + '/', ''); However, I want to include a file from a completely separate folder, I have the following method to solve: Zipfile.add (file_name, file_path) and end  

/ P>

  def zip_additional (zipfile) additional_files.reject {| F | Reject_file (f)} Do each. File_path | File_name = file_path.split ('\\'). The last zipfile.add file (file_name, file_path) expired  

The file has been added, instead of giving the place, file the directory structure copies in the root of the folder. This is really annoying and makes working with it more difficult.

How can I do this?

thanks

The full path for ZIP (or out) zip libraries, check that setting


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -