Created
October 29, 2008 17:00
-
-
Save chad/20746 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rubygems/package' | |
def write_package | |
open "/tmp/blah.rn", 'wb' do |io| | |
Gem::Package.open io, 'w' do |pkg| | |
#pkg.metadata = @spec.to_yaml | |
Dir["**/*"].each do |file| | |
next if File.directory? file | |
stat = File.stat file | |
mode = stat.mode & 0777 | |
size = stat.size | |
pkg.add_file_simple file, mode, size do |tar_io| | |
tar_io.write open(file, "rb") { |f| f.read } | |
end | |
end | |
end | |
end | |
end | |
write_package |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment