From 82dafe047ec701ecd8d62c8088152fe2c4ab1a5d Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 10 Aug 2016 23:26:09 -0400 Subject: s/entry.read/entry.write/ and add Writers::DirEntry --- README.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index d378703..be0d075 100644 --- a/README.md +++ b/README.md @@ -33,16 +33,13 @@ end # create memory io mem_io = MemoryIO.new -# open "/some/other/path/image.png" for writing -File.open("/some/other/path/image.png", "wb") do |file_io| - # read from "foo.zip" - Zip.read("foo.zip") do |zip| - # extract "bar.txt" to mem_io - zip["bar.txt"].read(mem_io) - - # extract "image.png" to file_io - zip["image.png"].read(file_io) - end +# read from "foo.zip" +Zip.read("foo.zip") do |zip| + # extract "bar.txt" to mem_io + zip["bar.txt"].write(mem_io) + + # extract "image.png" to "output-image.png" + zip["image.png"].write("output-image.png") end ``` -- cgit v1.2.3