Skip to content

Commit

Permalink
File.join() is our friend for joining paths
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurish committed Apr 3, 2017
1 parent 98f4f2e commit 722ee6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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
Expand Down

0 comments on commit 722ee6e

Please sign in to comment.