Tuesday, December 30, 2008

Zipping folders in a folder Ruby script

I love downloading manga from One Manga and read them later with Comix. To view it in chapter order, Comix requires compressed manga not folder. This is an approach to automagically generate them.
#!/usr/bin/env ruby
Dir["*"].each do |file|
if File.directory?(file)
#tODO add OS spesific,
# if win use 7z instead.
`zip -r "#{file}.zip" "#{file}"`
end
end


folder_to_zip.rb