Module: Struggle

Defined in:
lib/struggle/rsa.rb,
lib/struggle.rb,
lib/struggle/aes.rb,
lib/struggle/sms.rb,
lib/struggle/sql.rb,
lib/struggle/code.rb,
lib/struggle/http.rb,
lib/struggle/getui.rb,
lib/struggle/pager.rb,
lib/struggle/tfile.rb,
lib/struggle/backup.rb,
lib/struggle/tmagick.rb,
lib/struggle/ftp_tool.rb,
lib/struggle/logistic.rb,
lib/struggle/zip_tool.rb,
lib/struggle/translate.rb,
lib/struggle/concerns/int_extend.rb,
lib/struggle/concerns/time_extend.rb,
lib/struggle/concerns/model_extend.rb,
lib/struggle/concerns/string_extend.rb,
lib/struggle/concerns/decimal_extend.rb,
lib/generators/struggle/sql_config_generator.rb,
lib/generators/struggle/backup_config_generator.rb

Overview

This is a simple example which uses rubyzip to recursively generate a zip file from the contents of a specified directory. The directory itself is not included in the archive, rather just its contents.

Usage:

directory_to_zip = "/tmp/input"
output_file = "/tmp/out.zip"
ZipTool.dir(directory_to_zip, output_file)
ZipTool.dir("1.txt", output_file)

Defined Under Namespace

Modules: DecimalExtend, Generators, IntExtend, ModelExtend, StringExtend, TimeExtend Classes: Aes, Backup, Code, FtpTool, Getui, Http, Logistic, Pager, Rsa, Sms, Sql, Tfile, Tmagick, Translate, ZipTool