Being able to effectively compress a file is a serious asset when you start talking about data storage. The more efficient the compression, the more information can be stored in the same amount of space. There are two popular Ruby compression libraries in use today. The first is ruby-zlib, and the second is rubyzip. Both have their advantages and disadvantages, and I'll leave it to you to choose a compression algorithm that fits your purpose. I will be using rubyzip in the following script.
require 'zip/zip' unless ARGV puts "Usage: ruby compress.rb <filename.ext>" puts "Example: ruby compress.rb ...