From 722ee6efa94722347e3bd67018bff6b4d4a52045 Mon Sep 17 00:00:00 2001 From: Gaurish Sharma Date: Mon, 3 Apr 2017 14:15:31 -0500 Subject: [PATCH] File.join() is our friend for joining paths --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8979d06f..354b82da 100644 --- a/README.md +++ b/README.md @@ -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