Skip to content

Instantly share code, notes, and snippets.

@luislavena
Created February 7, 2009 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luislavena/60049 to your computer and use it in GitHub Desktop.
Save luislavena/60049 to your computer and use it in GitHub Desktop.
New RubyInstaller 7zip Bootstrap Recipe
#
# 7zip Recipe
#
# To avoid dependency on advanced extraction tools, this recipe grabs
# 7zip binaries for Windows and replace the built-in extract mechanism
# to allow unpacking of other formats beyond Zip files.
# SevenZip module contains the methods that replace buit-in functionality
# moved into it's own file for readability.
require File.join(File.dirname(__FILE__), 'seven_zip')
OneClick::Package.new('7zip', '4.64') do
# download task uses OneClick::Utils.extract helper
download 'http://downloads.sourceforge.net/sevenzip/7za464.zip'
after :extract do |pkg|
# Supply the new executable (found inside package/version/source)
SevenZip.executable = File.join(pkg.source_dir, '7za.exe')
module OneClick::Utils
def self.extract(*args)
SevenZip.extract(*args)
end
end
end
end
# make '7zip' default to the version defined above
task '7zip' => ['7zip:4.64']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment