Merge pull request #321 from gaurish/patch-1

File.join() is our friend for joining paths
This commit is contained in:
Alexander Simonov 2017-08-02 17:02:10 +03:00 committed by GitHub
commit fc83680f47
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
# Two arguments:
# - The name of the file as it will appear in the archive
# - The original file, including the path to find it
zipfile.add(filename, folder + '/' + filename)
zipfile.add(filename, File.join(folder, filename))
end
zipfile.get_output_stream("myFile") { |os| os.write "myFile contains just this" }
end