aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-08-10 23:26:09 -0400
committerPaul Duncan <pabs@pablotron.org>2016-08-10 23:26:09 -0400
commit82dafe047ec701ecd8d62c8088152fe2c4ab1a5d (patch)
treeb230848006cb10f35d2161be8af7f253c98dad84 /README.md
parent59439a27a8ae5a5a9ed68022b3fe1d080abd7149 (diff)
downloadzip-crystal-82dafe047ec701ecd8d62c8088152fe2c4ab1a5d.tar.bz2
zip-crystal-82dafe047ec701ecd8d62c8088152fe2c4ab1a5d.zip
s/entry.read/entry.write/ and add Writers::DirEntry
Diffstat (limited to 'README.md')
-rw-r--r--README.md17
1 files changed, 7 insertions, 10 deletions
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
```