lib/piedesaint.rb in piedesaint-0.0.1 vs lib/piedesaint.rb in piedesaint-0.0.2
- old
+ new
@@ -142,10 +142,10 @@
def self.tar(path)
tar = StringIO.new
Gem::Package::TarWriter.new(tar) do |tarwriter|
Dir[File.join(path, "**/{*,.*}")].each do |file|
mode = File.stat(file).mode
- relative_file = file.sub /^#{Regexp::escape path}\/?/, ''
+ relative_file = File.join(File.basename(path), file.sub(/^#{Regexp::escape path}\/?/, ''))
if File.directory? file
next if [ ".", ".."].include? File.basename(file)
tarwriter.mkdir relative_file, mode
else
\ No newline at end of file